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

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

Issue 264363005: Cast: deliver video frames on the IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ThreadCheckerImpl Created 6 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
« no previous file with comments | « chrome/renderer/media/cast_rtp_stream.cc ('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
index 48a37199b5542be144b1c26de0a1c103180548c7..663f3a86f072d4ca2907877ae60ef9949dda47e6 100644
--- a/content/public/renderer/media_stream_video_sink.h
+++ b/content/public/renderer/media_stream_video_sink.h
@@ -5,12 +5,14 @@
#ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
#define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
+#include "base/callback.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 VideoCaptureFormat;
class VideoFrame;
}
@@ -20,6 +22,11 @@ class WebMediaStreamTrack;
namespace content {
+typedef base::Callback<
+ void(const scoped_refptr<media::VideoFrame>&,
+ const media::VideoCaptureFormat&)>
+ VideoSinkDeliverFrameCB;
+
// 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
@@ -29,14 +36,19 @@ class CONTENT_EXPORT MediaStreamVideoSink : public MediaStreamSink {
// 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.
+ // Note that |callback| for frame delivery happens on the IO thread.
+ //
+ // Calling RemoveFromVideoTrack also not stop frame delivery through the
+ // callback immediately because it may happen on another thread.
+ // The added callback will be reset on the render thread.
static void AddToVideoTrack(MediaStreamVideoSink* sink,
+ const VideoSinkDeliverFrameCB& callback,
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() {}
};
« no previous file with comments | « chrome/renderer/media/cast_rtp_stream.cc ('k') | content/public/renderer/media_stream_video_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698