| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "base/test/test_timeouts.h" | 15 #include "base/test/test_timeouts.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "media/audio/audio_device_description.h" |
| 19 #include "media/audio/audio_io.h" | 20 #include "media/audio/audio_io.h" |
| 20 #include "media/audio/audio_manager_base.h" | |
| 21 #include "media/audio/audio_unittest_util.h" | 21 #include "media/audio/audio_unittest_util.h" |
| 22 #include "media/audio/fake_audio_log_factory.h" | 22 #include "media/audio/fake_audio_log_factory.h" |
| 23 #include "media/base/seekable_buffer.h" | 23 #include "media/base/seekable_buffer.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 #if defined(USE_PULSEAUDIO) | 27 #if defined(USE_PULSEAUDIO) |
| 28 #include "media/audio/pulse/audio_manager_pulse.h" | 28 #include "media/audio/pulse/audio_manager_pulse.h" |
| 29 #elif defined(USE_ALSA) | 29 #elif defined(USE_ALSA) |
| 30 #include "media/audio/alsa/audio_manager_alsa.h" | 30 #include "media/audio/alsa/audio_manager_alsa.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 base::TimeTicks previous_write_time_; | 273 base::TimeTicks previous_write_time_; |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 class AudioInputStreamTraits { | 276 class AudioInputStreamTraits { |
| 277 public: | 277 public: |
| 278 typedef AudioInputStream StreamType; | 278 typedef AudioInputStream StreamType; |
| 279 | 279 |
| 280 static AudioParameters GetDefaultAudioStreamParameters( | 280 static AudioParameters GetDefaultAudioStreamParameters( |
| 281 AudioManager* audio_manager) { | 281 AudioManager* audio_manager) { |
| 282 return audio_manager->GetInputStreamParameters( | 282 return audio_manager->GetInputStreamParameters( |
| 283 AudioManagerBase::kDefaultDeviceId); | 283 AudioDeviceDescription::kDefaultDeviceId); |
| 284 } | 284 } |
| 285 | 285 |
| 286 static StreamType* CreateStream(AudioManager* audio_manager, | 286 static StreamType* CreateStream(AudioManager* audio_manager, |
| 287 const AudioParameters& params) { | 287 const AudioParameters& params) { |
| 288 return audio_manager->MakeAudioInputStream(params, | 288 return audio_manager->MakeAudioInputStream( |
| 289 AudioManagerBase::kDefaultDeviceId); | 289 params, AudioDeviceDescription::kDefaultDeviceId); |
| 290 } | 290 } |
| 291 }; | 291 }; |
| 292 | 292 |
| 293 class AudioOutputStreamTraits { | 293 class AudioOutputStreamTraits { |
| 294 public: | 294 public: |
| 295 typedef AudioOutputStream StreamType; | 295 typedef AudioOutputStream StreamType; |
| 296 | 296 |
| 297 static AudioParameters GetDefaultAudioStreamParameters( | 297 static AudioParameters GetDefaultAudioStreamParameters( |
| 298 AudioManager* audio_manager) { | 298 AudioManager* audio_manager) { |
| 299 return audio_manager->GetDefaultOutputStreamParameters(); | 299 return audio_manager->GetDefaultOutputStreamParameters(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 434 |
| 435 // All Close() operations that run on the mocked audio thread, | 435 // All Close() operations that run on the mocked audio thread, |
| 436 // should be synchronous and not post additional close tasks to | 436 // should be synchronous and not post additional close tasks to |
| 437 // mocked the audio thread. Hence, there is no need to call | 437 // mocked the audio thread. Hence, there is no need to call |
| 438 // message_loop()->RunUntilIdle() after the Close() methods. | 438 // message_loop()->RunUntilIdle() after the Close() methods. |
| 439 aos->Close(); | 439 aos->Close(); |
| 440 ais->Close(); | 440 ais->Close(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 } // namespace media | 443 } // namespace media |
| OLD | NEW |