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

Unified Diff: content/renderer/media/media_stream_video_capture_device_source.cc

Issue 131763002: Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698