diff options
Diffstat (limited to 'media')
76 files changed, 54 insertions, 331 deletions
diff --git a/media/audio/android/audio_manager_android.cc b/media/audio/android/audio_manager_android.cc index 9feb5c7..04a0564 100644 --- a/media/audio/android/audio_manager_android.cc +++ b/media/audio/android/audio_manager_android.cc @@ -11,8 +11,6 @@ #include "media/audio/audio_manager.h" #include "media/audio/fake_audio_input_stream.h" -namespace media { - // Maximum number of output streams that can be open simultaneously. static const int kMaxOutputStreams = 10; @@ -67,5 +65,3 @@ AudioInputStream* AudioManagerAndroid::MakeLowLatencyInputStream( DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); return new OpenSLESInputStream(this, params); } - -} // namespace media diff --git a/media/audio/android/audio_manager_android.h b/media/audio/android/audio_manager_android.h index 90e319a..5d42270 100644 --- a/media/audio/android/audio_manager_android.h +++ b/media/audio/android/audio_manager_android.h @@ -7,8 +7,6 @@ #include "media/audio/audio_manager_base.h" -namespace media { - // Android implemention of AudioManager. class AudioManagerAndroid : public AudioManagerBase { public: @@ -37,6 +35,4 @@ class AudioManagerAndroid : public AudioManagerBase { DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); }; -} // namespace media - #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ diff --git a/media/audio/android/audio_track_output_android.cc b/media/audio/android/audio_track_output_android.cc index 7342750..d65ff19 100644 --- a/media/audio/android/audio_track_output_android.cc +++ b/media/audio/android/audio_track_output_android.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,8 +12,6 @@ using base::android::AttachCurrentThread; using base::android::CheckException; -namespace media { - static const int kTimerIntervalInMilliseconds = 50; class AudioTrackOutputStream::StreamBuffer { @@ -311,5 +309,3 @@ void AudioTrackOutputStream::FillAudioBufferTask() { CheckException(env); env->DeleteLocalRef(buf); } - -} // namespace media diff --git a/media/audio/android/audio_track_output_android.h b/media/audio/android/audio_track_output_android.h index 0ab7647..ddeab43 100644 --- a/media/audio/android/audio_track_output_android.h +++ b/media/audio/android/audio_track_output_android.h @@ -14,8 +14,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerAndroid; // Implements PCM audio output support for Android using the AudioTrack API. @@ -70,6 +68,4 @@ class AudioTrackOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(AudioTrackOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_ANDROID_AUDIO_TRACK_OUTPUT_ANDROID_H_ diff --git a/media/audio/android/audio_track_output_stub_android.cc b/media/audio/android/audio_track_output_stub_android.cc index ab4f9ba..5171591 100644 --- a/media/audio/android/audio_track_output_stub_android.cc +++ b/media/audio/android/audio_track_output_stub_android.cc @@ -1,11 +1,9 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/audio/android/audio_track_output_android.h" -namespace media { - // This file was added because there is no Java environment in // upstream yet, audio_track_output_android.cc should be used in // downstream. @@ -16,5 +14,3 @@ AudioOutputStream* AudioTrackOutputStream::MakeStream( const AudioParameters& params) { return NULL; } - -} // namespace media diff --git a/media/audio/audio_buffers_state.cc b/media/audio/audio_buffers_state.cc index 6c4f950..7e829fe 100644 --- a/media/audio/audio_buffers_state.cc +++ b/media/audio/audio_buffers_state.cc @@ -4,8 +4,6 @@ #include "media/audio/audio_buffers_state.h" -namespace media { - AudioBuffersState::AudioBuffersState() : pending_bytes(0), hardware_delay_bytes(0) { @@ -16,5 +14,3 @@ AudioBuffersState::AudioBuffersState(int pending_bytes, : pending_bytes(pending_bytes), hardware_delay_bytes(hardware_delay_bytes) { } - -} // namespace media diff --git a/media/audio/audio_buffers_state.h b/media/audio/audio_buffers_state.h index 79244ae..a7299e1 100644 --- a/media/audio/audio_buffers_state.h +++ b/media/audio/audio_buffers_state.h @@ -7,8 +7,6 @@ #include "media/base/media_export.h" -namespace media { - // AudioBuffersState struct stores current state of audio buffers. // It is used for audio synchronization. struct MEDIA_EXPORT AudioBuffersState { @@ -27,6 +25,4 @@ struct MEDIA_EXPORT AudioBuffersState { int hardware_delay_bytes; }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ diff --git a/media/audio/audio_input_device_unittest.cc b/media/audio/audio_input_device_unittest.cc index c0a4dde..470dbab 100644 --- a/media/audio/audio_input_device_unittest.cc +++ b/media/audio/audio_input_device_unittest.cc @@ -15,8 +15,7 @@ #endif using base::win::ScopedCOMInitializer; - -namespace media { +using media::AudioDeviceNames; // Test fixture which allows us to override the default enumeration API on // Windows. @@ -172,5 +171,3 @@ TEST_F(AudioInputDeviceTest, ConvertToWinXPDeviceId) { } #endif - -} // namespace media diff --git a/media/audio/audio_input_stream_impl.cc b/media/audio/audio_input_stream_impl.cc index f68317c..529a9c4 100644 --- a/media/audio/audio_input_stream_impl.cc +++ b/media/audio/audio_input_stream_impl.cc @@ -5,8 +5,6 @@ #include "base/logging.h" #include "media/audio/audio_input_stream_impl.h" -namespace media { - static const int kMinIntervalBetweenVolumeUpdatesMs = 1000; AudioInputStreamImpl::AudioInputStreamImpl() @@ -68,4 +66,3 @@ void AudioInputStreamImpl::GetNormalizedVolume() { } } -} // namespace media diff --git a/media/audio/audio_input_stream_impl.h b/media/audio/audio_input_stream_impl.h index 64980a9..d223985 100644 --- a/media/audio/audio_input_stream_impl.h +++ b/media/audio/audio_input_stream_impl.h @@ -10,8 +10,6 @@ #include "base/time.h" #include "media/audio/audio_io.h" -namespace media { - // AudioInputStreamImpl implements platform-independent parts of the // AudioInputStream interface. Each platform dependent implementation // should derive from this class. @@ -66,6 +64,4 @@ class MEDIA_EXPORT AudioInputStreamImpl : public AudioInputStream { DISALLOW_COPY_AND_ASSIGN(AudioInputStreamImpl); }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_INPUT_STREAM_IMPL_H_ diff --git a/media/audio/audio_input_unittest.cc b/media/audio/audio_input_unittest.cc index ee7d6d8..8d7b2ac 100644 --- a/media/audio/audio_input_unittest.cc +++ b/media/audio/audio_input_unittest.cc @@ -11,8 +11,6 @@ #include "media/audio/audio_manager_base.h" #include "testing/gtest/include/gtest/gtest.h" -namespace media { - static const int kSamplingRate = 8000; static const int kSamplesPerPacket = kSamplingRate / 20; @@ -172,5 +170,3 @@ TEST(AudioInputTest, Record) { ais->Stop(); ais->Close(); } - -} // namespace media diff --git a/media/audio/audio_input_volume_unittest.cc b/media/audio/audio_input_volume_unittest.cc index c49187e..99f4e83 100644 --- a/media/audio/audio_input_volume_unittest.cc +++ b/media/audio/audio_input_volume_unittest.cc @@ -12,8 +12,7 @@ #include "testing/gtest/include/gtest/gtest.h" using base::win::ScopedCOMInitializer; - -namespace media { +using media::AudioDeviceNames; class AudioInputVolumeTest : public ::testing::Test { protected: @@ -158,5 +157,3 @@ TEST_F(AudioInputVolumeTest, InputVolumeTest) { ais->Close(); } } - -} // namespace media diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h index cb83576..489e0ab 100644 --- a/media/audio/audio_io.h +++ b/media/audio/audio_io.h @@ -45,9 +45,6 @@ // as the data is written to the audio device. Size of each packet is determined // by |samples_per_packet| specified in AudioParameters when the stream is // created. - -namespace media { - class MEDIA_EXPORT AudioOutputStream { public: // Audio sources must implement AudioSourceCallback. This interface will be @@ -176,6 +173,4 @@ class MEDIA_EXPORT AudioInputStream { virtual bool GetAutomaticGainControl() = 0; }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_IO_H_ diff --git a/media/audio/audio_low_latency_input_output_unittest.cc b/media/audio/audio_low_latency_input_output_unittest.cc index 8d501ca..7064063 100644 --- a/media/audio/audio_low_latency_input_output_unittest.cc +++ b/media/audio/audio_low_latency_input_output_unittest.cc @@ -29,10 +29,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using base::win::ScopedCOMInitializer; - -namespace media { - #if defined(OS_LINUX) || defined(OS_OPENBSD) typedef AudioManagerLinux AudioManagerAnyPlatform; #elif defined(OS_MACOSX) @@ -43,6 +39,9 @@ typedef AudioManagerWin AudioManagerAnyPlatform; typedef AudioManagerAndroid AudioManagerAnyPlatform; #endif +using base::win::ScopedCOMInitializer; + +namespace { // Limits the number of delay measurements we can store in an array and // then write to file at end of the WASAPIAudioInputOutputFullDuplex test. static const size_t kMaxDelayMeasurements = 1000; @@ -123,6 +122,8 @@ class AudioLowLatencyInputOutputTest : public testing::Test { DISALLOW_COPY_AND_ASSIGN(AudioLowLatencyInputOutputTest); }; +} // namespace + // This audio source/sink implementation should be used for manual tests // only since delay measurements are stored on an output text file. // All incoming/recorded audio packets are stored in an intermediate media @@ -462,5 +463,3 @@ TEST_F(AudioLowLatencyInputOutputTest, DISABLED_FullDuplexDelayMeasurement) { aos->Close(); ais->Close(); } - -} // namespace media diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc index 028b409..d118789 100644 --- a/media/audio/audio_manager.cc +++ b/media/audio/audio_manager.cc @@ -8,8 +8,6 @@ #include "base/logging.h" #include "base/message_loop.h" -namespace media { - // Forward declaration of the platform specific AudioManager factory function. AudioManager* CreateAudioManager(); @@ -25,5 +23,3 @@ AudioManager* AudioManager::Create() { ret->Init(); return ret; } - -} // namespace media diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h index 704d48f..e1f0145 100644 --- a/media/audio/audio_manager.h +++ b/media/audio/audio_manager.h @@ -13,17 +13,13 @@ #include "media/audio/audio_device_name.h" #include "media/audio/audio_parameters.h" +class AudioInputStream; +class AudioOutputStream; class MessageLoop; - namespace base { class MessageLoopProxy; } -namespace media { - -class AudioInputStream; -class AudioOutputStream; - // Manages all audio resources. In particular it owns the AudioOutputStream // objects. Provides some convenience functions that avoid the need to provide // iterators over the existing streams. @@ -61,7 +57,8 @@ class MEDIA_EXPORT AudioManager { // Appends a list of available input devices. It is not guaranteed that // all the devices in the list support all formats and sample rates for // recording. - virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) = 0; + virtual void GetAudioInputDeviceNames( + media::AudioDeviceNames* device_names) = 0; // Factory for all the supported stream formats. |params| defines parameters // of the audio stream to be created. @@ -127,6 +124,4 @@ class MEDIA_EXPORT AudioManager { DISALLOW_COPY_AND_ASSIGN(AudioManager); }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ diff --git a/media/audio/audio_manager_base.cc b/media/audio/audio_manager_base.cc index 45bf0fc..89191af 100644 --- a/media/audio/audio_manager_base.cc +++ b/media/audio/audio_manager_base.cc @@ -12,8 +12,6 @@ #include "media/audio/fake_audio_input_stream.h" #include "media/audio/fake_audio_output_stream.h" -namespace media { - static const int kStreamCloseDelaySeconds = 5; // Default maximum number of output streams that can be open simultaneously @@ -228,5 +226,3 @@ void AudioManagerBase::ShutdownOnAudioThread() { output_dispatchers_.clear(); } - -} // namespace media diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h index acb85b6..ba27221 100644 --- a/media/audio/audio_manager_base.h +++ b/media/audio/audio_manager_base.h @@ -13,14 +13,12 @@ #include "base/synchronization/lock.h" #include "media/audio/audio_manager.h" +class AudioOutputDispatcher; + namespace base { class Thread; } -namespace media { - -class AudioOutputDispatcher; - // AudioManagerBase provides AudioManager functions common for all platforms. class MEDIA_EXPORT AudioManagerBase : public AudioManager { public: @@ -126,6 +124,4 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager { DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ diff --git a/media/audio/audio_output_controller_unittest.cc b/media/audio/audio_output_controller_unittest.cc index 05f3d7f..cd65f5b 100644 --- a/media/audio/audio_output_controller_unittest.cc +++ b/media/audio/audio_output_controller_unittest.cc @@ -22,8 +22,6 @@ using ::testing::InvokeWithoutArgs; using ::testing::NotNull; using ::testing::Return; -namespace media { - static const int kSampleRate = AudioParameters::kAudioCDSampleRate; static const int kBitsPerSample = 16; static const ChannelLayout kChannelLayout = CHANNEL_LAYOUT_STEREO; @@ -31,6 +29,8 @@ static const int kSamplesPerPacket = kSampleRate / 10; static const int kHardwareBufferSize = kSamplesPerPacket * ChannelLayoutToChannelCount(kChannelLayout) * kBitsPerSample / 8; +namespace media { + class MockAudioOutputControllerEventHandler : public AudioOutputController::EventHandler { public: diff --git a/media/audio/audio_output_dispatcher.cc b/media/audio/audio_output_dispatcher.cc index 998fc1b..1ac7e8a 100644 --- a/media/audio/audio_output_dispatcher.cc +++ b/media/audio/audio_output_dispatcher.cc @@ -10,8 +10,6 @@ #include "base/time.h" #include "media/audio/audio_io.h" -namespace media { - AudioOutputDispatcher::AudioOutputDispatcher( AudioManager* audio_manager, const AudioParameters& params, base::TimeDelta close_delay) @@ -170,5 +168,3 @@ void AudioOutputDispatcher::ClosePendingStreams() { idle_streams_.pop_back(); } } - -} // namespace media diff --git a/media/audio/audio_output_dispatcher.h b/media/audio/audio_output_dispatcher.h index 79474a4..cf01a31 100644 --- a/media/audio/audio_output_dispatcher.h +++ b/media/audio/audio_output_dispatcher.h @@ -32,11 +32,8 @@ #include "media/audio/audio_manager.h" #include "media/audio/audio_parameters.h" -class MessageLoop; - -namespace media { - class AudioOutputStream; +class MessageLoop; class MEDIA_EXPORT AudioOutputDispatcher : public base::RefCountedThreadSafe<AudioOutputDispatcher> { @@ -110,6 +107,4 @@ class MEDIA_EXPORT AudioOutputDispatcher DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcher); }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_H_ diff --git a/media/audio/audio_output_proxy.cc b/media/audio/audio_output_proxy.cc index b1d65ba..29490db 100644 --- a/media/audio/audio_output_proxy.cc +++ b/media/audio/audio_output_proxy.cc @@ -9,8 +9,6 @@ #include "media/audio/audio_manager.h" #include "media/audio/audio_output_dispatcher.h" -namespace media { - AudioOutputProxy::AudioOutputProxy(AudioOutputDispatcher* dispatcher) : dispatcher_(dispatcher), state_(kCreated), @@ -95,5 +93,3 @@ void AudioOutputProxy::Close() { // dispatcher+audio manager. delete this; } - -} // namespace media diff --git a/media/audio/audio_output_proxy.h b/media/audio/audio_output_proxy.h index d34f81f..8e1b350 100644 --- a/media/audio/audio_output_proxy.h +++ b/media/audio/audio_output_proxy.h @@ -12,8 +12,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioOutputDispatcher; // AudioOutputProxy is an audio otput stream that uses resources more @@ -64,6 +62,4 @@ class MEDIA_EXPORT AudioOutputProxy DISALLOW_COPY_AND_ASSIGN(AudioOutputProxy); }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_OUTPUT_PROXY_H_ diff --git a/media/audio/audio_output_proxy_unittest.cc b/media/audio/audio_output_proxy_unittest.cc index 3dbfd2f2..1f955b6 100644 --- a/media/audio/audio_output_proxy_unittest.cc +++ b/media/audio/audio_output_proxy_unittest.cc @@ -14,15 +14,6 @@ using ::testing::_; using ::testing::Mock; using ::testing::Return; -using media::AudioBuffersState; -using media::AudioInputStream; -using media::AudioManager; -using media::AudioOutputDispatcher; -using media::AudioOutputProxy; -using media::AudioOutputStream; -using media::AudioParameters; - -namespace { static const int kTestCloseDelayMs = 100; @@ -74,10 +65,6 @@ class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); }; -} // namespace - -namespace media { - class AudioOutputProxyTest : public testing::Test { protected: virtual void SetUp() { @@ -384,5 +371,3 @@ TEST_F(AudioOutputProxyTest, StartFailed) { proxy->Close(); } - -} // namespace media diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc index fb9b6f2..852bd12 100644 --- a/media/audio/audio_parameters.cc +++ b/media/audio/audio_parameters.cc @@ -6,8 +6,6 @@ #include "media/base/limits.h" -namespace media { - AudioParameters::AudioParameters() : format_(AUDIO_PCM_LINEAR), channel_layout_(CHANNEL_LAYOUT_NONE), @@ -83,5 +81,3 @@ bool AudioParameters::Compare::operator()( return false; return a.frames_per_buffer_ < b.frames_per_buffer_; } - -} // namespace media diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h index 8ce2070..392d328 100644 --- a/media/audio/audio_parameters.h +++ b/media/audio/audio_parameters.h @@ -9,8 +9,6 @@ #include "media/base/channel_layout.h" #include "media/base/media_export.h" -namespace media { - struct MEDIA_EXPORT AudioInputBufferParameters { double volume; uint32 size; @@ -85,6 +83,4 @@ class MEDIA_EXPORT AudioParameters { // |channel_layout|. }; -} // namespace media - #endif // MEDIA_AUDIO_AUDIO_PARAMETERS_H_ diff --git a/media/audio/audio_parameters_unittest.cc b/media/audio/audio_parameters_unittest.cc index 1a1140b..bd3334f 100644 --- a/media/audio/audio_parameters_unittest.cc +++ b/media/audio/audio_parameters_unittest.cc @@ -7,8 +7,6 @@ #include "media/audio/audio_parameters.h" #include "testing/gtest/include/gtest/gtest.h" -namespace media { - TEST(AudioParameters, Constructor_Default) { AudioParameters::Format expected_format = AudioParameters::AUDIO_PCM_LINEAR; int expected_bits = 0; @@ -165,5 +163,3 @@ TEST(AudioParameters, Compare) { EXPECT_FALSE(target(values[i], values[i])); } } - -} // namespace media diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc index 47366a0..d5ba994 100644 --- a/media/audio/fake_audio_input_stream.cc +++ b/media/audio/fake_audio_input_stream.cc @@ -10,8 +10,6 @@ using base::Time; using base::TimeDelta; -namespace media { - AudioInputStream* FakeAudioInputStream::MakeFakeStream( AudioManagerBase* manager, const AudioParameters& params) { @@ -95,5 +93,3 @@ void FakeAudioInputStream::SetAutomaticGainControl(bool enabled) {} bool FakeAudioInputStream::GetAutomaticGainControl() { return false; } - -} // namespace media diff --git a/media/audio/fake_audio_input_stream.h b/media/audio/fake_audio_input_stream.h index ceed1a0..409b799 100644 --- a/media/audio/fake_audio_input_stream.h +++ b/media/audio/fake_audio_input_stream.h @@ -13,11 +13,9 @@ #include "base/threading/thread.h" #include "base/time.h" #include "media/audio/audio_io.h" - -namespace media { +#include "media/audio/audio_parameters.h" class AudioManagerBase; -class AudioParameters; class MEDIA_EXPORT FakeAudioInputStream : public AudioInputStream { @@ -54,6 +52,4 @@ class MEDIA_EXPORT FakeAudioInputStream DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ diff --git a/media/audio/fake_audio_output_stream.cc b/media/audio/fake_audio_output_stream.cc index 686ccde..14a38cd 100644 --- a/media/audio/fake_audio_output_stream.cc +++ b/media/audio/fake_audio_output_stream.cc @@ -8,8 +8,6 @@ #include "base/logging.h" #include "media/audio/audio_manager_base.h" -namespace media { - FakeAudioOutputStream* FakeAudioOutputStream::current_fake_stream_ = NULL; // static @@ -72,5 +70,3 @@ FakeAudioOutputStream::~FakeAudioOutputStream() { if (current_fake_stream_ == this) current_fake_stream_ = NULL; } - -} // namespace media diff --git a/media/audio/fake_audio_output_stream.h b/media/audio/fake_audio_output_stream.h index d4ab11a..19ed576 100644 --- a/media/audio/fake_audio_output_stream.h +++ b/media/audio/fake_audio_output_stream.h @@ -15,8 +15,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerBase; class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream { @@ -54,6 +52,4 @@ class MEDIA_EXPORT FakeAudioOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(FakeAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_FAKE_AUDIO_OUTPUT_STREAM_H_ diff --git a/media/audio/linux/alsa_input.cc b/media/audio/linux/alsa_input.cc index 84d2933..e28867f 100644 --- a/media/audio/linux/alsa_input.cc +++ b/media/audio/linux/alsa_input.cc @@ -15,8 +15,6 @@ #include "media/audio/linux/alsa_wrapper.h" #include "media/audio/linux/audio_manager_linux.h" -namespace media { - static const int kNumPacketsInRingBuffer = 3; static const char kDefaultDevice1[] = "default"; @@ -343,5 +341,3 @@ void AlsaPcmInputStream::HandleError(const char* method, int error) { LOG(WARNING) << method << ": " << wrapper_->StrError(error); callback_->OnError(this, error); } - -} // namespace media diff --git a/media/audio/linux/alsa_input.h b/media/audio/linux/alsa_input.h index ae027d4..6f6a981 100644 --- a/media/audio/linux/alsa_input.h +++ b/media/audio/linux/alsa_input.h @@ -17,8 +17,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AlsaWrapper; class AudioManagerLinux; @@ -87,6 +85,4 @@ class AlsaPcmInputStream : public AudioInputStreamImpl { DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc index d940be9..fc74180 100644 --- a/media/audio/linux/alsa_output.cc +++ b/media/audio/linux/alsa_output.cc @@ -49,8 +49,6 @@ #include "media/base/data_buffer.h" #include "media/base/seekable_buffer.h" -namespace media { - // Amount of time to wait if we've exhausted the data source. This is to avoid // busy looping. static const uint32 kNoDataSleepMilliseconds = 10; @@ -799,5 +797,3 @@ void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { DCHECK(IsOnAudioThread()); source_callback_ = callback; } - -} // namespace media diff --git a/media/audio/linux/alsa_output.h b/media/audio/linux/alsa_output.h index 43e75bb..ee257eb 100644 --- a/media/audio/linux/alsa_output.h +++ b/media/audio/linux/alsa_output.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -32,13 +32,13 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -class MessageLoop; - namespace media { +class SeekableBuffer; +}; // namespace media class AlsaWrapper; class AudioManagerLinux; -class SeekableBuffer; +class MessageLoop; class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream { public: @@ -210,6 +210,4 @@ class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream { MEDIA_EXPORT std::ostream& operator<<(std::ostream& os, AlsaPcmOutputStream::InternalState); -}; // namespace media - #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ diff --git a/media/audio/linux/alsa_output_unittest.cc b/media/audio/linux/alsa_output_unittest.cc index be605c1..ab9a654 100644 --- a/media/audio/linux/alsa_output_unittest.cc +++ b/media/audio/linux/alsa_output_unittest.cc @@ -29,8 +29,6 @@ using testing::StrictMock; using testing::StrEq; using testing::Unused; -namespace media { - class MockAlsaWrapper : public AlsaWrapper { public: MOCK_METHOD3(DeviceNameHint, int(int card, @@ -826,5 +824,3 @@ TEST_F(AlsaPcmOutputStreamTest, ScheduleNextWrite_StopStream) { test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); test_stream->Close(); } - -} // namespace media diff --git a/media/audio/linux/alsa_util.cc b/media/audio/linux/alsa_util.cc index 176ef69..5137119 100644 --- a/media/audio/linux/alsa_util.cc +++ b/media/audio/linux/alsa_util.cc @@ -11,7 +11,7 @@ namespace alsa_util { -static snd_pcm_t* OpenDevice(media::AlsaWrapper* wrapper, +static snd_pcm_t* OpenDevice(AlsaWrapper* wrapper, const char* device_name, snd_pcm_stream_t type, int channels, @@ -81,7 +81,7 @@ snd_pcm_format_t BitsToFormat(int bits_per_sample) { } } -int CloseDevice(media::AlsaWrapper* wrapper, snd_pcm_t* handle) { +int CloseDevice(AlsaWrapper* wrapper, snd_pcm_t* handle) { std::string device_name = wrapper->PcmName(handle); int error = wrapper->PcmClose(handle); if (error < 0) { @@ -92,7 +92,7 @@ int CloseDevice(media::AlsaWrapper* wrapper, snd_pcm_t* handle) { return error; } -snd_pcm_t* OpenCaptureDevice(media::AlsaWrapper* wrapper, +snd_pcm_t* OpenCaptureDevice(AlsaWrapper* wrapper, const char* device_name, int channels, int sample_rate, @@ -102,7 +102,7 @@ snd_pcm_t* OpenCaptureDevice(media::AlsaWrapper* wrapper, sample_rate, pcm_format, latency_us); } -snd_pcm_t* OpenPlaybackDevice(media::AlsaWrapper* wrapper, +snd_pcm_t* OpenPlaybackDevice(AlsaWrapper* wrapper, const char* device_name, int channels, int sample_rate, @@ -112,7 +112,7 @@ snd_pcm_t* OpenPlaybackDevice(media::AlsaWrapper* wrapper, sample_rate, pcm_format, latency_us); } -snd_mixer_t* OpenMixer(media::AlsaWrapper* wrapper, +snd_mixer_t* OpenMixer(AlsaWrapper* wrapper, const std::string& device_name) { snd_mixer_t* mixer = NULL; @@ -143,7 +143,7 @@ snd_mixer_t* OpenMixer(media::AlsaWrapper* wrapper, return mixer; } -void CloseMixer(media::AlsaWrapper* wrapper, snd_mixer_t* mixer, +void CloseMixer(AlsaWrapper* wrapper, snd_mixer_t* mixer, const std::string& device_name) { if (!mixer) return; @@ -166,7 +166,7 @@ void CloseMixer(media::AlsaWrapper* wrapper, snd_mixer_t* mixer, } } -snd_mixer_elem_t* LoadCaptureMixerElement(media::AlsaWrapper* wrapper, +snd_mixer_elem_t* LoadCaptureMixerElement(AlsaWrapper* wrapper, snd_mixer_t* mixer) { if (!mixer) return NULL; diff --git a/media/audio/linux/alsa_util.h b/media/audio/linux/alsa_util.h index 53cf80a..054d24d 100644 --- a/media/audio/linux/alsa_util.h +++ b/media/audio/linux/alsa_util.h @@ -8,40 +8,37 @@ #include <alsa/asoundlib.h> #include <string> -namespace media { class AlsaWrapper; -} namespace alsa_util { snd_pcm_format_t BitsToFormat(int bits_per_sample); -snd_pcm_t* OpenCaptureDevice(media::AlsaWrapper* wrapper, +snd_pcm_t* OpenCaptureDevice(AlsaWrapper* wrapper, const char* device_name, int channels, int sample_rate, snd_pcm_format_t pcm_format, int latency_us); -snd_pcm_t* OpenPlaybackDevice(media::AlsaWrapper* wrapper, +snd_pcm_t* OpenPlaybackDevice(AlsaWrapper* wrapper, const char* device_name, int channels, int sample_rate, snd_pcm_format_t pcm_format, int latency_us); -int CloseDevice(media::AlsaWrapper* wrapper, snd_pcm_t* handle); +int CloseDevice(AlsaWrapper* wrapper, snd_pcm_t* handle); -snd_mixer_t* OpenMixer(media::AlsaWrapper* wrapper, - const std::string& device_name); +snd_mixer_t* OpenMixer(AlsaWrapper* wrapper, const std::string& device_name); -void CloseMixer(media::AlsaWrapper* wrapper, +void CloseMixer(AlsaWrapper* wrapper, snd_mixer_t* mixer, const std::string& device_name); -snd_mixer_elem_t* LoadCaptureMixerElement(media::AlsaWrapper* wrapper, +snd_mixer_elem_t* LoadCaptureMixerElement(AlsaWrapper* wrapper, snd_mixer_t* mixer); -} // namespace alsa_util +} #endif // MEDIA_AUDIO_LINUX_ALSA_UTIL_H_ diff --git a/media/audio/linux/alsa_wrapper.cc b/media/audio/linux/alsa_wrapper.cc index 67331b4..9e056d8 100644 --- a/media/audio/linux/alsa_wrapper.cc +++ b/media/audio/linux/alsa_wrapper.cc @@ -6,8 +6,6 @@ #include <alsa/asoundlib.h> -namespace media { - AlsaWrapper::AlsaWrapper() { } @@ -228,5 +226,3 @@ int AlsaWrapper::MixerSelemGetCaptureVolumeRange(snd_mixer_elem_t* elem, long* min, long* max) { return snd_mixer_selem_get_capture_volume_range(elem, min, max); } - -} // namespace media diff --git a/media/audio/linux/alsa_wrapper.h b/media/audio/linux/alsa_wrapper.h index 30d9463..49d64b2 100644 --- a/media/audio/linux/alsa_wrapper.h +++ b/media/audio/linux/alsa_wrapper.h @@ -11,8 +11,6 @@ #include "base/basictypes.h" #include "media/base/media_export.h" -namespace media { - class MEDIA_EXPORT AlsaWrapper { public: AlsaWrapper(); @@ -77,5 +75,3 @@ class MEDIA_EXPORT AlsaWrapper { int soft_resample, unsigned int latency); DISALLOW_COPY_AND_ASSIGN(AlsaWrapper); }; - -} // namespace media diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc index 0b34aaa..27d5749 100644 --- a/media/audio/linux/audio_manager_linux.cc +++ b/media/audio/linux/audio_manager_linux.cc @@ -23,8 +23,6 @@ #include "media/base/limits.h" #include "media/base/media_switches.h" -namespace media { - // Maximum number of output streams that can be open simultaneously. static const int kMaxOutputStreams = 50; @@ -311,5 +309,3 @@ AudioInputStream* AudioManagerLinux::MakeInputStream( AudioManager* CreateAudioManager() { return new AudioManagerLinux(); } - -} // namespace media diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h index d62d361..81e53c4 100644 --- a/media/audio/linux/audio_manager_linux.h +++ b/media/audio/linux/audio_manager_linux.h @@ -11,8 +11,6 @@ #include "base/threading/thread.h" #include "media/audio/audio_manager_base.h" -namespace media { - class AlsaWrapper; class MEDIA_EXPORT AudioManagerLinux : public AudioManagerBase { @@ -75,6 +73,4 @@ class MEDIA_EXPORT AudioManagerLinux : public AudioManagerBase { DISALLOW_COPY_AND_ASSIGN(AudioManagerLinux); }; -} // namespace media - #endif // MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_ diff --git a/media/audio/mac/audio_input_mac.cc b/media/audio/mac/audio_input_mac.cc index 2ae1651..0277a00 100644 --- a/media/audio/mac/audio_input_mac.cc +++ b/media/audio/mac/audio_input_mac.cc @@ -18,8 +18,6 @@ enum { }; #endif -namespace media { - PCMQueueInAudioInputStream::PCMQueueInAudioInputStream( AudioManagerMac* manager, const AudioParameters& params) : manager_(manager), @@ -219,5 +217,3 @@ void PCMQueueInAudioInputStream::HandleInputBuffer( HandleError(err); } } - -} // namespace media diff --git a/media/audio/mac/audio_input_mac.h b/media/audio/mac/audio_input_mac.h index d290bcb..1347871 100644 --- a/media/audio/mac/audio_input_mac.h +++ b/media/audio/mac/audio_input_mac.h @@ -12,8 +12,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerMac; // Implementation of AudioInputStream for Mac OS X using the audio queue service @@ -80,6 +78,4 @@ class PCMQueueInAudioInputStream : public AudioInputStream { DISALLOW_COPY_AND_ASSIGN(PCMQueueInAudioInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_MAC_AUDIO_INPUT_MAC_H_ diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc index dc9bd8a..075b055 100644 --- a/media/audio/mac/audio_low_latency_input_mac.cc +++ b/media/audio/mac/audio_low_latency_input_mac.cc @@ -12,8 +12,6 @@ #include "media/audio/audio_util.h" #include "media/audio/mac/audio_manager_mac.h" -namespace media { - static const int kMinIntervalBetweenVolumeUpdatesMs = 1000; static std::ostream& operator<<(std::ostream& os, @@ -606,5 +604,3 @@ bool AUAudioInputStream::IsVolumeSettableOnChannel(int channel) { &is_settable); return (result == noErr) ? is_settable : false; } - -} // namespace media diff --git a/media/audio/mac/audio_low_latency_input_mac.h b/media/audio/mac/audio_low_latency_input_mac.h index d35e439..d1e507f 100644 --- a/media/audio/mac/audio_low_latency_input_mac.h +++ b/media/audio/mac/audio_low_latency_input_mac.h @@ -46,8 +46,6 @@ #include "media/audio/audio_input_stream_impl.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerMac; class AUAudioInputStream : public AudioInputStreamImpl { @@ -148,6 +146,4 @@ class AUAudioInputStream : public AudioInputStreamImpl { DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ diff --git a/media/audio/mac/audio_low_latency_input_mac_unittest.cc b/media/audio/mac/audio_low_latency_input_mac_unittest.cc index 8b6972c..139a860 100644 --- a/media/audio/mac/audio_low_latency_input_mac_unittest.cc +++ b/media/audio/mac/audio_low_latency_input_mac_unittest.cc @@ -20,8 +20,6 @@ using ::testing::AtLeast; using ::testing::Ge; using ::testing::NotNull; -namespace media { - ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { if (++*count >= limit) { loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); @@ -309,4 +307,3 @@ TEST_F(MacAudioInputTest, DISABLED_AUAudioInputStreamRecordToFile) { ais->Close(); } -} // namespace media diff --git a/media/audio/mac/audio_low_latency_output_mac.cc b/media/audio/mac/audio_low_latency_output_mac.cc index b1f15dd..39ebf1a 100644 --- a/media/audio/mac/audio_low_latency_output_mac.cc +++ b/media/audio/mac/audio_low_latency_output_mac.cc @@ -12,8 +12,6 @@ #include "media/audio/audio_util.h" #include "media/audio/mac/audio_manager_mac.h" -namespace media { - // Reorder PCM from AAC layout to Core Audio 5.1 layout. // TODO(fbarchard): Switch layout when ffmpeg is updated. template<class Format> @@ -352,5 +350,3 @@ double AUAudioOutputStream::GetPlayoutLatency( return (delay_frames + hardware_latency_frames_); } - -} // namespace media diff --git a/media/audio/mac/audio_low_latency_output_mac.h b/media/audio/mac/audio_low_latency_output_mac.h index 45d9773..bb9ce8d 100644 --- a/media/audio/mac/audio_low_latency_output_mac.h +++ b/media/audio/mac/audio_low_latency_output_mac.h @@ -23,8 +23,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerMac; // Implementation of AudioOuputStream for Mac OS X using the @@ -101,6 +99,4 @@ class AUAudioOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(AUAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_OUTPUT_MAC_H_ diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc index 2bd8501..3b1161d 100644 --- a/media/audio/mac/audio_manager_mac.cc +++ b/media/audio/mac/audio_manager_mac.cc @@ -15,8 +15,6 @@ #include "media/audio/mac/audio_output_mac.h" #include "media/base/limits.h" -namespace media { - // Maximum number of output streams that can be open simultaneously. static const int kMaxOutputStreams = 50; @@ -295,5 +293,3 @@ AudioInputStream* AudioManagerMac::MakeLowLatencyInputStream( AudioManager* CreateAudioManager() { return new AudioManagerMac(); } - -} // namespace media diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h index 54ff3a6..d54f293 100644 --- a/media/audio/mac/audio_manager_mac.h +++ b/media/audio/mac/audio_manager_mac.h @@ -9,8 +9,6 @@ #include "base/compiler_specific.h" #include "media/audio/audio_manager_base.h" -namespace media { - // Mac OS X implementation of the AudioManager singleton. This class is internal // to the audio output and only internal users can call methods not exposed by // the AudioManager class. @@ -43,6 +41,4 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); }; -} // namespace media - #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ diff --git a/media/audio/mac/audio_output_mac.cc b/media/audio/mac/audio_output_mac.cc index 06fc26f..d2cdc57 100644 --- a/media/audio/mac/audio_output_mac.cc +++ b/media/audio/mac/audio_output_mac.cc @@ -13,8 +13,6 @@ #include "media/audio/audio_util.h" #include "media/audio/mac/audio_manager_mac.h" -namespace media { - // A custom data structure to store information an AudioQueue buffer. struct AudioQueueUserData { AudioQueueUserData() : empty_buffer(false) {} @@ -529,5 +527,3 @@ PCMQueueOutAudioOutputStream::GetSource() { base::AutoLock lock(source_lock_); return source_; } - -} // namespace media diff --git a/media/audio/mac/audio_output_mac.h b/media/audio/mac/audio_output_mac.h index 66f2941..e033fc9 100644 --- a/media/audio/mac/audio_output_mac.h +++ b/media/audio/mac/audio_output_mac.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,8 +14,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerMac; // Implementation of AudioOuputStream for Mac OS X using the audio queue service @@ -99,6 +97,4 @@ class PCMQueueOutAudioOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(PCMQueueOutAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_MAC_AUDIO_OUTPUT_MAC_H_ diff --git a/media/audio/mac/audio_output_mac_unittest.cc b/media/audio/mac/audio_output_mac_unittest.cc index 0724883..71a7f40 100644 --- a/media/audio/mac/audio_output_mac_unittest.cc +++ b/media/audio/mac/audio_output_mac_unittest.cc @@ -20,8 +20,6 @@ using ::testing::NiceMock; using ::testing::NotNull; using ::testing::Return; -namespace media { - class MockAudioSource : public AudioOutputStream::AudioSourceCallback { public: MOCK_METHOD4(OnMoreData, uint32(AudioOutputStream* stream, uint8* dest, @@ -177,5 +175,3 @@ TEST(MacAudioTest, PCMWaveStreamPendingBytes) { oas->Stop(); oas->Close(); } - -} // namespace media diff --git a/media/audio/openbsd/audio_manager_openbsd.cc b/media/audio/openbsd/audio_manager_openbsd.cc index 0f4314c..acdcea4 100644 --- a/media/audio/openbsd/audio_manager_openbsd.cc +++ b/media/audio/openbsd/audio_manager_openbsd.cc @@ -15,8 +15,6 @@ #include <fcntl.h> -namespace media { - // Maximum number of output streams that can be open simultaneously. static const int kMaxOutputStreams = 50; @@ -105,5 +103,3 @@ AudioOutputStream* AudioManagerOpenBSD::MakeOutputStream( AudioManager* CreateAudioManager() { return new AudioManagerOpenBSD(); } - -} // namespace media diff --git a/media/audio/openbsd/audio_manager_openbsd.h b/media/audio/openbsd/audio_manager_openbsd.h index 1635571..86b56c0 100644 --- a/media/audio/openbsd/audio_manager_openbsd.h +++ b/media/audio/openbsd/audio_manager_openbsd.h @@ -10,8 +10,6 @@ #include "base/compiler_specific.h" #include "media/audio/audio_manager_base.h" -namespace media { - class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase { public: AudioManagerOpenBSD(); @@ -45,6 +43,4 @@ class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase { DISALLOW_COPY_AND_ASSIGN(AudioManagerOpenBSD); }; -} // namespace media - #endif // MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ diff --git a/media/audio/pulse/pulse_output.cc b/media/audio/pulse/pulse_output.cc index 651d1f7..c58d5bf 100644 --- a/media/audio/pulse/pulse_output.cc +++ b/media/audio/pulse/pulse_output.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,8 +16,6 @@ #include "media/base/data_buffer.h" #include "media/base/seekable_buffer.h" -namespace media { - static pa_sample_format_t BitsToPASampleFormat(int bits_per_sample) { switch (bits_per_sample) { // Unsupported sample formats shown for reference. I am assuming we want @@ -428,5 +426,3 @@ uint32 PulseAudioOutputStream::RunDataCallback( return 0; } - -} // namespace media diff --git a/media/audio/pulse/pulse_output.h b/media/audio/pulse/pulse_output.h index 3c1cae6..410ffb3 100644 --- a/media/audio/pulse/pulse_output.h +++ b/media/audio/pulse/pulse_output.h @@ -27,8 +27,8 @@ #include "media/base/channel_layout.h" namespace media { - class SeekableBuffer; +} #if defined(OS_LINUX) class AudioManagerLinux; @@ -130,6 +130,4 @@ class PulseAudioOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(PulseAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ diff --git a/media/audio/simple_sources.cc b/media/audio/simple_sources.cc index 8b85961..d2dc584 100644 --- a/media/audio/simple_sources.cc +++ b/media/audio/simple_sources.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,8 +13,6 @@ #include "media/audio/audio_io.h" #include "media/base/data_buffer.h" -namespace media { - ////////////////////////////////////////////////////////////////////////////// // SineWaveAudioSource implementation. @@ -98,5 +96,3 @@ void PushSource::ClearAll() { void PushSource::CleanUp() { buffer_.Clear(); } - -} // namespace media diff --git a/media/audio/simple_sources.h b/media/audio/simple_sources.h index fa06857..a4373a0 100644 --- a/media/audio/simple_sources.h +++ b/media/audio/simple_sources.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,8 +10,6 @@ #include "media/audio/audio_io.h" #include "media/base/seekable_buffer.h" -namespace media { - // An audio source that produces a pure sinusoidal tone. class MEDIA_EXPORT SineWaveAudioSource : public AudioOutputStream::AudioSourceCallback { @@ -90,6 +88,4 @@ class MEDIA_EXPORT PushSource media::SeekableBuffer buffer_; }; -} // namespace media - #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ diff --git a/media/audio/simple_sources_unittest.cc b/media/audio/simple_sources_unittest.cc index 1e19fd8..384ed0b 100644 --- a/media/audio/simple_sources_unittest.cc +++ b/media/audio/simple_sources_unittest.cc @@ -11,8 +11,6 @@ #include "media/audio/simple_sources.h" #include "testing/gtest/include/gtest/gtest.h" -namespace media { - static void GenerateRandomData(char* buffer, uint32 len) { static bool called = false; if (!called) { @@ -101,5 +99,3 @@ TEST(SimpleSources, SineWaveAudio16MonoTest) { EXPECT_TRUE(last_buffer[half_period + 2] > last_buffer[half_period + 3]); oas->Close(); } - -} // namespace media diff --git a/media/audio/win/audio_low_latency_input_win.cc b/media/audio/win/audio_low_latency_input_win.cc index 20fbe71..214b8bf9 100644 --- a/media/audio/win/audio_low_latency_input_win.cc +++ b/media/audio/win/audio_low_latency_input_win.cc @@ -14,8 +14,6 @@ using base::win::ScopedComPtr; using base::win::ScopedCOMInitializer; -namespace media { - WASAPIAudioInputStream::WASAPIAudioInputStream( AudioManagerWin* manager, const AudioParameters& params, const std::string& device_id) @@ -643,5 +641,3 @@ HRESULT WASAPIAudioInputStream::InitializeAudioEngine() { simple_audio_volume_.ReceiveVoid()); return hr; } - -} // namespace media diff --git a/media/audio/win/audio_low_latency_input_win.h b/media/audio/win/audio_low_latency_input_win.h index bb0f58c..d546829 100644 --- a/media/audio/win/audio_low_latency_input_win.h +++ b/media/audio/win/audio_low_latency_input_win.h @@ -77,8 +77,6 @@ #include "media/audio/audio_parameters.h" #include "media/base/media_export.h" -namespace media { - class AudioManagerWin; // AudioInputStream implementation using Windows Core Audio APIs. @@ -212,6 +210,4 @@ class MEDIA_EXPORT WASAPIAudioInputStream DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ diff --git a/media/audio/win/audio_low_latency_input_win_unittest.cc b/media/audio/win/audio_low_latency_input_win_unittest.cc index 029403f..da5acb6 100644 --- a/media/audio/win/audio_low_latency_input_win_unittest.cc +++ b/media/audio/win/audio_low_latency_input_win_unittest.cc @@ -27,8 +27,6 @@ using ::testing::AtLeast; using ::testing::Gt; using ::testing::NotNull; -namespace media { - ACTION_P3(CheckCountAndPostQuitTask, count, limit, loop) { if (++*count >= limit) { loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); @@ -394,5 +392,3 @@ TEST(WinAudioInputTest, DISABLED_WASAPIAudioInputStreamRecordToFile) { LOG(INFO) << ">> Recording has stopped."; ais->Close(); } - -} // namespace media diff --git a/media/audio/win/audio_low_latency_output_win.cc b/media/audio/win/audio_low_latency_output_win.cc index ec0fcd2..120a397 100644 --- a/media/audio/win/audio_low_latency_output_win.cc +++ b/media/audio/win/audio_low_latency_output_win.cc @@ -16,8 +16,6 @@ using base::win::ScopedComPtr; using base::win::ScopedCOMInitializer; -namespace media { - WASAPIAudioOutputStream::WASAPIAudioOutputStream(AudioManagerWin* manager, const AudioParameters& params, ERole device_role) @@ -810,5 +808,3 @@ bool WASAPIAudioOutputStream::RestartRenderingUsingNewDefaultDevice() { restart_rendering_mode_ = false; return SUCCEEDED(hr); } - -} // namespace media diff --git a/media/audio/win/audio_low_latency_output_win.h b/media/audio/win/audio_low_latency_output_win.h index 67a5d6c..63a1c52 100644 --- a/media/audio/win/audio_low_latency_output_win.h +++ b/media/audio/win/audio_low_latency_output_win.h @@ -132,8 +132,6 @@ #include "media/audio/audio_parameters.h" #include "media/base/media_export.h" -namespace media { - class AudioManagerWin; // AudioOutputStream implementation using Windows Core Audio APIs. @@ -309,6 +307,4 @@ class MEDIA_EXPORT WASAPIAudioOutputStream DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc index 93dcf2f..1d19fe1 100644 --- a/media/audio/win/audio_manager_win.cc +++ b/media/audio/win/audio_manager_win.cc @@ -38,8 +38,6 @@ DEFINE_GUID(AM_KSCATEGORY_AUDIO, 0x6994ad04, 0x93ef, 0x11d0, 0xa3, 0xcc, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96); -namespace media { - // Maximum number of output streams that can be open simultaneously. static const int kMaxOutputStreams = 50; @@ -319,5 +317,3 @@ AudioInputStream* AudioManagerWin::CreatePCMWaveInAudioInputStream( AudioManager* CreateAudioManager() { return new AudioManagerWin(); } - -} // namespace media diff --git a/media/audio/win/audio_manager_win.h b/media/audio/win/audio_manager_win.h index b1e2426..19742fb 100644 --- a/media/audio/win/audio_manager_win.h +++ b/media/audio/win/audio_manager_win.h @@ -13,8 +13,6 @@ #include "base/gtest_prod_util.h" #include "media/audio/audio_manager_base.h" -namespace media { - // Windows implementation of the AudioManager singleton. This class is internal // to the audio output and only internal users can call methods not exposed by // the AudioManager class. @@ -73,6 +71,4 @@ class MEDIA_EXPORT AudioManagerWin : public AudioManagerBase { DISALLOW_COPY_AND_ASSIGN(AudioManagerWin); }; -} // namespace media - #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ diff --git a/media/audio/win/audio_output_win_unittest.cc b/media/audio/win/audio_output_win_unittest.cc index 11b5693..a6e240d 100644 --- a/media/audio/win/audio_output_win_unittest.cc +++ b/media/audio/win/audio_output_win_unittest.cc @@ -31,8 +31,6 @@ using ::testing::Return; using base::win::ScopedCOMInitializer; -namespace media { - static const wchar_t kAudioFile1_16b_m_16K[] = L"media\\test\\data\\sweep02_16b_mono_16KHz.raw"; @@ -746,5 +744,3 @@ TEST(WinAudioTest, SyncSocketBasic) { oas->Stop(); oas->Close(); } - -} // namespace media diff --git a/media/audio/win/wavein_input_win.cc b/media/audio/win/wavein_input_win.cc index 7eb778d..f4055db 100644 --- a/media/audio/win/wavein_input_win.cc +++ b/media/audio/win/wavein_input_win.cc @@ -16,7 +16,7 @@ namespace { const int kStopInputStreamCallbackTimeout = 3000; // Three seconds. } -namespace media { +using media::AudioDeviceNames; // Our sound buffers are allocated once and kept in a linked list using the // the WAVEHDR::dwUser variable. The last buffer points to the first buffer. @@ -297,5 +297,3 @@ void PCMWaveInAudioInputStream::WaveCallback(HWAVEIN hwi, UINT msg, obj->callback_->OnClose(obj); } } - -} // namespace media diff --git a/media/audio/win/wavein_input_win.h b/media/audio/win/wavein_input_win.h index 82f1f55..b4418d8 100644 --- a/media/audio/win/wavein_input_win.h +++ b/media/audio/win/wavein_input_win.h @@ -16,8 +16,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerWin; class PCMWaveInAudioInputStream : public AudioInputStream { @@ -119,6 +117,4 @@ class PCMWaveInAudioInputStream : public AudioInputStream { DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc index 3cae68c..c8c7523 100644 --- a/media/audio/win/waveout_output_win.cc +++ b/media/audio/win/waveout_output_win.cc @@ -15,8 +15,6 @@ #include "media/audio/audio_util.h" #include "media/audio/win/audio_manager_win.h" -namespace media { - // Some general thoughts about the waveOut API which is badly documented : // - We use CALLBACK_EVENT mode in which XP signals events such as buffer // releases. @@ -413,5 +411,3 @@ void NTAPI PCMWaveOutAudioOutputStream::BufferCallback(PVOID lpParameter, } } } - -} // namespace media diff --git a/media/audio/win/waveout_output_win.h b/media/audio/win/waveout_output_win.h index bc53bb4..e7cb4ed 100644 --- a/media/audio/win/waveout_output_win.h +++ b/media/audio/win/waveout_output_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,8 +17,6 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" -namespace media { - class AudioManagerWin; // Implements PCM audio output support for Windows using the WaveXXX API. @@ -134,6 +132,4 @@ class PCMWaveOutAudioOutputStream : public AudioOutputStream { DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); }; -} // namespace media - #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ diff --git a/media/tools/player_wtl/movie.cc b/media/tools/player_wtl/movie.cc index 781f377..4e3c9ab 100644 --- a/media/tools/player_wtl/movie.cc +++ b/media/tools/player_wtl/movie.cc @@ -20,6 +20,13 @@ #include "media/filters/null_audio_renderer.h" #include "media/filters/video_renderer_base.h" +using media::FFmpegAudioDecoder; +using media::FFmpegDemuxer; +using media::FFmpegVideoDecoder; +using media::FileDataSource; +using media::FilterCollection; +using media::Pipeline; + namespace media { Movie::Movie() diff --git a/media/tools/player_wtl/movie.h b/media/tools/player_wtl/movie.h index 0e04278..54ddd49 100644 --- a/media/tools/player_wtl/movie.h +++ b/media/tools/player_wtl/movie.h @@ -13,11 +13,11 @@ #include "base/memory/scoped_ptr.h" #include "media/base/message_loop_factory.h" +class AudioManager; template <typename T> struct DefaultSingletonTraits; namespace media { -class AudioManager; class Pipeline; class VideoRendererBase; diff --git a/media/tools/player_x11/player_x11.cc b/media/tools/player_x11/player_x11.cc index ce2ff07..467d92f 100644 --- a/media/tools/player_x11/player_x11.cc +++ b/media/tools/player_x11/player_x11.cc @@ -37,7 +37,7 @@ static Display* g_display = NULL; static Window g_window = 0; static bool g_running = false; -media::AudioManager* g_audio_manager = NULL; +AudioManager* g_audio_manager = NULL; media::VideoRendererBase* g_video_renderer = NULL; @@ -238,7 +238,7 @@ int main(int argc, char** argv) { return 1; } - scoped_ptr<media::AudioManager> audio_manager(media::AudioManager::Create()); + scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); g_audio_manager = audio_manager.get(); logging::InitLogging( |