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

Side by Side Diff: third_party/WebKit/Source/modules/mediacapturefromelement/HTMLCanvasElementCapture.cpp

Issue 1467103003: Basic use implementation for MediaStream from Canvas: captureStream() (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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "modules/mediacapturefromelement/HTMLCanvasElementCapture.h"
7
8 #include "core/html/HTMLCanvasElement.h"
9 #include "modules/mediacapturefromelement/CanvasCaptureMediaStream.h"
10 #include "platform/Logging.h"
11 #include "platform/NotImplemented.h"
12 #include "platform/mediastream/MediaStreamCenter.h"
13 #include "public/platform/Platform.h"
14 #include "public/platform/WebCanvasCaptureHandler.h"
15 #include "public/platform/WebMediaStream.h"
16 #include "public/platform/WebMediaStreamSource.h"
17 #include "public/platform/WebMediaStreamTrack.h"
18
19 namespace blink {
20
21 CanvasCaptureMediaStream* HTMLCanvasElementCapture::captureStream(HTMLCanvasElem ent& element)
peria 2015/11/24 05:50:22 Please do not use non-const reference.
emircan 2015/11/24 22:16:51 Same as the answer above.
22 {
23 // TODO(emircan): Check for origin-clean here and possibly throw an error. S ee crbug.com/544359.
24
25 WebMediaStream stream;
26 stream.initialize(WebVector<WebMediaStreamTrack>(), Vector<WebMediaStreamTra ck>());
27 WebSize size(element.width(), element.height());
28
29 OwnPtr<WebCanvasCaptureHandler> handler = adoptPtr(Platform::current()->crea teCanvasCaptureHandler(size, &stream));
30 return CanvasCaptureMediaStream::create(stream, element, handler.release());
31 }
32
33 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698