 Chromium Code Reviews
 Chromium Code Reviews Issue 131763002:
  Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 131763002:
  Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| (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 #include "content/renderer/media/media_stream_video_capture_device_source.h" | |
| 6 | |
| 7 #include "base/bind.h" | |
| 8 #include "base/debug/trace_event.h" | |
| 9 #include "content/renderer/media/rtc_video_capturer.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 MediaStreamVideoCaptureDeviceSource::MediaStreamVideoCaptureDeviceSource( | |
| 14 const StreamDeviceInfo& device_info, | |
| 15 const SourceStopCallback& stop_callback) { | |
| 16 SetDeviceInfo(device_info); | |
| 17 SetStopCallback(stop_callback); | |
| 18 } | |
| 19 | |
| 20 MediaStreamVideoCaptureDeviceSource::~MediaStreamVideoCaptureDeviceSource() { | |
| 21 } | |
| 22 | |
| 23 void MediaStreamVideoCaptureDeviceSource::Init( | |
| 24 const blink::WebMediaConstraints& constraints, | |
| 25 MediaStreamDependencyFactory* dependency_factory) { | |
| 26 DCHECK(!GetAdapter()); | |
| 27 cricket::VideoCapturer* capturer = | |
| 28 dependency_factory->CreateVideoCapturer(device_info()); | |
| 
Ronghua Wu (Left Chromium)
2014/01/10 20:01:08
Instead of reusing the RtcVideoCapturer, I think w
 
perkj_chrome
2014/01/12 19:34:38
Yes - that is what I plan to do in the future. But
 | |
| 29 SetAdapter( | |
| 30 dependency_factory->CreateLocalVideoSource(capturer, constraints)); | |
| 31 } | |
| 32 | |
| 33 void MediaStreamVideoCaptureDeviceSource::ApplyConstraints( | |
| 34 const blink::WebMediaStreamTrack& track, | |
| 35 const blink::WebMediaConstraints& constraints, | |
| 36 const ConstraintsCallback& callback) { | |
| 37 | |
| 38 // DO NOT SUBMIT. Need to check that the camera was started successfully. | |
| 39 // Also - Check for mismatch if new constraints are set that don't match with | |
| 40 // the initial constraints. | |
| 41 callback.Run(this, true); | |
| 42 } | |
| 43 | |
| 44 } // namespace content | |
| OLD | NEW |