Index: media/audio/audio_output_controller.h |
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h |
index 762a9483d0fb51d1bdeed0cfa08a042508bab368..1e8be2d3c7f831fe878d5138186cf73921e21c69 100644 |
--- a/media/audio/audio_output_controller.h |
+++ b/media/audio/audio_output_controller.h |
@@ -154,6 +154,21 @@ class MEDIA_EXPORT AudioOutputController |
// to being called. |
virtual void OnDeviceChange() OVERRIDE; |
+ // Accessor to audio output parameters. |
+ const AudioParameters& params() const { return params_; } |
+ |
+ // Stops the normal audio output stream and creates an AudioSourceCallback to |
+ // provide audio data to some other destination. The given object will always |
+ // return data when OnMoreData() is invoked, even if the underlying |
+ // implementation is paused/stopped. AudioOutputController retains ownership |
+ // of the returned object. |
+ AudioOutputStream::AudioSourceCallback* Divert(); |
DaleCurtis
2012/12/05 23:35:14
Hmm, this is odd since AudioOutputController is ge
miu
2012/12/11 02:30:45
It's a pull model, not a push model (the AudioSour
|
+ |
+ // Restores normal audio output behavior for the current playback state. |
+ // |asc| is the pointer returned by the previous call to Divert() and becomes |
+ // invalid once this method is called. |
+ void Revert(AudioOutputStream::AudioSourceCallback* asc); |
+ |
protected: |
// Internal state of the source. |
enum State { |
@@ -196,10 +211,14 @@ class MEDIA_EXPORT AudioOutputController |
// Signals event when done if it is not NULL. |
void DoStopCloseAndClearStream(base::WaitableEvent *done); |
- AudioManager* audio_manager_; |
+ AudioManager* const audio_manager_; |
+ const AudioParameters params_; |
// |handler_| may be called only if |state_| is not kClosed. |
EventHandler* handler_; |
+ |
+ // AudioManager-owned stream. Note that this could be NULL during state |
+ // kCreated, kPlaying, etc.; if audio is currently being diverted. |
AudioOutputStream* stream_; |
// The current volume of the audio stream. |
@@ -224,8 +243,6 @@ class MEDIA_EXPORT AudioOutputController |
// Number of times left. |
int number_polling_attempts_left_; |
- AudioParameters params_; |
- |
// Used to post delayed tasks to ourselves that we can cancel. |
// We don't want the tasks to hold onto a reference as it will slow down |
// shutdown and force it to wait for the most delayed task. |