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..d60a8c3ebdb41f0cdec71a4763d91c81e62eb73a |
--- /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 CONTENT_EXPORT MediaStreamVideoSink : public MediaStreamSink { |
jam
2013/12/03 00:48:20
nit: export not needed
perkj_chrome
2013/12/03 16:14:17
Done.
|
+ public: |
+ virtual void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame) = 0; |
+ |
+ protected: |
+ virtual ~MediaStreamVideoSink() {} |
+}; |
+ |
+// 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. |
+CONTENT_EXPORT void AddToVideoTrack(MediaStreamVideoSink* sink, |
+ const blink::WebMediaStreamTrack& track); |
+CONTENT_EXPORT void RemoveFromVideoTrack( |
jam
2013/12/03 00:48:20
please move these two methods to be inside MediaSt
perkj_chrome
2013/12/03 16:14:17
Done.
|
+ MediaStreamVideoSink* sink, |
+ const blink::WebMediaStreamTrack& track); |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_ |