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

Unified Diff: content/public/renderer/media_stream_video_sink.cc

Issue 83023005: Add VideoTrackSink interface to content/public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added OWNERS file and addressed comments. Created 7 years, 1 month 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/public/renderer/media_stream_video_sink.cc
diff --git a/content/public/renderer/media_stream_video_sink.cc b/content/public/renderer/media_stream_video_sink.cc
new file mode 100644
index 0000000000000000000000000000000000000000..912078ec721bca3c8c603b7f1773e3aa41c61a5d
--- /dev/null
+++ b/content/public/renderer/media_stream_video_sink.cc
@@ -0,0 +1,29 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/renderer/media_stream_video_sink.h"
+
+#include "base/logging.h"
+#include "content/renderer/media/media_stream_video_track.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+
+namespace content {
+
+void AddToVideoTrack(MediaStreamVideoSink* sink,
+ const blink::WebMediaStreamTrack& track) {
+ DCHECK_EQ(blink::WebMediaStreamSource::TypeVideo, track.source().type());
+ MediaStreamVideoTrack* video_track =
+ static_cast<MediaStreamVideoTrack*>(track.extraData());
+ video_track->AddSink(sink);
Alpha Left Google 2013/12/02 17:44:37 track.isNull() can be true and track.extraData() c
perkj_chrome 2013/12/03 16:14:17 I would argue that it is a programming error if tr
+}
+
+void RemoveFromVideoTrack(MediaStreamVideoSink* sink,
+ const blink::WebMediaStreamTrack& track) {
+ DCHECK_EQ(blink::WebMediaStreamSource::TypeVideo, track.source().type());
+ MediaStreamVideoTrack* video_track =
+ static_cast<MediaStreamVideoTrack*>(track.extraData());
+ video_track->RemoveSink(sink);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698