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

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

Issue 23731007: Implicit audio output device selection for getUserMedia. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 3 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
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 bool MAYBE_WebRTCAudioDeviceTest::Send(IPC::Message* message) { 195 bool MAYBE_WebRTCAudioDeviceTest::Send(IPC::Message* message) {
196 return channel_->Send(message); 196 return channel_->Send(message);
197 } 197 }
198 198
199 void MAYBE_WebRTCAudioDeviceTest::SetAudioHardwareConfig( 199 void MAYBE_WebRTCAudioDeviceTest::SetAudioHardwareConfig(
200 media::AudioHardwareConfig* hardware_config) { 200 media::AudioHardwareConfig* hardware_config) {
201 audio_hardware_config_ = hardware_config; 201 audio_hardware_config_ = hardware_config;
202 } 202 }
203 203
204 scoped_refptr<WebRtcAudioRenderer>
205 MAYBE_WebRTCAudioDeviceTest::CreateDefaultWebRtcAudioRenderer(
206 int render_view_id) {
207 media::AudioHardwareConfig* hardware_config =
208 RenderThreadImpl::current()->GetAudioHardwareConfig();
209 int sample_rate = hardware_config->GetOutputSampleRate();
210 int frames_per_buffer = hardware_config->GetOutputBufferSize();
211
212 return new WebRtcAudioRenderer(render_view_id, 0, sample_rate,
213 frames_per_buffer);
214 }
215
204 void MAYBE_WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { 216 void MAYBE_WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) {
205 #if defined(OS_WIN) 217 #if defined(OS_WIN)
206 // We initialize COM (STA) on our IO thread as is done in Chrome. 218 // We initialize COM (STA) on our IO thread as is done in Chrome.
207 // See BrowserProcessSubThread::Init. 219 // See BrowserProcessSubThread::Init.
208 initialize_com_.reset(new base::win::ScopedCOMInitializer()); 220 initialize_com_.reset(new base::win::ScopedCOMInitializer());
209 #endif 221 #endif
210 222
211 // Set the current thread as the IO thread. 223 // Set the current thread as the IO thread.
212 io_thread_.reset( 224 io_thread_.reset(
213 new TestBrowserThread(BrowserThread::IO, base::MessageLoop::current())); 225 new TestBrowserThread(BrowserThread::IO, base::MessageLoop::current()));
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) { 382 int WebRTCTransportImpl::SendPacket(int channel, const void* data, int len) {
371 return network_->ReceivedRTPPacket(channel, data, len); 383 return network_->ReceivedRTPPacket(channel, data, len);
372 } 384 }
373 385
374 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data, 386 int WebRTCTransportImpl::SendRTCPPacket(int channel, const void* data,
375 int len) { 387 int len) {
376 return network_->ReceivedRTCPPacket(channel, data, len); 388 return network_->ReceivedRTCPPacket(channel, data, len);
377 } 389 }
378 390
379 } // namespace content 391 } // namespace content
OLDNEW
« no previous file with comments | « content/test/webrtc_audio_device_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698