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

Side by Side Diff: content/renderer/media/media_stream_video_source.cc

Issue 131763002: Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added MediaStreamAudioSource. 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/media_stream_video_source.h" 5 #include "content/renderer/media/media_stream_video_source.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/renderer/media_stream_video_sink.h" 8 #include "content/public/renderer/media_stream_video_sink.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 MediaStreamVideoSource::MediaStreamVideoSource(
13 MediaStreamDependencyFactory* factory)
14 : factory_(factory) {
15 }
16
17 MediaStreamVideoSource::~MediaStreamVideoSource() {
18 }
19
12 void MediaStreamVideoSource::AddTrack( 20 void MediaStreamVideoSource::AddTrack(
13 const blink::WebMediaStreamTrack& track, 21 const blink::WebMediaStreamTrack& track) {
14 const blink::WebMediaConstraints& constraints) { 22 // TODO(perkj): Use the MediaStreamDependencyFactory for now to create the
15 // TODO(ronghuawu): Put |track| in the registered tracks list. Will later 23 // MediaStreamVideoTrack since creation is currently still depending on
16 // deliver frames to it according to |constraints|. 24 // libjingle. The webrtc video track implementation will attach to the
25 // webrtc::VideoSourceInterface returned by GetAdapter() to receive video
26 // frames.
27 factory_->CreateNativeMediaStreamTrack(track);
17 } 28 }
18 29
19 void MediaStreamVideoSource::RemoveTrack( 30 void MediaStreamVideoSource::RemoveTrack(
20 const blink::WebMediaStreamTrack& track) { 31 const blink::WebMediaStreamTrack& track) {
21 // TODO(ronghuawu): Remove |track| from the list, i.e. will stop delivering 32 // TODO(ronghuawu): Remove |track| from the list, i.e. will stop delivering
22 // frame to |track|. 33 // frame to |track|.
23 } 34 }
24 35
25 void MediaStreamVideoSource::SetReadyState( 36 void MediaStreamVideoSource::SetReadyState(
26 blink::WebMediaStreamSource::ReadyState state) { 37 blink::WebMediaStreamSource::ReadyState state) {
27 // TODO(ronghuawu): Sets WebMediaStreamSource's ready state and notifies the 38 // TODO(ronghuawu): Sets WebMediaStreamSource's ready state and notifies the
28 // ready state to all registered tracks. 39 // ready state to all registered tracks.
29 } 40 }
30 41
31 void MediaStreamVideoSource::DeliverVideoFrame( 42 void MediaStreamVideoSource::DeliverVideoFrame(
32 const scoped_refptr<media::VideoFrame>& frame) { 43 const scoped_refptr<media::VideoFrame>& frame) {
33 // TODO(ronghuawu): Deliver |frame| to all the registered tracks. 44 // TODO(ronghuawu): Deliver |frame| to all the registered tracks.
34 } 45 }
35 46
36 MediaStreamVideoSource::~MediaStreamVideoSource() { 47 void MediaStreamVideoSource::SetAdapter(
48 const scoped_refptr<webrtc::VideoSourceInterface>& adapter) {
49 DCHECK(!adapter_);
50 adapter_ = adapter;
37 } 51 }
38 52
39 } // namespace content 53 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698