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

Unified Diff: content/browser/media/capture/web_contents_audio_input_stream.cc

Issue 1897953003: Unmute Tab Audio For Desktop Share (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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: content/browser/media/capture/web_contents_audio_input_stream.cc
diff --git a/content/browser/media/capture/web_contents_audio_input_stream.cc b/content/browser/media/capture/web_contents_audio_input_stream.cc
index ce8f7f46419f158a31a0540eb0b9583e997d0848..ffbd2243b15aa74f67b13e6b15aa4456985f457f 100644
--- a/content/browser/media/capture/web_contents_audio_input_stream.cc
+++ b/content/browser/media/capture/web_contents_audio_input_stream.cc
@@ -86,9 +86,14 @@ class WebContentsAudioInputStream::Impl
const MatchesCallback& results_callback);
media::AudioOutputStream* AddInput(
const media::AudioParameters& params) override;
+ media::AudioPushSink* AddPushInput(
+ const media::AudioParameters& params) override;
// Callback which is run when |stream| is closed. Deletes |stream|.
void ReleaseInput(media::VirtualAudioOutputStream* stream);
+ void ReleasePushInput(media::VirtualAudioSink* sink);
+
+ bool IsDuplication() override;
// Called by WebContentsTracker when the target of the audio mirroring has
// changed.
@@ -302,6 +307,25 @@ void WebContentsAudioInputStream::Impl::ReleaseInput(
delete stream;
}
+media::AudioPushSink* WebContentsAudioInputStream::Impl::AddPushInput(
+ const media::AudioParameters& params) {
+ // Note: The closure created here holds a reference to "this," which will
+ // guarantee the VirtualAudioInputStream (mixer_stream_) outlives the
+ // VirtualAudioSink.
+ return new media::VirtualAudioSink(params, mixer_stream_.get(),
+ base::Bind(&Impl::ReleasePushInput, this));
+}
+
+void WebContentsAudioInputStream::Impl::ReleasePushInput(
+ media::VirtualAudioSink* stream) {
+ delete stream;
+}
+
+bool WebContentsAudioInputStream::Impl::IsDuplication() {
+ // TODO(qiangchen): Return true for the case of Tab Typed Desktop Share.
+ return false;
+}
+
void WebContentsAudioInputStream::Impl::OnTargetChanged(bool had_target) {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698