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

Unified Diff: content/renderer/media/media_stream_video_capturer_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_capturer_source.cc
diff --git a/content/renderer/media/media_stream_video_capturer_source.cc b/content/renderer/media/media_stream_video_capturer_source.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4e736a85b2ad89781b7d9f4627203e5176d16e35
--- /dev/null
+++ b/content/renderer/media/media_stream_video_capturer_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_capturer_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 {
+
+MediaStreamVideoCapturerSource::MediaStreamVideoCapturerSource(
+ const StreamDeviceInfo& device_info,
+ const SourceStoppedCallback& stop_callback,
+ MediaStreamDependencyFactory* factory)
+ : MediaStreamVideoSource(factory) {
+ SetDeviceInfo(device_info);
+ SetStopCallback(stop_callback);
+}
+
+MediaStreamVideoCapturerSource::~MediaStreamVideoCapturerSource() {
+}
+
+void MediaStreamVideoCapturerSource::InitAdapter(
+ 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));
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_video_capturer_source.h ('k') | content/renderer/media/media_stream_video_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698