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

Unified Diff: content/public/renderer/media_stream_api.cc

Issue 1505013002: Create CanvasCaptureMediaStreamTrack in a regular MediaStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « content/public/renderer/media_stream_api.h ('k') | content/renderer/media/canvas_capture_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/media_stream_api.cc
diff --git a/content/public/renderer/media_stream_api.cc b/content/public/renderer/media_stream_api.cc
index 5908c99690751894b0663c07b039da1a3a4fb26b..2c2cea3de4b8ec8ea9195e5fb4a523a6d0b9639c 100644
--- a/content/public/renderer/media_stream_api.cc
+++ b/content/public/renderer/media_stream_api.cc
@@ -14,6 +14,7 @@
#include "content/renderer/render_thread_impl.h"
#include "third_party/WebKit/public/platform/WebMediaStream.h"
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/web/WebMediaStreamRegistry.h"
#include "url/gurl.h"
@@ -129,4 +130,27 @@ bool AddAudioTrackToMediaStream(
return true;
}
+bool AddVideoCapturerSourceToVideoTrack(
perkj_chrome 2015/12/08 09:05:06 This feel like a special case where we create a so
emircan 2015/12/08 19:28:01 Done.
+ scoped_ptr<media::VideoCapturerSource> source,
+ bool is_remote,
+ bool is_readonly,
+ blink::WebMediaStreamTrack* web_track) {
+ const blink::WebString track_id = MakeTrackId();
+ blink::WebMediaStreamSource webkit_source;
perkj_chrome 2015/12/08 09:05:06 please don't call anything webkit. Maybe just web_
emircan 2015/12/08 19:28:01 Done. I was following the naming used in Add*Track
+ scoped_ptr<MediaStreamVideoSource> media_stream_source(
+ new MediaStreamVideoCapturerSource(
+ MediaStreamSource::SourceStoppedCallback(), source.Pass()));
+ webkit_source.initialize(track_id, blink::WebMediaStreamSource::TypeVideo,
+ track_id, is_remote, is_readonly);
+ webkit_source.setExtraData(media_stream_source.get());
+
+ web_track->initialize(webkit_source);
+ blink::WebMediaConstraints constraints;
+ constraints.initialize();
+ web_track->setExtraData(new MediaStreamVideoTrack(
+ media_stream_source.release(), constraints,
+ MediaStreamVideoSource::ConstraintsCallback(), true));
+ return true;
+}
+
} // namespace content
« no previous file with comments | « content/public/renderer/media_stream_api.h ('k') | content/renderer/media/canvas_capture_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698