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

Unified Diff: content/renderer/media/media_stream_impl.cc

Issue 133903004: Cleaned up the WebRtcAudioCapturer a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Per's comments. Created 6 years, 11 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/renderer/media/media_stream_impl.cc
diff --git a/content/renderer/media/media_stream_impl.cc b/content/renderer/media/media_stream_impl.cc
index f659aaf9c93188385bbe257acea278284f1033cc..4a086bfc7bf19771c28862ffc0e67e7e4deb2e2c 100644
--- a/content/renderer/media/media_stream_impl.cc
+++ b/content/renderer/media/media_stream_impl.cc
@@ -730,6 +730,13 @@ void MediaStreamImpl::StopLocalSource(
if (source.type() == blink::WebMediaStreamSource::TypeAudio) {
if (extra_data->GetAudioCapturer()) {
extra_data->GetAudioCapturer()->Stop();
+
+ // Remove the capturer object from the WebRtcAudioDeviceImpl after it
+ // stops.
+ WebRtcAudioDeviceImpl* audio_device =
perkj_chrome 2014/01/14 08:42:40 What is the lifetime of audio_device? How about le
no longer working on chromium 2014/01/14 11:10:21 Sorry, I just forgot the save the change in this f
+ dependency_factory_->GetWebRtcAudioDevice();
+ if (audio_device)
+ audio_device->RemoveAudioCapturer(extra_data->GetAudioCapturer());
}
}
@@ -801,19 +808,13 @@ bool MediaStreamImpl::GetAuthorizedDeviceInfoForAudioRenderer(
int* output_sample_rate,
int* output_frames_per_buffer) {
DCHECK(CalledOnValidThread());
-
WebRtcAudioDeviceImpl* audio_device =
dependency_factory_->GetWebRtcAudioDevice();
if (!audio_device)
return false;
- if (!audio_device->GetDefaultCapturer())
- return false;
-
- return audio_device->GetDefaultCapturer()->GetPairedOutputParameters(
- session_id,
- output_sample_rate,
- output_frames_per_buffer);
+ return audio_device->GetAuthorizedDeviceInfoForAudioRenderer(
+ session_id, output_sample_rate, output_frames_per_buffer);
}
MediaStreamSourceExtraData::MediaStreamSourceExtraData(

Powered by Google App Engine
This is Rietveld 408576698