Index: media/audio/audio_output_controller.h |
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h |
index 61718a3d1dd4af915cb909d8c66b58c62068eb3d..f72c9161f46c9c0aaae51ff6b3661a0ca9057cb2 100644 |
--- a/media/audio/audio_output_controller.h |
+++ b/media/audio/audio_output_controller.h |
@@ -66,6 +66,7 @@ namespace media { |
class MEDIA_EXPORT AudioOutputController |
: public base::RefCountedThreadSafe<AudioOutputController>, |
public AudioOutputStream::AudioSourceCallback, |
+ public AudioOutputStream::AudioSourceDiverter, |
NON_EXPORTED_BASE(public AudioManager::AudioDeviceListener) { |
public: |
// An event handler that receives events from the AudioOutputController. The |
@@ -154,8 +155,13 @@ class MEDIA_EXPORT AudioOutputController |
// to being called. |
virtual void OnDeviceChange() OVERRIDE; |
+ // AudioSourceDiverter implementation. |
+ virtual const AudioParameters& GetAudioParameters() OVERRIDE; |
+ virtual void StartDiverting(AudioOutputStream* to_stream) OVERRIDE; |
+ virtual void StopDiverting() OVERRIDE; |
+ |
protected: |
- // Internal state of the source. |
+ // Internal state of the source. |
enum State { |
kEmpty, |
kCreated, |
@@ -188,6 +194,8 @@ class MEDIA_EXPORT AudioOutputController |
void DoClose(); |
void DoSetVolume(double volume); |
void DoReportError(int code); |
+ void DoStartDiverting(AudioOutputStream* to_stream); |
+ void DoStopDiverting(); |
// Helper method that starts physical stream. |
void StartStream(); |
@@ -197,6 +205,7 @@ class MEDIA_EXPORT AudioOutputController |
void DoStopCloseAndClearStream(base::WaitableEvent *done); |
AudioManager* const audio_manager_; |
+ const AudioParameters params_; |
// |handler_| may be called only if |state_| is not kClosed. |
EventHandler* handler_; |
@@ -205,6 +214,9 @@ class MEDIA_EXPORT AudioOutputController |
// changed. See comment for weak_this_. |
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_; |
@@ -227,8 +239,6 @@ class MEDIA_EXPORT AudioOutputController |
// Number of times left. |
int number_polling_attempts_left_; |
- AudioParameters params_; |
- |
// Used to auto-cancel the delayed tasks that are created to poll for data |
// (when starting-up a stream). |
base::WeakPtrFactory<AudioOutputController> weak_this_; |