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

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

Issue 83023005: Add VideoTrackSink interface to content/public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge error Created 7 years 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/public/renderer/media_stream_sink.h ('k') | content/public/renderer/media_stream_video_sink.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/media_stream_video_sink.h
diff --git a/content/public/renderer/media_stream_video_sink.h b/content/public/renderer/media_stream_video_sink.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5b37da5c3fe9d2eacb419aa27f82fcfb4b2d8af
--- /dev/null
+++ b/content/public/renderer/media_stream_video_sink.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
+#define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "content/public/renderer/media_stream_sink.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace blink {
+class WebMediaStreamTrack;
+}
+
+namespace content {
+
+// MediaStreamVideoSink is an interface used for receiving video frames from a
+// Video Stream Track or a Video Source.
+// http://dev.w3.org/2011/webrtc/editor/getusermedia.html
+// All methods calls will be done from the main render thread.
+class MediaStreamVideoSink : public MediaStreamSink {
+ public:
+ // An implementation of MediaStreamVideoSink should call AddToVideoTrack when
+ // it is ready to receive data from a video track. Before the implementation
+ // is destroyed, RemoveFromVideoTrack must be called.
+ // Calls to these methods must be done on the main render thread.
+ static void AddToVideoTrack(MediaStreamVideoSink* sink,
+ const blink::WebMediaStreamTrack& track);
+ static void RemoveFromVideoTrack(MediaStreamVideoSink* sink,
+ const blink::WebMediaStreamTrack& track);
+
+ virtual void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame) = 0;
+
+ protected:
+ virtual ~MediaStreamVideoSink() {}
+};
+
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
« no previous file with comments | « content/public/renderer/media_stream_sink.h ('k') | content/public/renderer/media_stream_video_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698