linux_aura: Disable the plugin install infobar.
[chromium-blink-merge.git] / content / public / renderer / media_stream_video_sink.h
blob663f3a86f072d4ca2907877ae60ef9949dda47e6
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "content/common/content_export.h"
12 #include "content/public/renderer/media_stream_sink.h"
14 namespace media {
15 class VideoCaptureFormat;
16 class VideoFrame;
19 namespace blink {
20 class WebMediaStreamTrack;
23 namespace content {
25 typedef base::Callback<
26 void(const scoped_refptr<media::VideoFrame>&,
27 const media::VideoCaptureFormat&)>
28 VideoSinkDeliverFrameCB;
30 // MediaStreamVideoSink is an interface used for receiving video frames from a
31 // Video Stream Track or a Video Source.
32 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html
33 // All methods calls will be done from the main render thread.
34 class CONTENT_EXPORT MediaStreamVideoSink : public MediaStreamSink {
35 public:
36 // An implementation of MediaStreamVideoSink should call AddToVideoTrack when
37 // it is ready to receive data from a video track. Before the implementation
38 // is destroyed, RemoveFromVideoTrack must be called.
40 // Calls to these methods must be done on the main render thread.
41 // Note that |callback| for frame delivery happens on the IO thread.
43 // Calling RemoveFromVideoTrack also not stop frame delivery through the
44 // callback immediately because it may happen on another thread.
45 // The added callback will be reset on the render thread.
46 static void AddToVideoTrack(MediaStreamVideoSink* sink,
47 const VideoSinkDeliverFrameCB& callback,
48 const blink::WebMediaStreamTrack& track);
49 static void RemoveFromVideoTrack(MediaStreamVideoSink* sink,
50 const blink::WebMediaStreamTrack& track);
52 protected:
53 virtual ~MediaStreamVideoSink() {}
57 } // namespace content
59 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_VIDEO_SINK_H_