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

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

Issue 1820083005: Remove platform/NotImplemented.*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/mediacapturefromelement/HTMLMediaElementCapture.h" 5 #include "modules/mediacapturefromelement/HTMLMediaElementCapture.h"
6 6
7 #include "core/dom/ExceptionCode.h" 7 #include "core/dom/ExceptionCode.h"
8 #include "core/html/HTMLMediaElement.h" 8 #include "core/html/HTMLMediaElement.h"
9 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" 9 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
10 #include "modules/encryptedmedia/MediaKeys.h" 10 #include "modules/encryptedmedia/MediaKeys.h"
11 #include "modules/mediastream/MediaStream.h" 11 #include "modules/mediastream/MediaStream.h"
12 #include "modules/mediastream/MediaStreamRegistry.h" 12 #include "modules/mediastream/MediaStreamRegistry.h"
13 #include "platform/NotImplemented.h"
14 #include "platform/mediastream/MediaStreamCenter.h" 13 #include "platform/mediastream/MediaStreamCenter.h"
15 #include "public/platform/Platform.h" 14 #include "public/platform/Platform.h"
16 #include "public/platform/WebMediaStream.h" 15 #include "public/platform/WebMediaStream.h"
17 #include "public/platform/WebMediaStreamTrack.h" 16 #include "public/platform/WebMediaStreamTrack.h"
18 17
19 namespace blink { 18 namespace blink {
20 19
21 // static 20 // static
22 MediaStream* HTMLMediaElementCapture::captureStream(HTMLMediaElement& element, E xceptionState& exceptionState) 21 MediaStream* HTMLMediaElementCapture::captureStream(HTMLMediaElement& element, E xceptionState& exceptionState)
23 { 22 {
24 if (element.currentSrc().isNull()) { 23 if (element.currentSrc().isNull()) {
25 exceptionState.throwDOMException(NotSupportedError, "The media element m ust have a source."); 24 exceptionState.throwDOMException(NotSupportedError, "The media element m ust have a source.");
26 return nullptr; 25 return nullptr;
27 } 26 }
28 27
29 // Avoid capturing from EME-protected Media Elements. 28 // Avoid capturing from EME-protected Media Elements.
30 if (HTMLMediaElementEncryptedMedia::mediaKeys(element)) { 29 if (HTMLMediaElementEncryptedMedia::mediaKeys(element)) {
31 // This exception is not defined in the spec, see https://github.com/w3c /mediacapture-fromelement/issues/20. 30 // This exception is not defined in the spec, see https://github.com/w3c /mediacapture-fromelement/issues/20.
32 exceptionState.throwDOMException(NotSupportedError, "Stream capture not supported with EME"); 31 exceptionState.throwDOMException(NotSupportedError, "Stream capture not supported with EME");
33 return nullptr; 32 return nullptr;
34 } 33 }
35 34
36 // If |element| is actually playing a MediaStream, just clone it. 35 // If |element| is actually playing a MediaStream, just clone it.
37 if (HTMLMediaElement::isMediaStreamURL(element.currentSrc().getString())) { 36 if (HTMLMediaElement::isMediaStreamURL(element.currentSrc().getString())) {
38 return MediaStream::create(element.getExecutionContext(), MediaStreamReg istry::registry().lookupMediaStreamDescriptor(element.currentSrc().getString())) ; 37 return MediaStream::create(element.getExecutionContext(), MediaStreamReg istry::registry().lookupMediaStreamDescriptor(element.currentSrc().getString())) ;
39 } 38 }
40 39
41 // TODO(mcasas): Only <video> tags are supported at the moment. 40 // TODO(mcasas): Only <video> tags are supported at the moment.
42 if (element.isHTMLAudioElement()) { 41 if (element.isHTMLAudioElement()) {
43 notImplemented(); 42 NOTIMPLEMENTED();
44 return nullptr; 43 return nullptr;
45 } 44 }
46 45
47 WebMediaStream webStream; 46 WebMediaStream webStream;
48 webStream.initialize(WebVector<WebMediaStreamTrack>(), WebVector<WebMediaStr eamTrack>()); 47 webStream.initialize(WebVector<WebMediaStreamTrack>(), WebVector<WebMediaStr eamTrack>());
49 MediaStreamCenter::instance().didCreateMediaStream(webStream); 48 MediaStreamCenter::instance().didCreateMediaStream(webStream);
50 49
51 Platform::current()->createHTMLVideoElementCapturer(&webStream, element.webM ediaPlayer()); 50 Platform::current()->createHTMLVideoElementCapturer(&webStream, element.webM ediaPlayer());
52 return MediaStream::create(element.getExecutionContext(), webStream); 51 return MediaStream::create(element.getExecutionContext(), webStream);
53 } 52 }
54 53
55 } // namespace blink 54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698