Chromium Code Reviews| Index: content/renderer/media/media_stream_video_capture_device_source.cc |
| diff --git a/content/renderer/media/media_stream_video_capture_device_source.cc b/content/renderer/media/media_stream_video_capture_device_source.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..321178d1862f6d4f612ef8f751ac0c61c3071c28 |
| --- /dev/null |
| +++ b/content/renderer/media/media_stream_video_capture_device_source.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/renderer/media/media_stream_video_capture_device_source.h" |
| + |
| +#include "base/bind.h" |
| +#include "base/debug/trace_event.h" |
| +#include "content/renderer/media/rtc_media_constraints.h" |
| +#include "content/renderer/media/rtc_video_capturer.h" |
| + |
| +namespace content { |
| + |
| +MediaStreamVideoCaptureDeviceSource::MediaStreamVideoCaptureDeviceSource( |
| + const StreamDeviceInfo& device_info, |
| + const SourceStoppedCallback& stop_callback, |
| + MediaStreamDependencyFactory* factory) |
| + : MediaStreamVideoSource(factory) { |
| + SetDeviceInfo(device_info); |
| + SetStopCallback(stop_callback); |
| +} |
| + |
| +MediaStreamVideoCaptureDeviceSource::~MediaStreamVideoCaptureDeviceSource() { |
| +} |
| + |
| +void MediaStreamVideoCaptureDeviceSource::Init( |
| + const blink::WebMediaConstraints& constraints) { |
| + // Create the webrtc::VideoSource implementation. |
| + RTCMediaConstraints webrtc_constraints(constraints); |
| + cricket::VideoCapturer* capturer = |
| + factory()->CreateVideoCapturer(device_info()); |
| + SetAdapter(factory()->CreateVideoSource(capturer, |
| + &webrtc_constraints)); |
|
Ronghua Wu (Left Chromium)
2014/01/16 23:02:37
I think this should call the base class Init at th
perkj_chrome
2014/01/17 13:19:45
ptal - its the other way around. The base class ca
|
| +} |
| + |
| +} // namespace content |