diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-02 19:30:45 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-02 19:30:45 +0000 |
commit | 897bfb5aaaa57f0338a77fada1d5d3f9c3b38226 (patch) | |
tree | fddba9cf19f4258a0b36a3fae5e27f2422cd277e /content/renderer/media | |
parent | 103f19fbcf7d78efd8edc28bfabb3d4915a246de (diff) | |
download | chromium_src-897bfb5aaaa57f0338a77fada1d5d3f9c3b38226.zip chromium_src-897bfb5aaaa57f0338a77fada1d5d3f9c3b38226.tar.gz chromium_src-897bfb5aaaa57f0338a77fada1d5d3f9c3b38226.tar.bz2 |
Move media/audio files into media namespace
BUG=115187
TEST=compiles and runs without breaking audio tag; media_unittests, content_unittests
Review URL: https://chromiumcodereview.appspot.com/9805001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130180 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/media')
-rw-r--r-- | content/renderer/media/audio_device.cc | 10 | ||||
-rw-r--r-- | content/renderer/media/audio_device.h | 12 | ||||
-rw-r--r-- | content/renderer/media/audio_device_thread.cc | 6 | ||||
-rw-r--r-- | content/renderer/media/audio_device_thread.h | 4 | ||||
-rw-r--r-- | content/renderer/media/audio_input_device.cc | 15 | ||||
-rw-r--r-- | content/renderer/media/audio_input_device.h | 5 | ||||
-rw-r--r-- | content/renderer/media/audio_renderer_impl.cc | 2 | ||||
-rw-r--r-- | content/renderer/media/audio_renderer_impl.h | 2 | ||||
-rw-r--r-- | content/renderer/media/render_audiosourceprovider.cc | 2 | ||||
-rw-r--r-- | content/renderer/media/render_audiosourceprovider.h | 2 | ||||
-rw-r--r-- | content/renderer/media/renderer_webaudiodevice_impl.cc | 3 | ||||
-rw-r--r-- | content/renderer/media/renderer_webaudiodevice_impl.h | 9 | ||||
-rw-r--r-- | content/renderer/media/webrtc_audio_device_impl.cc | 2 | ||||
-rw-r--r-- | content/renderer/media/webrtc_audio_device_impl.h | 4 |
14 files changed, 45 insertions, 33 deletions
diff --git a/content/renderer/media/audio_device.cc b/content/renderer/media/audio_device.cc index b1e5cdf..60e36a7 100644 --- a/content/renderer/media/audio_device.cc +++ b/content/renderer/media/audio_device.cc @@ -23,7 +23,7 @@ using media::AudioRendererSink; class AudioDevice::AudioThreadCallback : public AudioDeviceThread::Callback { public: - AudioThreadCallback(const AudioParameters& audio_parameters, + AudioThreadCallback(const media::AudioParameters& audio_parameters, base::SharedMemoryHandle memory, int memory_length, AudioRendererSink::RenderCallback* render_callback); @@ -49,7 +49,7 @@ AudioDevice::AudioDevice() filter_ = RenderThreadImpl::current()->audio_message_filter(); } -AudioDevice::AudioDevice(const AudioParameters& params, +AudioDevice::AudioDevice(const media::AudioParameters& params, RenderCallback* callback) : ScopedLoopObserver(ChildProcess::current()->io_message_loop()), audio_parameters_(params), @@ -61,7 +61,7 @@ AudioDevice::AudioDevice(const AudioParameters& params, filter_ = RenderThreadImpl::current()->audio_message_filter(); } -void AudioDevice::Initialize(const AudioParameters& params, +void AudioDevice::Initialize(const media::AudioParameters& params, RenderCallback* callback) { CHECK_EQ(0, stream_id_) << "AudioDevice::Initialize() must be called before Start()"; @@ -130,7 +130,7 @@ void AudioDevice::GetVolume(double* volume) { *volume = volume_; } -void AudioDevice::InitializeOnIOThread(const AudioParameters& params) { +void AudioDevice::InitializeOnIOThread(const media::AudioParameters& params) { DCHECK(message_loop()->BelongsToCurrentThread()); // Make sure we don't create the stream more than once. DCHECK_EQ(0, stream_id_); @@ -262,7 +262,7 @@ void AudioDevice::WillDestroyCurrentMessageLoop() { // AudioDevice::AudioThreadCallback AudioDevice::AudioThreadCallback::AudioThreadCallback( - const AudioParameters& audio_parameters, + const media::AudioParameters& audio_parameters, base::SharedMemoryHandle memory, int memory_length, media::AudioRendererSink::RenderCallback* render_callback) diff --git a/content/renderer/media/audio_device.h b/content/renderer/media/audio_device.h index 4cdb946..9410ce7 100644 --- a/content/renderer/media/audio_device.h +++ b/content/renderer/media/audio_device.h @@ -76,6 +76,10 @@ #include "media/audio/audio_parameters.h" #include "media/base/audio_renderer_sink.h" +namespace media { +class AudioParameters; +} + class CONTENT_EXPORT AudioDevice : NON_EXPORTED_BASE(public media::AudioRendererSink), public AudioMessageFilter::Delegate, @@ -86,11 +90,11 @@ class CONTENT_EXPORT AudioDevice // Minimal constructor where Initialize() must be called later. AudioDevice(); - AudioDevice(const AudioParameters& params, RenderCallback* callback); + AudioDevice(const media::AudioParameters& params, RenderCallback* callback); // AudioRendererSink implementation. - virtual void Initialize(const AudioParameters& params, + virtual void Initialize(const media::AudioParameters& params, RenderCallback* callback) OVERRIDE; // Starts audio playback. virtual void Start() OVERRIDE; @@ -132,7 +136,7 @@ class CONTENT_EXPORT AudioDevice // The following methods are tasks posted on the IO thread that needs to // be executed on that thread. They interact with AudioMessageFilter and // sends IPC messages on that thread. - void InitializeOnIOThread(const AudioParameters& params); + void InitializeOnIOThread(const media::AudioParameters& params); void PlayOnIOThread(); void PauseOnIOThread(bool flush); void ShutDownOnIOThread(); @@ -144,7 +148,7 @@ class CONTENT_EXPORT AudioDevice // If the IO loop dies before we do, we shut down the audio thread from here. virtual void WillDestroyCurrentMessageLoop() OVERRIDE; - AudioParameters audio_parameters_; + media::AudioParameters audio_parameters_; RenderCallback* callback_; diff --git a/content/renderer/media/audio_device_thread.cc b/content/renderer/media/audio_device_thread.cc index 77f37dcf..c3cb6ce 100644 --- a/content/renderer/media/audio_device_thread.cc +++ b/content/renderer/media/audio_device_thread.cc @@ -170,9 +170,9 @@ void AudioDeviceThread::Thread::Run() { // AudioDeviceThread::Callback implementation -AudioDeviceThread::Callback::Callback(const AudioParameters& audio_parameters, - base::SharedMemoryHandle memory, - int memory_length) +AudioDeviceThread::Callback::Callback( + const media::AudioParameters& audio_parameters, + base::SharedMemoryHandle memory, int memory_length) : audio_parameters_(audio_parameters), samples_per_ms_(audio_parameters.sample_rate() / 1000), bytes_per_ms_(audio_parameters.channels() * diff --git a/content/renderer/media/audio_device_thread.h b/content/renderer/media/audio_device_thread.h index 51c6fda..0b9f82e 100644 --- a/content/renderer/media/audio_device_thread.h +++ b/content/renderer/media/audio_device_thread.h @@ -35,7 +35,7 @@ class CONTENT_EXPORT AudioDeviceThread { // AudioDevice thread. class Callback { public: - Callback(const AudioParameters& audio_parameters, + Callback(const media::AudioParameters& audio_parameters, base::SharedMemoryHandle memory, int memory_length); virtual ~Callback(); @@ -54,7 +54,7 @@ class CONTENT_EXPORT AudioDeviceThread { // Protected so that derived classes can access directly. // The variables are 'const' since values are calculated/set in the // constructor and must never change. - const AudioParameters audio_parameters_; + const media::AudioParameters audio_parameters_; const int samples_per_ms_; const int bytes_per_ms_; diff --git a/content/renderer/media/audio_input_device.cc b/content/renderer/media/audio_input_device.cc index 11a3938..09c0ba7 100644 --- a/content/renderer/media/audio_input_device.cc +++ b/content/renderer/media/audio_input_device.cc @@ -21,7 +21,7 @@ class AudioInputDevice::AudioThreadCallback : public AudioDeviceThread::Callback { public: - AudioThreadCallback(const AudioParameters& audio_parameters, + AudioThreadCallback(const media::AudioParameters& audio_parameters, base::SharedMemoryHandle memory, int memory_length, CaptureCallback* capture_callback); @@ -37,7 +37,7 @@ class AudioInputDevice::AudioThreadCallback DISALLOW_COPY_AND_ASSIGN(AudioThreadCallback); }; -AudioInputDevice::AudioInputDevice(const AudioParameters& params, +AudioInputDevice::AudioInputDevice(const media::AudioParameters& params, CaptureCallback* callback, CaptureEventHandler* event_handler) : ScopedLoopObserver(ChildProcess::current()->io_message_loop()), @@ -117,7 +117,8 @@ void AudioInputDevice::InitializeOnIOThread() { // and create the stream when getting a OnDeviceReady() callback. if (!session_id_) { Send(new AudioInputHostMsg_CreateStream( - stream_id_, audio_parameters_, AudioManagerBase::kDefaultDeviceId, + stream_id_, audio_parameters_, + media::AudioManagerBase::kDefaultDeviceId, agc_is_enabled_)); } else { Send(new AudioInputHostMsg_StartDevice(stream_id_, session_id_)); @@ -297,7 +298,7 @@ void AudioInputDevice::WillDestroyCurrentMessageLoop() { // AudioInputDevice::AudioThreadCallback AudioInputDevice::AudioThreadCallback::AudioThreadCallback( - const AudioParameters& audio_parameters, + const media::AudioParameters& audio_parameters, base::SharedMemoryHandle memory, int memory_length, CaptureCallback* capture_callback) @@ -316,10 +317,10 @@ void AudioInputDevice::AudioThreadCallback::Process(int pending_data) { // The shared memory represents parameters, size of the data buffer and the // actual data buffer containing audio data. Map the memory into this // structure and parse out parameters and the data area. - AudioInputBuffer* buffer = - reinterpret_cast<AudioInputBuffer*>(shared_memory_.memory()); + media::AudioInputBuffer* buffer = + reinterpret_cast<media::AudioInputBuffer*>(shared_memory_.memory()); uint32 size = buffer->params.size; - DCHECK_EQ(size, memory_length_ - sizeof(AudioInputBufferParameters)); + DCHECK_EQ(size, memory_length_ - sizeof(media::AudioInputBufferParameters)); double volume = buffer->params.volume; int audio_delay_milliseconds = pending_data / bytes_per_ms_; diff --git a/content/renderer/media/audio_input_device.h b/content/renderer/media/audio_input_device.h index 99cd03c..ac68b96 100644 --- a/content/renderer/media/audio_input_device.h +++ b/content/renderer/media/audio_input_device.h @@ -118,7 +118,8 @@ class CONTENT_EXPORT AudioInputDevice }; // Methods called on main render thread ------------------------------------- - AudioInputDevice(const AudioParameters& params, CaptureCallback* callback, + AudioInputDevice(const media::AudioParameters& params, + CaptureCallback* callback, CaptureEventHandler* event_handler); virtual ~AudioInputDevice(); @@ -184,7 +185,7 @@ class CONTENT_EXPORT AudioInputDevice virtual void WillDestroyCurrentMessageLoop() OVERRIDE; // Format - AudioParameters audio_parameters_; + media::AudioParameters audio_parameters_; CaptureCallback* callback_; CaptureEventHandler* event_handler_; diff --git a/content/renderer/media/audio_renderer_impl.cc b/content/renderer/media/audio_renderer_impl.cc index 112be63..81d1cc6 100644 --- a/content/renderer/media/audio_renderer_impl.cc +++ b/content/renderer/media/audio_renderer_impl.cc @@ -61,7 +61,7 @@ bool AudioRendererImpl::OnInitialize(int bits_per_channel, // Please see: http://code.google.com/p/chromium/issues/detail?id=103627 // for more details. audio_parameters_.Reset( - AudioParameters::AUDIO_PCM_LINEAR, + media::AudioParameters::AUDIO_PCM_LINEAR, channel_layout, sample_rate, bits_per_channel, audio_hardware::GetHighLatencyOutputBufferSize(sample_rate)); diff --git a/content/renderer/media/audio_renderer_impl.h b/content/renderer/media/audio_renderer_impl.h index c2f8864..978f5a0 100644 --- a/content/renderer/media/audio_renderer_impl.h +++ b/content/renderer/media/audio_renderer_impl.h @@ -129,7 +129,7 @@ class CONTENT_EXPORT AudioRendererImpl // than nothing. base::Time earliest_end_time_; - AudioParameters audio_parameters_; + media::AudioParameters audio_parameters_; DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); }; diff --git a/content/renderer/media/render_audiosourceprovider.cc b/content/renderer/media/render_audiosourceprovider.cc index 5159d4d..a627bfa 100644 --- a/content/renderer/media/render_audiosourceprovider.cc +++ b/content/renderer/media/render_audiosourceprovider.cc @@ -73,7 +73,7 @@ void RenderAudioSourceProvider::GetVolume(double* volume) { } void RenderAudioSourceProvider::Initialize( - const AudioParameters& params, RenderCallback* renderer) { + const media::AudioParameters& params, RenderCallback* renderer) { base::AutoLock auto_lock(sink_lock_); CHECK(!is_initialized_); renderer_ = renderer; diff --git a/content/renderer/media/render_audiosourceprovider.h b/content/renderer/media/render_audiosourceprovider.h index c0a3a88..6d842cb 100644 --- a/content/renderer/media/render_audiosourceprovider.h +++ b/content/renderer/media/render_audiosourceprovider.h @@ -60,7 +60,7 @@ class RenderAudioSourceProvider virtual bool SetVolume(double volume) OVERRIDE; virtual void GetVolume(double* volume) OVERRIDE; virtual void Initialize( - const AudioParameters& params, RenderCallback* renderer) OVERRIDE; + const media::AudioParameters& params, RenderCallback* renderer) OVERRIDE; private: // Set to true when Initialize() is called. diff --git a/content/renderer/media/renderer_webaudiodevice_impl.cc b/content/renderer/media/renderer_webaudiodevice_impl.cc index d054325..2a90144 100644 --- a/content/renderer/media/renderer_webaudiodevice_impl.cc +++ b/content/renderer/media/renderer_webaudiodevice_impl.cc @@ -8,7 +8,8 @@ using WebKit::WebAudioDevice; using WebKit::WebVector; RendererWebAudioDeviceImpl::RendererWebAudioDeviceImpl( - const AudioParameters& params, WebAudioDevice::RenderCallback* callback) + const media::AudioParameters& params, + WebAudioDevice::RenderCallback* callback) : is_running_(false), client_callback_(callback) { audio_device_ = new AudioDevice(params, this); diff --git a/content/renderer/media/renderer_webaudiodevice_impl.h b/content/renderer/media/renderer_webaudiodevice_impl.h index 7b66033..a70c0884 100644 --- a/content/renderer/media/renderer_webaudiodevice_impl.h +++ b/content/renderer/media/renderer_webaudiodevice_impl.h @@ -12,12 +12,15 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebAudioDevice.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" +namespace media { class AudioParameters; +} -class RendererWebAudioDeviceImpl : public WebKit::WebAudioDevice, - public AudioDevice::RenderCallback { +class RendererWebAudioDeviceImpl + : public WebKit::WebAudioDevice, + public AudioDevice::RenderCallback { public: - RendererWebAudioDeviceImpl(const AudioParameters& params, + RendererWebAudioDeviceImpl(const media::AudioParameters& params, WebKit::WebAudioDevice::RenderCallback* callback); virtual ~RendererWebAudioDeviceImpl(); diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc index a25bdca..1eeea33 100644 --- a/content/renderer/media/webrtc_audio_device_impl.cc +++ b/content/renderer/media/webrtc_audio_device_impl.cc @@ -11,6 +11,8 @@ #include "content/renderer/render_thread_impl.h" #include "media/audio/audio_util.h" +using media::AudioParameters; + static const int64 kMillisecondsBetweenProcessCalls = 5000; static const double kMaxVolumeLevel = 255.0; diff --git a/content/renderer/media/webrtc_audio_device_impl.h b/content/renderer/media/webrtc_audio_device_impl.h index c00e129..8900ebf 100644 --- a/content/renderer/media/webrtc_audio_device_impl.h +++ b/content/renderer/media/webrtc_audio_device_impl.h @@ -416,8 +416,8 @@ class CONTENT_EXPORT WebRtcAudioDeviceImpl webrtc::AudioTransport* audio_transport_callback_; // Cached values of utilized audio parameters. Platform dependent. - AudioParameters input_audio_parameters_; - AudioParameters output_audio_parameters_; + media::AudioParameters input_audio_parameters_; + media::AudioParameters output_audio_parameters_; // Cached value of the current audio delay on the input/capture side. int input_delay_ms_; |