| 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 // AudioOutputDispatcherImpl is an implementation of AudioOutputDispatcher. | 5 // AudioOutputDispatcherImpl is an implementation of AudioOutputDispatcher. |
| 6 // | 6 // |
| 7 // To avoid opening and closing audio devices more frequently than necessary, | 7 // To avoid opening and closing audio devices more frequently than necessary, |
| 8 // each dispatcher has a pool of inactive physical streams. A stream is closed | 8 // each dispatcher has a pool of inactive physical streams. A stream is closed |
| 9 // only if it hasn't been used for a certain period of time (specified via the | 9 // only if it hasn't been used for a certain period of time (specified via the |
| 10 // constructor). | 10 // constructor). |
| 11 // | 11 // |
| 12 | 12 |
| 13 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ | 13 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ |
| 14 #define MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ | 14 #define MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ |
| 15 | 15 |
| 16 #include <list> | 16 #include <list> |
| 17 #include <map> | 17 #include <map> |
| 18 | 18 |
| 19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
| 20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
| 21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "base/timer.h" | 22 #include "base/timer.h" |
| 23 #include "media/audio/audio_io.h" | 23 #include "media/audio/audio_io.h" |
| 24 #include "media/audio/audio_manager.h" | 24 #include "media/audio/audio_manager.h" |
| 25 #include "media/audio/audio_output_dispatcher.h" | 25 #include "media/audio/audio_output_dispatcher.h" |
| 26 #include "media/audio/audio_parameters.h" | 26 #include "media/audio/audio_parameters.h" |
| 27 | 27 |
| 28 class MessageLoop; | |
| 29 | |
| 30 namespace media { | 28 namespace media { |
| 31 | 29 |
| 32 class AudioOutputProxy; | 30 class AudioOutputProxy; |
| 33 | 31 |
| 34 class MEDIA_EXPORT AudioOutputDispatcherImpl : public AudioOutputDispatcher { | 32 class MEDIA_EXPORT AudioOutputDispatcherImpl : public AudioOutputDispatcher { |
| 35 public: | 33 public: |
| 36 // |close_delay_ms| specifies delay after the stream is paused until | 34 // |close_delay_ms| specifies delay after the stream is paused until |
| 37 // the audio device is closed. | 35 // the audio device is closed. |
| 38 AudioOutputDispatcherImpl(AudioManager* audio_manager, | 36 AudioOutputDispatcherImpl(AudioManager* audio_manager, |
| 39 const AudioParameters& params, | 37 const AudioParameters& params, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 base::DelayTimer<AudioOutputDispatcherImpl> close_timer_; | 91 base::DelayTimer<AudioOutputDispatcherImpl> close_timer_; |
| 94 | 92 |
| 95 AudioStreamMap proxy_to_physical_map_; | 93 AudioStreamMap proxy_to_physical_map_; |
| 96 | 94 |
| 97 DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl); | 95 DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl); |
| 98 }; | 96 }; |
| 99 | 97 |
| 100 } // namespace media | 98 } // namespace media |
| 101 | 99 |
| 102 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ | 100 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ |
| OLD | NEW |