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

Unified Diff: media/audio/audio_output_controller.h

Issue 11413078: Tab Audio Capture: Browser-side connect/disconnect functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor tweaks and added some useful comments. Created 8 years, 1 month 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_output_controller.h
diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h
index 3dae719856508cd6a25e28dc22cd84305a35dd58..73fb014ecc09d700a8dbd94b4a241adb16533480 100644
--- a/media/audio/audio_output_controller.h
+++ b/media/audio/audio_output_controller.h
@@ -158,6 +158,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();
+
+ // 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 {
@@ -228,7 +243,7 @@ class MEDIA_EXPORT AudioOutputController
// Number of times left.
int number_polling_attempts_left_;
- AudioParameters params_;
+ const 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

Powered by Google App Engine
This is Rietveld 408576698