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

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

Issue 1834323002: MediaStream audio: Refactor 3 separate "glue" implementations into one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE + Workaround to ensure MediaStreamAudioProcessor is destroyed on the main thread. 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
Index: content/renderer/media/webrtc_audio_renderer.cc
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc
index e875b7337739376282eb40bc09ec3ef97531fdcd..604ed959a0def7f32ccb943c1b397f595b71f1e9 100644
--- a/content/renderer/media/webrtc_audio_renderer.cc
+++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -6,6 +6,9 @@
#include <utility>
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/location.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
@@ -13,11 +16,8 @@
#include "build/build_config.h"
#include "content/renderer/media/audio_device_factory.h"
#include "content/renderer/media/media_stream_audio_track.h"
-#include "content/renderer/media/media_stream_dispatcher.h"
-#include "content/renderer/media/media_stream_track.h"
-#include "content/renderer/media/webrtc_audio_device_impl.h"
+#include "content/renderer/media/webrtc/peer_connection_remote_audio_source.h"
#include "content/renderer/media/webrtc_logging.h"
-#include "content/renderer/render_frame_impl.h"
#include "media/audio/sample_rates.h"
#include "media/base/audio_capturer_source.h"
#include "media/base/audio_parameters.h"
@@ -595,14 +595,16 @@ void WebRtcAudioRenderer::OnPlayStateChanged(
media_stream.audioTracks(web_tracks);
for (const blink::WebMediaStreamTrack& web_track : web_tracks) {
- MediaStreamAudioTrack* track = MediaStreamAudioTrack::From(web_track);
// WebRtcAudioRenderer can only render audio tracks received from a remote
// peer. Since the actual MediaStream is mutable from JavaScript, we need
// to make sure |web_track| is actually a remote track.
- if (track->is_local_track())
+ PeerConnectionRemoteAudioTrack* const remote_track =
+ PeerConnectionRemoteAudioTrack::From(
+ MediaStreamAudioTrack::From(web_track));
+ if (!remote_track)
continue;
webrtc::AudioSourceInterface* source =
- track->GetAudioAdapter()->GetSource();
+ remote_track->track_interface()->GetSource();
DCHECK(source);
if (!state->playing()) {
if (RemovePlayingState(source, state))
« no previous file with comments | « content/renderer/media/webrtc_audio_renderer.h ('k') | content/renderer/media/webrtc_audio_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698