OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/test/webrtc_audio_device_test.h" | 5 #include "content/test/webrtc_audio_device_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 audio_util_callback_->GetAudioHardwareSampleRate() : 0.0; | 216 audio_util_callback_->GetAudioHardwareSampleRate() : 0.0; |
217 } | 217 } |
218 | 218 |
219 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(double* sample_rate) { | 219 void WebRTCAudioDeviceTest::OnGetHardwareInputSampleRate(double* sample_rate) { |
220 EXPECT_TRUE(audio_util_callback_); | 220 EXPECT_TRUE(audio_util_callback_); |
221 *sample_rate = audio_util_callback_ ? | 221 *sample_rate = audio_util_callback_ ? |
222 audio_util_callback_->GetAudioInputHardwareSampleRate( | 222 audio_util_callback_->GetAudioInputHardwareSampleRate( |
223 AudioManagerBase::kDefaultDeviceId) : 0.0; | 223 AudioManagerBase::kDefaultDeviceId) : 0.0; |
224 } | 224 } |
225 | 225 |
226 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelCount(uint32* channels) { | 226 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout( |
| 227 ChannelLayout* layout) { |
227 EXPECT_TRUE(audio_util_callback_); | 228 EXPECT_TRUE(audio_util_callback_); |
228 *channels = audio_util_callback_ ? | 229 *layout = audio_util_callback_ ? |
229 audio_util_callback_->GetAudioInputHardwareChannelCount( | 230 audio_util_callback_->GetAudioInputHardwareChannelLayout( |
230 AudioManagerBase::kDefaultDeviceId) : 0; | 231 AudioManagerBase::kDefaultDeviceId) : CHANNEL_LAYOUT_NONE; |
231 } | 232 } |
232 | 233 |
233 // IPC::Channel::Listener implementation. | 234 // IPC::Channel::Listener implementation. |
234 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { | 235 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { |
235 if (render_thread_) { | 236 if (render_thread_) { |
236 IPC::ChannelProxy::MessageFilter* filter = | 237 IPC::ChannelProxy::MessageFilter* filter = |
237 render_thread_->audio_input_message_filter(); | 238 render_thread_->audio_input_message_filter(); |
238 if (filter->OnMessageReceived(message)) | 239 if (filter->OnMessageReceived(message)) |
239 return true; | 240 return true; |
240 | 241 |
(...skipping 14 matching lines...) Expand all Loading... |
255 return true; | 256 return true; |
256 } | 257 } |
257 | 258 |
258 bool handled ALLOW_UNUSED = true; | 259 bool handled ALLOW_UNUSED = true; |
259 bool message_is_ok = true; | 260 bool message_is_ok = true; |
260 IPC_BEGIN_MESSAGE_MAP_EX(WebRTCAudioDeviceTest, message, message_is_ok) | 261 IPC_BEGIN_MESSAGE_MAP_EX(WebRTCAudioDeviceTest, message, message_is_ok) |
261 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, | 262 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, |
262 OnGetHardwareSampleRate) | 263 OnGetHardwareSampleRate) |
263 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, | 264 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, |
264 OnGetHardwareInputSampleRate) | 265 OnGetHardwareInputSampleRate) |
265 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelCount, | 266 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelLayout, |
266 OnGetHardwareInputChannelCount) | 267 OnGetHardwareInputChannelLayout) |
267 IPC_MESSAGE_UNHANDLED(handled = false) | 268 IPC_MESSAGE_UNHANDLED(handled = false) |
268 IPC_END_MESSAGE_MAP_EX() | 269 IPC_END_MESSAGE_MAP_EX() |
269 | 270 |
270 EXPECT_TRUE(message_is_ok); | 271 EXPECT_TRUE(message_is_ok); |
271 | 272 |
272 return true; | 273 return true; |
273 } | 274 } |
274 | 275 |
275 // Posts a final task to the IO message loop and waits for completion. | 276 // Posts a final task to the IO message loop and waits for completion. |
276 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { | 277 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 WebRTCTransportImpl::~WebRTCTransportImpl() {} | 319 WebRTCTransportImpl::~WebRTCTransportImpl() {} |
319 | 320 |
320 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { | 321 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { |
321 return network_->ReceivedRTPPacket(channel, data, len); | 322 return network_->ReceivedRTPPacket(channel, data, len); |
322 } | 323 } |
323 | 324 |
324 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, | 325 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, |
325 int len) { | 326 int len) { |
326 return network_->ReceivedRTCPPacket(channel, data, len); | 327 return network_->ReceivedRTCPPacket(channel, data, len); |
327 } | 328 } |
OLD | NEW |