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..032c0fba3a98024db7bb7622336c2f28dbd0ed66 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,12 @@ 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); |
// Called by WebContentsTracker when the target of the audio mirroring has |
// changed. |
@@ -283,7 +286,8 @@ void WebContentsAudioInputStream::Impl::QueryForMatchesOnUIThread( |
} |
} |
- results_callback.Run(matches); |
+ // TODO(qiangchen): Plug in true for the case of Tab Typed Desktop Share. |
+ results_callback.Run(matches, true); |
miu
2016/05/02 20:06:13
The 2nd argument here should be false, to maintain
qiangchen
2016/05/03 16:58:23
Done.
Ha, that's my testing code. Forgot to chang
|
} |
media::AudioOutputStream* WebContentsAudioInputStream::Impl::AddInput( |
@@ -302,6 +306,20 @@ 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; |
+} |
+ |
void WebContentsAudioInputStream::Impl::OnTargetChanged(bool had_target) { |
DCHECK(thread_checker_.CalledOnValidThread()); |