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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return false; | 91 return false; |
92 | 92 |
93 media::AudioHardwareConfig* hardware_config = | 93 media::AudioHardwareConfig* hardware_config = |
94 RenderThreadImpl::current()->GetAudioHardwareConfig(); | 94 RenderThreadImpl::current()->GetAudioHardwareConfig(); |
95 | 95 |
96 // Use native capture sample rate and channel configuration to get some | 96 // Use native capture sample rate and channel configuration to get some |
97 // action in this test. | 97 // action in this test. |
98 int sample_rate = hardware_config->GetInputSampleRate(); | 98 int sample_rate = hardware_config->GetInputSampleRate(); |
99 media::ChannelLayout channel_layout = | 99 media::ChannelLayout channel_layout = |
100 hardware_config->GetInputChannelLayout(); | 100 hardware_config->GetInputChannelLayout(); |
101 if (!capturer->Initialize(channel_layout, sample_rate)) | 101 if (!capturer->Initialize(kRenderViewId, channel_layout, sample_rate)) |
102 return false; | 102 return false; |
103 | 103 |
104 // Ensures that the default capture device is utilized. | 104 // Ensures that the default capture device is utilized. |
105 webrtc_audio_device->capturer()->SetDevice(1); | 105 webrtc_audio_device->capturer()->SetDevice(1); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 | 109 |
110 class WebRTCMediaProcessImpl : public webrtc::VoEMediaProcess { | 110 class WebRTCMediaProcessImpl : public webrtc::VoEMediaProcess { |
111 public: | 111 public: |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 renderer->Stop(); | 554 renderer->Stop(); |
555 EXPECT_EQ(0, base->StopSend(ch)); | 555 EXPECT_EQ(0, base->StopSend(ch)); |
556 EXPECT_EQ(0, base->StopPlayout(ch)); | 556 EXPECT_EQ(0, base->StopPlayout(ch)); |
557 | 557 |
558 EXPECT_EQ(0, base->DeleteChannel(ch)); | 558 EXPECT_EQ(0, base->DeleteChannel(ch)); |
559 EXPECT_EQ(0, base->Terminate()); | 559 EXPECT_EQ(0, base->Terminate()); |
560 } | 560 } |
561 | 561 |
562 } // namespace content | 562 } // namespace content |
OLD | NEW |