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