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..17d0cba8d5bd4e9c8563ba9a1e2dc15677d886bc |
| --- /dev/null |
| +++ b/content/renderer/media/media_stream_video_capture_device_source.cc |
| @@ -0,0 +1,44 @@ |
| +// 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_video_capturer.h" |
| + |
| +namespace content { |
| + |
| +MediaStreamVideoCaptureDeviceSource::MediaStreamVideoCaptureDeviceSource( |
| + const StreamDeviceInfo& device_info, |
| + const SourceStopCallback& stop_callback) { |
| + SetDeviceInfo(device_info); |
| + SetStopCallback(stop_callback); |
| +} |
| + |
| +MediaStreamVideoCaptureDeviceSource::~MediaStreamVideoCaptureDeviceSource() { |
| +} |
| + |
| +void MediaStreamVideoCaptureDeviceSource::Init( |
| + const blink::WebMediaConstraints& constraints, |
| + MediaStreamDependencyFactory* dependency_factory) { |
| + DCHECK(!GetAdapter()); |
| + cricket::VideoCapturer* capturer = |
| + 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
|
| + SetAdapter( |
| + dependency_factory->CreateLocalVideoSource(capturer, constraints)); |
| +} |
| + |
| +void MediaStreamVideoCaptureDeviceSource::ApplyConstraints( |
| + const blink::WebMediaStreamTrack& track, |
| + const blink::WebMediaConstraints& constraints, |
| + const ConstraintsCallback& callback) { |
| + |
| + // DO NOT SUBMIT. Need to check that the camera was started successfully. |
| + // Also - Check for mismatch if new constraints are set that don't match with |
| + // the initial constraints. |
| + callback.Run(this, true); |
| +} |
| + |
| +} // namespace content |