Enable right clicking on the applist doodle web contents and log the data.
[chromium-blink-merge.git] / content / renderer / media / webrtc / media_stream_remote_video_source.h
blob5a42b8fc256b7009f43fd41d8a64c8c5084542c3
1 // Copyright 2014 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_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_VIDEO_SOURCE_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_VIDEO_SOURCE_H_
8 #include "base/memory/weak_ptr.h"
9 #include "base/single_thread_task_runner.h"
10 #include "content/common/content_export.h"
11 #include "content/renderer/media/media_stream_video_source.h"
12 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
13 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
15 namespace content {
17 class TrackObserver;
19 // MediaStreamRemoteVideoSource implements the MediaStreamVideoSource interface
20 // for video tracks received on a PeerConnection. The purpose of the class is
21 // to make sure there is no difference between a video track where the source is
22 // a local source and a video track where the source is a remote video track.
23 class CONTENT_EXPORT MediaStreamRemoteVideoSource
24 : public MediaStreamVideoSource {
25 public:
26 MediaStreamRemoteVideoSource(scoped_ptr<TrackObserver> observer);
27 virtual ~MediaStreamRemoteVideoSource();
29 protected:
30 // Implements MediaStreamVideoSource.
31 void GetCurrentSupportedFormats(
32 int max_requested_width,
33 int max_requested_height,
34 double max_requested_frame_rate,
35 const VideoCaptureDeviceFormatsCB& callback) override;
37 void StartSourceImpl(
38 const media::VideoCaptureFormat& format,
39 const VideoCaptureDeliverFrameCB& frame_callback) override;
41 void StopSourceImpl() override;
43 // Used by tests to test that a frame can be received and that the
44 // MediaStreamRemoteVideoSource behaves as expected.
45 webrtc::VideoRendererInterface* RenderInterfaceForTest();
47 private:
48 void OnChanged(webrtc::MediaStreamTrackInterface::TrackState state);
50 // Internal class used for receiving frames from the webrtc track on a
51 // libjingle thread and forward it to the IO-thread.
52 class RemoteVideoSourceDelegate;
53 scoped_refptr<RemoteVideoSourceDelegate> delegate_;
54 scoped_ptr<TrackObserver> observer_;
56 DISALLOW_COPY_AND_ASSIGN(MediaStreamRemoteVideoSource);
59 } // namespace content
61 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_VIDEO_SOURCE_H_