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

Unified Diff: content/renderer/media/remote_media_stream_impl.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: Reworked unit tests around structural changes, and added exhaustive media_stream_audio_unittest.cc. Created 4 years, 8 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/remote_media_stream_impl.cc
diff --git a/content/renderer/media/remote_media_stream_impl.cc b/content/renderer/media/remote_media_stream_impl.cc
index 35a3cb492800cc0c7d1e275fe81c658e946c410b..cad1b01bce04210799577405e18664feca29ecf8 100644
--- a/content/renderer/media/remote_media_stream_impl.cc
+++ b/content/renderer/media/remote_media_stream_impl.cc
@@ -18,9 +18,9 @@
#include "content/renderer/media/media_stream.h"
#include "content/renderer/media/media_stream_track.h"
#include "content/renderer/media/media_stream_video_track.h"
-#include "content/renderer/media/webrtc/media_stream_remote_audio_track.h"
#include "content/renderer/media/webrtc/media_stream_remote_video_source.h"
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
+#include "content/renderer/media/webrtc/peer_connection_remote_audio_source.h"
#include "content/renderer/media/webrtc/track_observer.h"
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
@@ -239,11 +239,10 @@ void RemoteAudioTrackAdapter::Unregister() {
void RemoteAudioTrackAdapter::InitializeWebkitAudioTrack() {
InitializeWebkitTrack(blink::WebMediaStreamSource::TypeAudio);
- webkit_track()->source().setExtraData(
- new MediaStreamRemoteAudioSource(observed_track().get()));
- webkit_track()->setExtraData(
- new MediaStreamRemoteAudioTrack(
- webkit_track()->source(), webkit_track()->isEnabled()));
+ MediaStreamAudioSource* const source =
+ new PeerConnectionRemoteAudioSource(observed_track().get());
+ webkit_track()->source().setExtraData(source); // Takes ownership.
+ source->ConnectToTrack(*(webkit_track()));
}
void RemoteAudioTrackAdapter::OnChanged() {

Powered by Google App Engine
This is Rietveld 408576698