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..6378377681fa4be6208f05d41c0406166ed72657 100644 |
--- a/media/audio/audio_output_controller.h |
+++ b/media/audio/audio_output_controller.h |
@@ -154,6 +154,20 @@ 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 begins providing audio data to |
+ // another destination. |to_stream| remains under complete control of |
+ // AudioOutputController until RevertDiversion() is called. Caller retains |
+ // ownership of |to_stream| but it must remain alive until RevertDiversion() |
+ // is called. |
+ void DivertToStream(AudioOutputStream* to_stream); |
+ |
+ // Restores normal audio output behavior. The stream that was provided in the |
+ // previous call to DivertToStream() is closed. |
+ void RevertDiversion(); |
DaleCurtis
2012/12/17 20:00:47
Naming is a bit odd; but my suggestions sound wonk
tommi (sloooow) - chröme
2012/12/18 13:41:26
RevertDivert? yeah, hard to come up with a good on
miu
2012/12/19 00:22:57
Done.
|
+ |
protected: |
// Internal state of the source. |
enum State { |
@@ -196,12 +210,18 @@ 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_; |
+ |
+ // Currently open stream. |
AudioOutputStream* stream_; |
+ // When non-NULL, audio is being diverted to this stream. |
+ AudioOutputStream* diverting_to_stream_; |
+ |
// The current volume of the audio stream. |
double volume_; |
@@ -224,8 +244,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. |