| 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 "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 Loading... |
| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 webrtc_audio_device->capturer()->Stop(); | 574 webrtc_audio_device->capturer()->Stop(); |
| 577 renderer->Stop(); | 575 renderer->Stop(); |
| 578 EXPECT_EQ(0, base->StopSend(ch)); | 576 EXPECT_EQ(0, base->StopSend(ch)); |
| 579 EXPECT_EQ(0, base->StopPlayout(ch)); | 577 EXPECT_EQ(0, base->StopPlayout(ch)); |
| 580 | 578 |
| 581 EXPECT_EQ(0, base->DeleteChannel(ch)); | 579 EXPECT_EQ(0, base->DeleteChannel(ch)); |
| 582 EXPECT_EQ(0, base->Terminate()); | 580 EXPECT_EQ(0, base->Terminate()); |
| 583 } | 581 } |
| 584 | 582 |
| 585 } // namespace content | 583 } // namespace content |
| OLD | NEW |