Chromium Code Reviews| Index: media/audio/audio_io.h |
| diff --git a/media/audio/audio_io.h b/media/audio/audio_io.h |
| index e7b9a36011ef73332ae0607952ab4278759db92b..b4c096ad117bde8544ab5186a7a97a550f334c1b 100644 |
| --- a/media/audio/audio_io.h |
| +++ b/media/audio/audio_io.h |
| @@ -49,6 +49,8 @@ |
| namespace media { |
| +class AudioParameters; |
| + |
| class MEDIA_EXPORT AudioOutputStream { |
| public: |
| // Audio sources must implement AudioSourceCallback. This interface will be |
| @@ -84,6 +86,28 @@ class MEDIA_EXPORT AudioOutputStream { |
| virtual ~AudioSourceCallback() {} |
| }; |
| + // Audio sources may optionally implement AudioSourceDiverter to temporarily |
| + // divert audio data to an alternate AudioOutputStream. This allows the |
| + // audio data to be plumbed to an alternate consumer; for example, a loopback |
| + // mechanism for audio mirroring. |
| + class MEDIA_EXPORT AudioSourceDiverter { |
|
DaleCurtis
2013/01/08 19:23:33
Does this need to be nested with AudioOutputStream
miu
2013/01/09 02:19:41
Done. Moved to: base/audio/audio_source_diverter.
|
| + public: |
| + // Returns the audio parameters of the divertable audio data. |
| + virtual const AudioParameters& GetAudioParameters() = 0; |
| + |
| + // Start providing audio data to the given |to_stream|, which is in an |
| + // unopened state. |to_stream| remains under the control of the |
| + // AudioSourceDiverter. |
| + virtual void StartDiverting(AudioOutputStream* to_stream) = 0; |
| + |
| + // Stops diverting audio data to the stream. The AudioSourceDiverter is |
| + // responsible for making sure the stream is closed, perhaps asynchronously. |
| + virtual void StopDiverting() = 0; |
| + |
| + protected: |
| + virtual ~AudioSourceDiverter() {} |
| + }; |
| + |
| virtual ~AudioOutputStream() {} |
| // Open the stream. false is returned if the stream cannot be opened. Open() |