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

Unified Diff: media/audio/audio_source_diverter.h

Issue 1897953003: Unmute Tab Audio For Desktop Share (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 7 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
« no previous file with comments | « media/audio/audio_output_controller_unittest.cc ('k') | media/audio/virtual_audio_input_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_source_diverter.h
diff --git a/media/audio/audio_source_diverter.h b/media/audio/audio_source_diverter.h
index 787ddec7867dfd693ce04623ca1bb23d4ca2c949..6ac55a65f25b5c1bd3c822e57d43b26a17c65dd4 100644
--- a/media/audio/audio_source_diverter.h
+++ b/media/audio/audio_source_diverter.h
@@ -5,6 +5,8 @@
#ifndef MEDIA_AUDIO_AUDIO_SOURCE_DIVERTER_H_
#define MEDIA_AUDIO_AUDIO_SOURCE_DIVERTER_H_
+#include "base/time/time.h"
+#include "media/base/audio_bus.h"
#include "media/base/media_export.h"
// Audio sources may optionally implement AudioSourceDiverter to temporarily
@@ -17,6 +19,17 @@ namespace media {
class AudioOutputStream;
class AudioParameters;
+class MEDIA_EXPORT AudioPushSink {
+ public:
+ // Call this function to push audio data into the sink.
+ virtual void OnData(std::unique_ptr<AudioBus> source,
+ base::TimeTicks reference_time) = 0;
+
+ // Close the stream.
+ // After calling this method, the object should not be used anymore.
+ virtual void Close() = 0;
+};
+
class MEDIA_EXPORT AudioSourceDiverter {
public:
// Returns the audio parameters of the divertable audio data.
@@ -31,7 +44,15 @@ public:
// responsible for making sure the stream is closed, perhaps asynchronously.
virtual void StopDiverting() = 0;
-protected:
+ // Start duplicating the current audio stream, and push the copied data into
+ // |sink|.
+ virtual void StartDuplicating(AudioPushSink* sink) = 0;
+
+ // Stop duplicating for the specified |sink|. The AudioSourceDiverter is
+ // responsible for making sure the sink is closed, perhaps asynchronously.
+ virtual void StopDuplicating(AudioPushSink* sink) = 0;
+
+ protected:
virtual ~AudioSourceDiverter() {}
};
« no previous file with comments | « media/audio/audio_output_controller_unittest.cc ('k') | media/audio/virtual_audio_input_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698