diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 01:05:18 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 01:05:18 +0000 |
commit | 39c1854f3bd2a959b34115a3fccdb001e9ca186e (patch) | |
tree | 4e4b62d1ccef53f29cd44f67600d92d12a920d7a /media/audio/linux | |
parent | 14cb4c944051458397099ecb7325c414d5d707c9 (diff) | |
download | chromium_src-39c1854f3bd2a959b34115a3fccdb001e9ca186e.zip chromium_src-39c1854f3bd2a959b34115a3fccdb001e9ca186e.tar.gz chromium_src-39c1854f3bd2a959b34115a3fccdb001e9ca186e.tar.bz2 |
Refactoring to share MockAudioOutputStream implementations across 3 platforms
Review URL: http://codereview.chromium.org/155471
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/linux')
-rw-r--r-- | media/audio/linux/alsa_output.cc | 4 | ||||
-rw-r--r-- | media/audio/linux/alsa_output.h | 1 | ||||
-rw-r--r-- | media/audio/linux/audio_manager_linux.cc | 21 | ||||
-rw-r--r-- | media/audio/linux/audio_manager_linux.h | 1 |
4 files changed, 10 insertions, 17 deletions
diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc index e7dab51..08075de 100644 --- a/media/audio/linux/alsa_output.cc +++ b/media/audio/linux/alsa_output.cc @@ -527,7 +527,3 @@ void AlsaPCMOutputStream::SetVolume(double left_level, double right_level) { void AlsaPCMOutputStream::GetVolume(double* left_level, double* right_level) { NOTIMPLEMENTED(); } - -size_t AlsaPCMOutputStream::GetNumBuffers() { - return 0; -} diff --git a/media/audio/linux/alsa_output.h b/media/audio/linux/alsa_output.h index 42cd3c8..850ab7f 100644 --- a/media/audio/linux/alsa_output.h +++ b/media/audio/linux/alsa_output.h @@ -65,7 +65,6 @@ class AlsaPCMOutputStream : virtual void Stop(); virtual void SetVolume(double left_level, double right_level); virtual void GetVolume(double* left_level, double* right_level); - virtual size_t GetNumBuffers(); private: // Closes the playback handle, reporting errors if any occur. Returns true diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc index 69e8b9b..a9d299f 100644 --- a/media/audio/linux/audio_manager_linux.cc +++ b/media/audio/linux/audio_manager_linux.cc @@ -6,6 +6,7 @@ #include "base/at_exit.h" #include "base/logging.h" +#include "media/audio/fake_audio_output_stream.h" #include "media/audio/linux/alsa_output.h" namespace { @@ -27,11 +28,15 @@ AudioOutputStream* AudioManagerLinux::MakeAudioStream(Format format, // surround40, surround51, etc. // // http://0pointer.de/blog/projects/guide-to-sound-apis.html - AlsaPCMOutputStream* stream = - new AlsaPCMOutputStream(AlsaPCMOutputStream::kDefaultDevice, - 100 /* 100ms minimal buffer */, - format, channels, sample_rate, bits_per_sample); - return stream; + if (format == AudioManager::AUDIO_MOCK) { + return FakeAudioOutputStream::MakeFakeStream(); + } else { + AlsaPCMOutputStream* stream = + new AlsaPCMOutputStream(AlsaPCMOutputStream::kDefaultDevice, + 100 /* 100ms minimal buffer */, + format, channels, sample_rate, bits_per_sample); + return stream; + } } AudioManagerLinux::AudioManagerLinux() { @@ -50,12 +55,6 @@ void AudioManagerLinux::UnMuteAll() { NOTIMPLEMENTED(); } -const void* AudioManagerLinux::GetLastMockBuffer() { - // TODO(ajwong): Implement. - NOTIMPLEMENTED(); - return NULL; -} - // TODO(ajwong): Collapse this with the windows version. void DestroyAudioManagerLinux(void* not_used) { delete g_audio_manager; diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h index 5b369a1..191e687 100644 --- a/media/audio/linux/audio_manager_linux.h +++ b/media/audio/linux/audio_manager_linux.h @@ -19,7 +19,6 @@ class AudioManagerLinux : public AudioManager { char bits_per_sample); virtual void MuteAll(); virtual void UnMuteAll(); - virtual const void* GetLastMockBuffer(); private: // Friend function for invoking the private destructor at exit. |