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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/sync_socket.h" | 9 #include "base/sync_socket.h" |
10 #include "content/browser/media/capture/audio_mirroring_manager.h" | 10 #include "content/browser/media/capture/audio_mirroring_manager.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 // Send a create stream message to the audio output stream and wait until | 218 // Send a create stream message to the audio output stream and wait until |
219 // we receive the created message. | 219 // we receive the created message. |
220 int session_id; | 220 int session_id; |
221 media::AudioParameters params; | 221 media::AudioParameters params; |
222 if (unified_stream) { | 222 if (unified_stream) { |
223 // Use AudioInputDeviceManager::kFakeOpenSessionId as the session id to | 223 // Use AudioInputDeviceManager::kFakeOpenSessionId as the session id to |
224 // pass the permission check. | 224 // pass the permission check. |
225 session_id = AudioInputDeviceManager::kFakeOpenSessionId; | 225 session_id = AudioInputDeviceManager::kFakeOpenSessionId; |
226 params = media::AudioParameters( | 226 params = media::AudioParameters( |
227 media::AudioParameters::AUDIO_FAKE, | 227 media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, |
228 media::CHANNEL_LAYOUT_STEREO, | |
229 media::AudioParameters::kAudioCDSampleRate, 16, | 228 media::AudioParameters::kAudioCDSampleRate, 16, |
230 media::AudioParameters::kAudioCDSampleRate / 10, | 229 media::AudioParameters::kAudioCDSampleRate / 10); |
231 media::AudioParameters::NO_EFFECTS); | |
232 } else { | 230 } else { |
233 session_id = 0; | 231 session_id = 0; |
234 params = media::AudioParameters( | 232 params = media::AudioParameters( |
235 media::AudioParameters::AUDIO_FAKE, | 233 media::AudioParameters::AUDIO_FAKE, |
236 media::CHANNEL_LAYOUT_STEREO, | 234 media::CHANNEL_LAYOUT_STEREO, |
237 media::AudioParameters::kAudioCDSampleRate, 16, | 235 media::AudioParameters::kAudioCDSampleRate, 16, |
238 media::AudioParameters::kAudioCDSampleRate / 10); | 236 media::AudioParameters::kAudioCDSampleRate / 10); |
239 } | 237 } |
240 host_->OnCreateStream(kStreamId, kRenderFrameId, session_id, params); | 238 host_->OnCreateStream(kStreamId, kRenderFrameId, session_id, params); |
241 | 239 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 401 } |
404 | 402 |
405 TEST_F(AudioRendererHostTest, CreateUnifiedStreamAndClose) { | 403 TEST_F(AudioRendererHostTest, CreateUnifiedStreamAndClose) { |
406 Create(true); | 404 Create(true); |
407 Close(); | 405 Close(); |
408 } | 406 } |
409 | 407 |
410 // TODO(hclam): Add tests for data conversation in low latency mode. | 408 // TODO(hclam): Add tests for data conversation in low latency mode. |
411 | 409 |
412 } // namespace content | 410 } // namespace content |
OLD | NEW |