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

Unified Diff: content/renderer/media/webrtc/webrtc_media_stream_adapter.cc

Issue 1995553002: Remove WebRtc audio source references for local audio tracks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert unintentional change 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 | « content/renderer/media/webrtc/processed_local_audio_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/webrtc_media_stream_adapter.cc
diff --git a/content/renderer/media/webrtc/webrtc_media_stream_adapter.cc b/content/renderer/media/webrtc/webrtc_media_stream_adapter.cc
index 7708b50ccff296332a857b6cf8729cdb11cc9d13..b5ecec76e94d82b45f7011f002a812198c9331c2 100644
--- a/content/renderer/media/webrtc/webrtc_media_stream_adapter.cc
+++ b/content/renderer/media/webrtc/webrtc_media_stream_adapter.cc
@@ -108,12 +108,16 @@ void WebRtcMediaStreamAdapter::AddAudioSinkToTrack(
return;
}
- WebRtcAudioSink* audio_sink;
+ // Non-WebRtc remote sources and local sources do not provide an instance of
+ // the webrtc::AudioSourceInterface, and also do not need references to the
+ // audio level calculator or audio processor passed to the sink.
+ webrtc::AudioSourceInterface* source_interface = nullptr;
+ WebRtcAudioSink* audio_sink = new WebRtcAudioSink(
+ track.id().utf8(), source_interface,
+ factory_->GetWebRtcSignalingThread());
+
if (auto* media_stream_source = ProcessedLocalAudioSource::From(
MediaStreamAudioSource::From(track.source()))) {
- audio_sink = new WebRtcAudioSink(
- track.id().utf8(), media_stream_source->rtc_source(),
- factory_->GetWebRtcSignalingThread());
audio_sink->SetLevel(media_stream_source->audio_level());
// The sink only grabs stats from the audio processor. Stats are only
// available if audio processing is turned on. Therefore, only provide the
@@ -122,15 +126,6 @@ void WebRtcMediaStreamAdapter::AddAudioSinkToTrack(
if (processor && processor->has_audio_processing())
audio_sink->SetAudioProcessor(processor);
}
- } else {
- // Remote sources and other non-WebRtc local sources do not provide an
- // instance of the webrtc::AudioSourceInterface, and also do not need
- // references to the audio level calculator or audio processor passed to the
- // sink.
- webrtc::AudioSourceInterface* source_interface = nullptr;
- audio_sink = new WebRtcAudioSink(
- track.id().utf8(), source_interface,
- factory_->GetWebRtcSignalingThread());
}
audio_sinks_.push_back(std::unique_ptr<WebRtcAudioSink>(audio_sink));
« no previous file with comments | « content/renderer/media/webrtc/processed_local_audio_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698