OLD | NEW |
---|---|
(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 | |
OLD | NEW |