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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // than just the audio data, so we must call TotalSharedMemorySizeInBytes() | 145 // than just the audio data, so we must call TotalSharedMemorySizeInBytes() |
146 // to get the actual size needed to fit the audio data plus the extra data. | 146 // to get the actual size needed to fit the audio data plus the extra data. |
147 return TotalSharedMemorySizeInBytes(io_buffer_size); | 147 return TotalSharedMemorySizeInBytes(io_buffer_size); |
148 } | 148 } |
149 | 149 |
150 AudioOutputDeviceTest::AudioOutputDeviceTest() | 150 AudioOutputDeviceTest::AudioOutputDeviceTest() |
151 : synchronized_io_(GetParam()), | 151 : synchronized_io_(GetParam()), |
152 input_channels_(synchronized_io_ ? 2 : 0) { | 152 input_channels_(synchronized_io_ ? 2 : 0) { |
153 default_audio_parameters_.Reset( | 153 default_audio_parameters_.Reset( |
154 AudioParameters::AUDIO_PCM_LINEAR, | 154 AudioParameters::AUDIO_PCM_LINEAR, |
155 CHANNEL_LAYOUT_STEREO, 2, input_channels_, | 155 CHANNEL_LAYOUT_STEREO, input_channels_, |
156 48000, 16, 1024); | 156 48000, 16, 1024); |
157 | 157 |
158 audio_device_ = new AudioOutputDevice( | 158 audio_device_ = new AudioOutputDevice( |
159 &audio_output_ipc_, io_loop_.message_loop_proxy()); | 159 &audio_output_ipc_, io_loop_.message_loop_proxy()); |
160 | 160 |
161 audio_device_->Initialize(default_audio_parameters_, | 161 audio_device_->Initialize(default_audio_parameters_, |
162 &callback_); | 162 &callback_); |
163 | 163 |
164 io_loop_.RunUntilIdle(); | 164 io_loop_.RunUntilIdle(); |
165 } | 165 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 ExpectRenderCallback(); | 289 ExpectRenderCallback(); |
290 CreateStream(); | 290 CreateStream(); |
291 WaitUntilRenderCallback(); | 291 WaitUntilRenderCallback(); |
292 StopAudioDevice(); | 292 StopAudioDevice(); |
293 } | 293 } |
294 | 294 |
295 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 295 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
296 INSTANTIATE_TEST_CASE_P(RenderIO, AudioOutputDeviceTest, Values(true)); | 296 INSTANTIATE_TEST_CASE_P(RenderIO, AudioOutputDeviceTest, Values(true)); |
297 | 297 |
298 } // namespace media. | 298 } // namespace media. |
OLD | NEW |