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

Side by Side Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review Created 7 years, 9 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 "base/environment.h" 5 #include "base/environment.h"
6 #include "base/test/test_timeouts.h" 6 #include "base/test/test_timeouts.h"
7 #include "content/renderer/media/webrtc_audio_capturer.h" 7 #include "content/renderer/media/webrtc_audio_capturer.h"
8 #include "content/renderer/media/webrtc_audio_device_impl.h" 8 #include "content/renderer/media/webrtc_audio_device_impl.h"
9 #include "content/renderer/media/webrtc_audio_renderer.h" 9 #include "content/renderer/media/webrtc_audio_renderer.h"
10 #include "content/renderer/render_thread_impl.h" 10 #include "content/renderer/render_thread_impl.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return false; 93 return false;
94 94
95 media::AudioHardwareConfig* hardware_config = 95 media::AudioHardwareConfig* hardware_config =
96 RenderThreadImpl::current()->GetAudioHardwareConfig(); 96 RenderThreadImpl::current()->GetAudioHardwareConfig();
97 97
98 // Use native capture sample rate and channel configuration to get some 98 // Use native capture sample rate and channel configuration to get some
99 // action in this test. 99 // action in this test.
100 int sample_rate = hardware_config->GetInputSampleRate(); 100 int sample_rate = hardware_config->GetInputSampleRate();
101 media::ChannelLayout channel_layout = 101 media::ChannelLayout channel_layout =
102 hardware_config->GetInputChannelLayout(); 102 hardware_config->GetInputChannelLayout();
103 if (!capturer->Initialize(channel_layout, sample_rate)) 103 if (!capturer->Initialize(channel_layout, sample_rate, 1))
104 return false; 104 return false;
105 105
106 // Ensures that the default capture device is utilized.
107 webrtc_audio_device->capturer()->SetDevice(1);
108 return true; 106 return true;
109 } 107 }
110 108
111 109
112 class WebRTCMediaProcessImpl : public webrtc::VoEMediaProcess { 110 class WebRTCMediaProcessImpl : public webrtc::VoEMediaProcess {
113 public: 111 public:
114 explicit WebRTCMediaProcessImpl(base::WaitableEvent* event) 112 explicit WebRTCMediaProcessImpl(base::WaitableEvent* event)
115 : event_(event), 113 : event_(event),
116 channel_id_(-1), 114 channel_id_(-1),
117 type_(webrtc::kPlaybackPerChannel), 115 type_(webrtc::kPlaybackPerChannel),
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 557
560 renderer->Stop(); 558 renderer->Stop();
561 EXPECT_EQ(0, base->StopSend(ch)); 559 EXPECT_EQ(0, base->StopSend(ch));
562 EXPECT_EQ(0, base->StopPlayout(ch)); 560 EXPECT_EQ(0, base->StopPlayout(ch));
563 561
564 EXPECT_EQ(0, base->DeleteChannel(ch)); 562 EXPECT_EQ(0, base->DeleteChannel(ch));
565 EXPECT_EQ(0, base->Terminate()); 563 EXPECT_EQ(0, base->Terminate());
566 } 564 }
567 565
568 } // namespace content 566 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698