| 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..fe793d45c7fb46aa1324d83457e94cdf92568603 100644
|
| --- a/content/browser/media/capture/web_contents_audio_input_stream.cc
|
| +++ b/content/browser/media/capture/web_contents_audio_input_stream.cc
|
| @@ -87,9 +87,16 @@ class WebContentsAudioInputStream::Impl
|
| 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::LoopbackSink* stream);
|
| +
|
| + bool IsDuplication() override;
|
| +
|
| // Called by WebContentsTracker when the target of the audio mirroring has
|
| // changed.
|
| void OnTargetChanged(bool had_target);
|
| @@ -302,6 +309,24 @@ 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
|
| + // VirtualAudioOutputStream.
|
| + return new media::LoopbackSink(params, mixer_stream_.get(),
|
| + base::Bind(&Impl::ReleasePushInput, this));
|
| +}
|
| +
|
| +void WebContentsAudioInputStream::Impl::ReleasePushInput(
|
| + media::LoopbackSink* stream) {
|
| + delete stream;
|
| +}
|
| +
|
| +bool WebContentsAudioInputStream::Impl::IsDuplication() {
|
| + return true;
|
| +}
|
| +
|
| void WebContentsAudioInputStream::Impl::OnTargetChanged(bool had_target) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
|
|