diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 20:55:23 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-21 20:55:23 +0000 |
commit | cfb09c2d58ecb16b14192619695ea54570344ca7 (patch) | |
tree | 4d55c178533d474429eef44382fdc93c9fa0e28f /content/test | |
parent | ef12d1e6acb871dbd01f330d0b10ada24d209371 (diff) | |
download | chromium_src-cfb09c2d58ecb16b14192619695ea54570344ca7.zip chromium_src-cfb09c2d58ecb16b14192619695ea54570344ca7.tar.gz chromium_src-cfb09c2d58ecb16b14192619695ea54570344ca7.tar.bz2 |
Make AudioParameters a class instead of a struct
Also collapses some long parameter lists into AudioParameters and moves some
of the hardcoded values (e.g. 16 bit audio in AudioDevice) to more appropriate
locations.
BUG=115902
TEST=manually testing everything works out
Review URL: https://chromiumcodereview.appspot.com/9655018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r-- | content/test/DEPS | 1 | ||||
-rw-r--r-- | content/test/webrtc_audio_device_test.cc | 21 | ||||
-rw-r--r-- | content/test/webrtc_audio_device_test.h | 13 |
3 files changed, 19 insertions, 16 deletions
diff --git a/content/test/DEPS b/content/test/DEPS index 87c46bc..8e567cd 100644 --- a/content/test/DEPS +++ b/content/test/DEPS @@ -1,5 +1,6 @@ include_rules = [ # Testing utilities can access anything in content/ "+content", + "+media/base", # For ChannelLayout in WebRTC tests. "+ui/base/resource/data_pack.h" ] diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index b132617..d13f79ca 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -212,24 +212,25 @@ void WebRTCAudioDeviceTest::DestroyChannel() { audio_input_renderer_host_ = NULL; } -void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(double* sample_rate) { +void WebRTCAudioDeviceTest::OnGetHardwareSampleRate(int* sample_rate) { EXPECT_TRUE(audio_util_callback_); *sample_rate = audio_util_callback_ ? - audio_util_callback_->GetAudioHardwareSampleRate() : 0.0; + audio_util_callback_->GetAudioHardwareSampleRate() : 0; } -void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(double* sample_rate) { +void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(int* sample_rate) { EXPECT_TRUE(audio_util_callback_); *sample_rate = audio_util_callback_ ? audio_util_callback_->GetAudioInputHardwareSampleRate( - AudioManagerBase::kDefaultDeviceId) : 0.0; + AudioManagerBase::kDefaultDeviceId) : 0; } -void WebRTCAudioDeviceTest::OnGetHardwareInputChannelCount(uint32* channels) { +void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout( + ChannelLayout* layout) { EXPECT_TRUE(audio_util_callback_); - *channels = audio_util_callback_ ? - audio_util_callback_->GetAudioInputHardwareChannelCount( - AudioManagerBase::kDefaultDeviceId) : 0; + *layout = audio_util_callback_ ? + audio_util_callback_->GetAudioInputHardwareChannelLayout( + AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE; } // IPC::Channel::Listener implementation. @@ -264,8 +265,8 @@ bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { OnGetHardwareSampleRate) IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, OnGetHardwareInputSampleRate) - IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelCount, - OnGetHardwareInputChannelCount) + IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelLayout, + OnGetHardwareInputChannelLayout) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() diff --git a/content/test/webrtc_audio_device_test.h b/content/test/webrtc_audio_device_test.h index 8b93e83..bd82c87 100644 --- a/content/test/webrtc_audio_device_test.h +++ b/content/test/webrtc_audio_device_test.h @@ -14,6 +14,7 @@ #include "base/message_loop.h" #include "content/browser/renderer_host/media/mock_media_observer.h" #include "content/renderer/mock_content_renderer_client.h" +#include "media/base/channel_layout.h" #include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/common_types.h" @@ -108,10 +109,10 @@ class WebRTCAutoDelete { class AudioUtilInterface { public: virtual ~AudioUtilInterface() {} - virtual double GetAudioHardwareSampleRate() = 0; - virtual double GetAudioInputHardwareSampleRate( + virtual int GetAudioHardwareSampleRate() = 0; + virtual int GetAudioInputHardwareSampleRate( const std::string& device_id) = 0; - virtual uint32 GetAudioInputHardwareChannelCount( + virtual ChannelLayout GetAudioInputHardwareChannelLayout( const std::string& device_id) = 0; }; @@ -139,9 +140,9 @@ class WebRTCAudioDeviceTest void CreateChannel(const char* name); void DestroyChannel(); - void OnGetHardwareSampleRate(double* sample_rate); - void OnGetHardwareInputSampleRate(double* sample_rate); - void OnGetHardwareInputChannelCount(uint32* channels); + void OnGetHardwareSampleRate(int* sample_rate); + void OnGetHardwareInputSampleRate(int* sample_rate); + void OnGetHardwareInputChannelLayout(ChannelLayout* channels); // IPC::Channel::Listener implementation. virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |