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

Side by Side Diff: content/renderer/media/webrtc/webrtc_video_source_adapter.h

Issue 129923002: Implements MediaStreamVideoSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_SOURCE_ADAPTER_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_SOURCE_ADAPTER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "content/common/content_export.h"
10 #include "content/renderer/media/webrtc/webrtc_video_source.h"
11 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
12 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
13 #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h"
14
15 namespace media {
16 class VideoFrame;
17 }
18
19 namespace content {
20
21 class MediaStreamDependencyFactory;
22
23 // WebRtcVideoSourceAdapter acts as the middle man between a
24 // webrtc:::VideoTrackInterface and a content::MediaStreamVideoSource.
25 // WebRtcVideoSourceAdapter creates native track for the given
26 // blink::WebMediaStreamTrack and expose an interface for MediaStreamVideoSource
27 // to feed video frames to the new native track.
28 class CONTENT_EXPORT WebRtcVideoSourceAdapter {
29 public:
30 WebRtcVideoSourceAdapter(const blink::WebMediaStreamTrack& track,
31 const blink::WebMediaConstraints& constraints,
32 MediaStreamDependencyFactory* factory);
33 virtual ~WebRtcVideoSourceAdapter();
34
35 bool Init();
36
37 void DeliverVideoFrame(const scoped_refptr<media::VideoFrame>& frame);
38
39 const blink::WebMediaStreamTrack& track() const { return track_; }
40 const blink::WebMediaConstraints& constraints() const { return constraints_; }
41
42 private:
43 blink::WebMediaStreamTrack track_;
44 blink::WebMediaConstraints constraints_;
45 MediaStreamDependencyFactory* factory_;
46 talk_base::scoped_refptr<WebRtcVideoSource> native_source_;
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_VIDEO_SINK_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698