| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 public: | 305 public: |
| 306 typedef AudioOutputStream StreamType; | 306 typedef AudioOutputStream StreamType; |
| 307 | 307 |
| 308 static AudioParameters GetDefaultAudioStreamParameters( | 308 static AudioParameters GetDefaultAudioStreamParameters( |
| 309 AudioManager* audio_manager) { | 309 AudioManager* audio_manager) { |
| 310 return audio_manager->GetDefaultOutputStreamParameters(); | 310 return audio_manager->GetDefaultOutputStreamParameters(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 static StreamType* CreateStream(AudioManager* audio_manager, | 313 static StreamType* CreateStream(AudioManager* audio_manager, |
| 314 const AudioParameters& params) { | 314 const AudioParameters& params) { |
| 315 return audio_manager->MakeAudioOutputStream(params, std::string(), | 315 return audio_manager->MakeAudioOutputStream(params, std::string()); |
| 316 std::string()); | |
| 317 } | 316 } |
| 318 }; | 317 }; |
| 319 | 318 |
| 320 // Traits template holding a trait of StreamType. It encapsulates | 319 // Traits template holding a trait of StreamType. It encapsulates |
| 321 // AudioInputStream and AudioOutputStream stream types. | 320 // AudioInputStream and AudioOutputStream stream types. |
| 322 template <typename StreamTraits> | 321 template <typename StreamTraits> |
| 323 class StreamWrapper { | 322 class StreamWrapper { |
| 324 public: | 323 public: |
| 325 typedef typename StreamTraits::StreamType StreamType; | 324 typedef typename StreamTraits::StreamType StreamType; |
| 326 | 325 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 444 |
| 446 // All Close() operations that run on the mocked audio thread, | 445 // All Close() operations that run on the mocked audio thread, |
| 447 // should be synchronous and not post additional close tasks to | 446 // should be synchronous and not post additional close tasks to |
| 448 // mocked the audio thread. Hence, there is no need to call | 447 // mocked the audio thread. Hence, there is no need to call |
| 449 // message_loop()->RunUntilIdle() after the Close() methods. | 448 // message_loop()->RunUntilIdle() after the Close() methods. |
| 450 aos->Close(); | 449 aos->Close(); |
| 451 ais->Close(); | 450 ais->Close(); |
| 452 } | 451 } |
| 453 | 452 |
| 454 } // namespace media | 453 } // namespace media |
| OLD | NEW |