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

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

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/webrtc_media_stream_adapter.h
diff --git a/content/renderer/media/webrtc/webrtc_media_stream_adapter.h b/content/renderer/media/webrtc/webrtc_media_stream_adapter.h
index c40525502422f108aa40c5c261759a395f9d1b80..77c5dbd2c0ebec1d859507ffcb21287ec1c33863 100644
--- a/content/renderer/media/webrtc/webrtc_media_stream_adapter.h
+++ b/content/renderer/media/webrtc/webrtc_media_stream_adapter.h
@@ -5,9 +5,11 @@
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_
+#include <memory>
+#include <vector>
+
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_vector.h"
#include "content/common/content_export.h"
#include "content/renderer/media/media_stream.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"
@@ -17,6 +19,7 @@ namespace content {
class PeerConnectionDependencyFactory;
class MediaStreamVideoWebRtcSink;
+class WebRtcAudioSink;
// WebRtcMediaStreamAdapter is an adapter between a blink::WebMediaStream
// object and a webrtc MediaStreams that is currently sent on a PeerConnection.
@@ -33,11 +36,11 @@ class CONTENT_EXPORT WebRtcMediaStreamAdapter
PeerConnectionDependencyFactory* factory);
~WebRtcMediaStreamAdapter() override;
- bool IsEqual(const blink::WebMediaStream& web_stream) {
+ bool IsEqual(const blink::WebMediaStream& web_stream) const {
return web_stream_.getExtraData() == web_stream.getExtraData();
}
- webrtc::MediaStreamInterface* webrtc_media_stream() {
+ webrtc::MediaStreamInterface* webrtc_media_stream() const {
return webrtc_media_stream_.get();
}
@@ -47,8 +50,8 @@ class CONTENT_EXPORT WebRtcMediaStreamAdapter
void TrackRemoved(const blink::WebMediaStreamTrack& track) override;
private:
- void CreateAudioTrack(const blink::WebMediaStreamTrack& track);
- void CreateVideoTrack(const blink::WebMediaStreamTrack& track);
+ void AddAudioSinkToTrack(const blink::WebMediaStreamTrack& track);
+ void AddVideoSinkToTrack(const blink::WebMediaStreamTrack& track);
const blink::WebMediaStream web_stream_;
@@ -57,7 +60,8 @@ class CONTENT_EXPORT WebRtcMediaStreamAdapter
PeerConnectionDependencyFactory* const factory_;
scoped_refptr<webrtc::MediaStreamInterface> webrtc_media_stream_;
- ScopedVector<MediaStreamVideoWebRtcSink> video_adapters_;
+ std::vector<std::unique_ptr<WebRtcAudioSink>> audio_sinks_;
+ std::vector<std::unique_ptr<MediaStreamVideoWebRtcSink>> video_sinks_;
DISALLOW_COPY_AND_ASSIGN (WebRtcMediaStreamAdapter);
};

Powered by Google App Engine
This is Rietveld 408576698