Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Unified Diff: media/audio/audio_io.h

Issue 11413078: Tab Audio Capture: Browser-side connect/disconnect functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move Diverter interface into audio_io.h. Replace use of singleton with BrowserMainLoop. Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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()

Powered by Google App Engine
This is Rietveld 408576698