| 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" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 AudioDeviceDescription::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( | 288 return audio_manager->MakeAudioInputStream( |
| 289 params, AudioDeviceDescription::kDefaultDeviceId, | 289 params, AudioDeviceDescription::kDefaultDeviceId); |
| 290 AudioManager::LogCallback()); | |
| 291 } | 290 } |
| 292 }; | 291 }; |
| 293 | 292 |
| 294 class AudioOutputStreamTraits { | 293 class AudioOutputStreamTraits { |
| 295 public: | 294 public: |
| 296 typedef AudioOutputStream StreamType; | 295 typedef AudioOutputStream StreamType; |
| 297 | 296 |
| 298 static AudioParameters GetDefaultAudioStreamParameters( | 297 static AudioParameters GetDefaultAudioStreamParameters( |
| 299 AudioManager* audio_manager) { | 298 AudioManager* audio_manager) { |
| 300 return audio_manager->GetDefaultOutputStreamParameters(); | 299 return audio_manager->GetDefaultOutputStreamParameters(); |
| 301 } | 300 } |
| 302 | 301 |
| 303 static StreamType* CreateStream(AudioManager* audio_manager, | 302 static StreamType* CreateStream(AudioManager* audio_manager, |
| 304 const AudioParameters& params) { | 303 const AudioParameters& params) { |
| 305 return audio_manager->MakeAudioOutputStream(params, std::string(), | 304 return audio_manager->MakeAudioOutputStream(params, std::string()); |
| 306 AudioManager::LogCallback()); | |
| 307 } | 305 } |
| 308 }; | 306 }; |
| 309 | 307 |
| 310 // Traits template holding a trait of StreamType. It encapsulates | 308 // Traits template holding a trait of StreamType. It encapsulates |
| 311 // AudioInputStream and AudioOutputStream stream types. | 309 // AudioInputStream and AudioOutputStream stream types. |
| 312 template <typename StreamTraits> | 310 template <typename StreamTraits> |
| 313 class StreamWrapper { | 311 class StreamWrapper { |
| 314 public: | 312 public: |
| 315 typedef typename StreamTraits::StreamType StreamType; | 313 typedef typename StreamTraits::StreamType StreamType; |
| 316 | 314 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 434 |
| 437 // All Close() operations that run on the mocked audio thread, | 435 // All Close() operations that run on the mocked audio thread, |
| 438 // should be synchronous and not post additional close tasks to | 436 // should be synchronous and not post additional close tasks to |
| 439 // mocked the audio thread. Hence, there is no need to call | 437 // mocked the audio thread. Hence, there is no need to call |
| 440 // message_loop()->RunUntilIdle() after the Close() methods. | 438 // message_loop()->RunUntilIdle() after the Close() methods. |
| 441 aos->Close(); | 439 aos->Close(); |
| 442 ais->Close(); | 440 ais->Close(); |
| 443 } | 441 } |
| 444 | 442 |
| 445 } // namespace media | 443 } // namespace media |
| OLD | NEW |