Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: content/test/webrtc_audio_device_test.cc

Issue 12049070: Avoids irregular OnMoreData callbacks on Windows using Core Audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleaned up Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 276
277 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout( 277 void WebRTCAudioDeviceTest::OnGetHardwareInputChannelLayout(
278 media::ChannelLayout* layout) { 278 media::ChannelLayout* layout) {
279 EXPECT_TRUE(audio_util_callback_); 279 EXPECT_TRUE(audio_util_callback_);
280 *layout = !audio_util_callback_ ? media::CHANNEL_LAYOUT_NONE : 280 *layout = !audio_util_callback_ ? media::CHANNEL_LAYOUT_NONE :
281 audio_util_callback_->GetAudioInputHardwareChannelLayout( 281 audio_util_callback_->GetAudioInputHardwareChannelLayout(
282 media::AudioManagerBase::kDefaultDeviceId); 282 media::AudioManagerBase::kDefaultDeviceId);
283 } 283 }
284 284
285 void WebRTCAudioDeviceTest::OnGetHardwareBufferSize(uint32* buffer_size) {
286 EXPECT_TRUE(audio_util_callback_);
287 *buffer_size = audio_util_callback_ ?
288 audio_util_callback_->GetAudioOutputBufferSize() : 0;
289 }
290
285 // IPC::Listener implementation. 291 // IPC::Listener implementation.
286 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) { 292 bool WebRTCAudioDeviceTest::OnMessageReceived(const IPC::Message& message) {
287 if (render_thread_) { 293 if (render_thread_) {
288 IPC::ChannelProxy::MessageFilter* filter = 294 IPC::ChannelProxy::MessageFilter* filter =
289 render_thread_->audio_input_message_filter(); 295 render_thread_->audio_input_message_filter();
290 if (filter->OnMessageReceived(message)) 296 if (filter->OnMessageReceived(message))
291 return true; 297 return true;
292 298
293 filter = render_thread_->audio_message_filter(); 299 filter = render_thread_->audio_message_filter();
294 if (filter->OnMessageReceived(message)) 300 if (filter->OnMessageReceived(message))
(...skipping 14 matching lines...) Expand all
309 315
310 bool handled ALLOW_UNUSED = true; 316 bool handled ALLOW_UNUSED = true;
311 bool message_is_ok = true; 317 bool message_is_ok = true;
312 IPC_BEGIN_MESSAGE_MAP_EX(WebRTCAudioDeviceTest, message, message_is_ok) 318 IPC_BEGIN_MESSAGE_MAP_EX(WebRTCAudioDeviceTest, message, message_is_ok)
313 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, 319 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate,
314 OnGetHardwareSampleRate) 320 OnGetHardwareSampleRate)
315 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate, 321 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputSampleRate,
316 OnGetHardwareInputSampleRate) 322 OnGetHardwareInputSampleRate)
317 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelLayout, 323 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelLayout,
318 OnGetHardwareInputChannelLayout) 324 OnGetHardwareInputChannelLayout)
325 IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareBufferSize,
326 OnGetHardwareBufferSize)
319 IPC_MESSAGE_UNHANDLED(handled = false) 327 IPC_MESSAGE_UNHANDLED(handled = false)
320 IPC_END_MESSAGE_MAP_EX() 328 IPC_END_MESSAGE_MAP_EX()
321 329
322 EXPECT_TRUE(message_is_ok); 330 EXPECT_TRUE(message_is_ok);
323 331
324 return true; 332 return true;
325 } 333 }
326 334
327 // Posts a final task to the IO message loop and waits for completion. 335 // Posts a final task to the IO message loop and waits for completion.
328 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() { 336 void WebRTCAudioDeviceTest::WaitForIOThreadCompletion() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 379 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
372 return network_->ReceivedRTPPacket(channel, data, len); 380 return network_->ReceivedRTPPacket(channel, data, len);
373 } 381 }
374 382
375 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 383 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
376 int len) { 384 int len) {
377 return network_->ReceivedRTCPPacket(channel, data, len); 385 return network_->ReceivedRTCPPacket(channel, data, len);
378 } 386 }
379 387
380 } // namespace content 388 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698