Permalink
Browse files

Drop LEGACY_ENCRYPTED_MEDIA_V1 code.

  • Loading branch information...
zdobersek committed Nov 20, 2017
1 parent 7fdac34 commit 09940acb645df712c583edfb666960a146e569f9
Showing with 100 additions and 985 deletions.
  1. +1 −4 Source/WebCore/CMakeLists.txt
  2. +1 −1 Source/WebCore/DerivedSources.cpp
  3. +1 −4 Source/WebCore/dom/Element.idl
  4. +0 −1 Source/WebCore/dom/EventNames.in
  5. +0 −157 Source/WebCore/html/HTMLMediaElement.cpp
  6. +0 −13 Source/WebCore/html/HTMLMediaElement.h
  7. +1 −5 Source/WebCore/html/HTMLMediaElement.idl
  8. +1 −1 Source/WebCore/html/MediaError.h
  9. +1 −1 Source/WebCore/html/MediaError.idl
  10. +0 −71 Source/WebCore/html/MediaKeyEvent.cpp
  11. +0 −89 Source/WebCore/html/MediaKeyEvent.h
  12. +0 −47 Source/WebCore/html/MediaKeyEvent.idl
  13. +1 −1 Source/WebCore/html/WebKitMediaKeyError.h
  14. +1 −1 Source/WebCore/html/WebKitMediaKeyError.idl
  15. +2 −2 Source/WebCore/page/RuntimeEnabledFeatures.h
  16. +1 −1 Source/WebCore/platform/GStreamer.cmake
  17. +2 −2 Source/WebCore/platform/graphics/CDMSession.h
  18. +0 −48 Source/WebCore/platform/graphics/MediaPlayer.cpp
  19. +1 −22 Source/WebCore/platform/graphics/MediaPlayer.h
  20. +0 −6 Source/WebCore/platform/graphics/MediaPlayerPrivate.h
  21. +2 −2 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
  22. +20 −417 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
  23. +6 −22 Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
  24. +2 −5 Source/WebCore/platform/graphics/gstreamer/eme/CDMPrivateOpenCDM.cpp
  25. +2 −6 Source/WebCore/platform/graphics/gstreamer/eme/CDMPrivateOpenCDM.h
  26. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/CDMSessionOpenCDM.cpp
  27. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/CDMSessionOpenCDM.h
  28. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp
  29. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
  30. +3 −3 Source/WebCore/platform/graphics/gstreamer/eme/PlayreadySession.cpp
  31. +3 −3 Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp
  32. +1 −1 Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h
  33. +1 −1 Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
  34. +1 −1 Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h
  35. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.cpp
  36. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMDecryptorGStreamer.h
  37. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMPlayReadyDecryptorGStreamer.cpp
  38. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMPlayReadyDecryptorGStreamer.h
  39. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMWidevineDecryptorGStreamer.cpp
  40. +2 −2 Source/WebCore/platform/graphics/gstreamer/eme/WebKitOpenCDMWidevineDecryptorGStreamer.h
  41. +1 −1 Source/WebCore/platform/graphics/gstreamer/eme/WebKitPlayReadyDecryptorGStreamer.cpp
  42. +1 −1 Source/WebCore/platform/graphics/gstreamer/eme/WebKitPlayReadyDecryptorGStreamer.h
  43. +11 −11 Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
  44. +5 −5 Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.h
  45. +4 −4 Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
  46. +1 −1 Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h
  47. +1 −1 Source/WebKit/WebProcess/WebPage/WebPage.cpp
  48. +1 −2 Source/cmake/OptionsWPE.cmake
  49. +0 −1 Source/cmake/WebKitFeatures.cmake
@@ -3246,7 +3246,7 @@ set(WebCore_LIBRARIES
PAL${DEBUG_SUFFIX}
)
if (ENABLE_LEGACY_ENCRYPTED_MEDIA_V1 OR ENABLE_LEGACY_ENCRYPTED_MEDIA)
if (ENABLE_LEGACY_ENCRYPTED_MEDIA)
list(APPEND WebCore_SOURCES
Modules/encryptedmedia/legacy/LegacyCDM.cpp
Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp
@@ -3257,8 +3257,6 @@ if (ENABLE_LEGACY_ENCRYPTED_MEDIA_V1 OR ENABLE_LEGACY_ENCRYPTED_MEDIA)
Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp
Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp
html/MediaKeyEvent.cpp
)
list(APPEND WebCoreTestSupport_SOURCES
testing/LegacyMockCDM.cpp
@@ -3270,7 +3268,6 @@ if (ENABLE_LEGACY_ENCRYPTED_MEDIA_V1 OR ENABLE_LEGACY_ENCRYPTED_MEDIA)
Modules/encryptedmedia/legacy/WebKitMediaKeys.idl
html/WebKitMediaKeyError.idl
html/MediaKeyEvent.idl
)
endif ()
@@ -614,7 +614,7 @@
#include "JSWebKitAnimationEvent.cpp"
#include "JSWebKitCSSMatrix.cpp"
#include "JSWebKitCSSViewportRule.cpp"
#if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
#include "JSWebKitMediaKeyError.cpp"
#include "JSWebKitMediaKeyMessageEvent.cpp"
#include "JSWebKitMediaKeyNeededEvent.cpp"
@@ -130,10 +130,7 @@
[NotEnumerable] attribute EventHandler onbeforeload;
// Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1634205-onwebkitneedkey).
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA_V1] attribute EventHandler onwebkitkeyadded;
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA_V1] attribute EventHandler onwebkitkeyerror;
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA_V1] attribute EventHandler onwebkitkeymessage;
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA_V1|LEGACY_ENCRYPTED_MEDIA] attribute EventHandler onwebkitneedkey;
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA] attribute EventHandler onwebkitneedkey;
// Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1633943-onwebkitpresentationmodechanged).
[NotEnumerable, Conditional=VIDEO_PRESENTATION_MODE] attribute EventHandler onwebkitpresentationmodechanged;
@@ -62,7 +62,6 @@ DeviceOrientationEvent conditional=DEVICE_ORIENTATION
OrientationEvent interfaceName=Event, conditional=ORIENTATION_EVENTS
WebKitMediaKeyMessageEvent conditional=LEGACY_ENCRYPTED_MEDIA
WebKitMediaKeyNeededEvent conditional=LEGACY_ENCRYPTED_MEDIA
MediaKeyEvent conditional=LEGACY_ENCRYPTED_MEDIA_V1
TrackEvent conditional=VIDEO_TRACK
SecurityPolicyViolationEvent
GestureEvent conditional=IOS_GESTURE_EVENTS|MAC_GESTURE_EVENTS
@@ -62,7 +62,6 @@
#include "MediaDocument.h"
#include "MediaError.h"
#include "MediaFragmentURIParser.h"
#include "MediaKeyEvent.h"
#include "MediaList.h"
#include "MediaPlayer.h"
#include "MediaQueryEvaluator.h"
@@ -278,23 +277,6 @@ static void removeElementFromDocumentMap(HTMLMediaElement& element, Document& do
map.add(&document, set);
}
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
static ExceptionOr<void> exceptionOrForMediaKeyException(MediaPlayer::MediaKeyException exception)
{
switch (exception) {
case MediaPlayer::NoError:
return { };
case MediaPlayer::InvalidPlayerState:
return Exception { InvalidStateError };
case MediaPlayer::KeySystemNotSupported:
return Exception { NotSupportedError };
}
ASSERT_NOT_REACHED();
return Exception { InvalidStateError };
}
#endif
#if ENABLE(VIDEO_TRACK)
class TrackDisplayUpdateScope {
@@ -1169,11 +1151,7 @@ String HTMLMediaElement::canPlayType(const String& mimeType, const String& keySy
ContentType contentType(mimeType);
parameters.type = contentType;
parameters.contentTypesRequiringHardwareSupport = mediaContentTypesRequiringHardwareSupport();
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
parameters.keySystem = keySystem;
#else
UNUSED_PARAM(keySystem);
#endif
MediaPlayer::SupportsType support = MediaPlayer::supportsType(parameters, this);
String canPlay;
@@ -2550,65 +2528,6 @@ void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
#endif
}
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
void HTMLMediaElement::mediaPlayerKeyAdded(MediaPlayer*, const String& keySystem, const String& sessionId)
{
Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeyaddedEvent, keySystem, sessionId, nullptr, nullptr, emptyString(), nullptr, 0);
event->setTarget(this);
m_asyncEventQueue.enqueueEvent(WTFMove(event));
}
void HTMLMediaElement::mediaPlayerKeyError(MediaPlayer*, const String& keySystem, const String& sessionId, MediaPlayerClient::MediaKeyErrorCode errorCode, unsigned short systemCode)
{
WebKitMediaKeyError::Code mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
switch (errorCode) {
case MediaPlayerClient::UnknownError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_UNKNOWN;
break;
case MediaPlayerClient::ClientError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_CLIENT;
break;
case MediaPlayerClient::ServiceError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_SERVICE;
break;
case MediaPlayerClient::OutputError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_OUTPUT;
break;
case MediaPlayerClient::HardwareChangeError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_HARDWARECHANGE;
break;
case MediaPlayerClient::DomainError:
mediaKeyErrorCode = WebKitMediaKeyError::MEDIA_KEYERR_DOMAIN;
break;
}
Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeyerrorEvent, keySystem, sessionId, nullptr, nullptr, emptyString(), WebKitMediaKeyError::create(mediaKeyErrorCode), systemCode);
event->setTarget(this);
m_asyncEventQueue.enqueueEvent(WTFMove(event));
}
void HTMLMediaElement::mediaPlayerKeyMessage(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const URL& defaultURL)
{
Ref<Event> event = MediaKeyEvent::create(eventNames().webkitkeymessageEvent, keySystem, sessionId, nullptr, Uint8Array::create(message, messageLength), defaultURL, nullptr, 0);
event->setTarget(this);
m_asyncEventQueue.enqueueEvent(WTFMove(event));
}
bool HTMLMediaElement::mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength)
{
if (!hasEventListeners(eventNames().webkitneedkeyEvent)) {
m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED);
scheduleEvent(eventNames().errorEvent);
return false;
}
Ref<Event> event = MediaKeyEvent::create(eventNames().webkitneedkeyEvent, keySystem, sessionId, Uint8Array::create(initData, initDataLength), nullptr, emptyString(), nullptr, 0);
event->setTarget(this);
m_asyncEventQueue.enqueueEvent(WTFMove(event));
return true;
}
#endif
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
RefPtr<ArrayBuffer> HTMLMediaElement::mediaPlayerCachedKeyForKeyId(const String& keyId) const
{
@@ -3604,79 +3523,6 @@ void HTMLMediaElement::detachMediaSource()
#endif
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
ExceptionOr<void> HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, const RefPtr<Uint8Array>& initData, const String& customData)
{
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
static bool firstTime = true;
if (firstTime && scriptExecutionContext()) {
scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("'HTMLMediaElement.webkitGenerateKeyRequest()' is deprecated. Use 'MediaKeys.createSession()' instead."));
firstTime = false;
}
#endif
if (keySystem.isEmpty())
return Exception { SyntaxError };
if (!m_player)
return Exception { InvalidStateError };
const unsigned char* initDataPointer = nullptr;
unsigned initDataLength = 0;
if (initData) {
initDataPointer = initData->data();
initDataLength = initData->length();
}
MediaPlayer::MediaKeyException result = m_player->generateKeyRequest(keySystem, initDataPointer, initDataLength, customData);
fprintf(stderr, "HTMLMediaElement::webkitGenerateKeyRequest() result %d\n", result);
return exceptionOrForMediaKeyException(result);
}
ExceptionOr<void> HTMLMediaElement::webkitAddKey(const String& keySystem, Uint8Array& key, const RefPtr<Uint8Array>& initData, const String& sessionId)
{
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
static bool firstTime = true;
if (firstTime && scriptExecutionContext()) {
scriptExecutionContext()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("'HTMLMediaElement.webkitAddKey()' is deprecated. Use 'MediaKeySession.update()' instead."));
firstTime = false;
}
#endif
if (keySystem.isEmpty())
return Exception { SyntaxError };
if (!key.length())
return Exception { TypeMismatchError };
if (!m_player)
return Exception { InvalidStateError };
const unsigned char* initDataPointer = nullptr;
unsigned initDataLength = 0;
if (initData) {
initDataPointer = initData->data();
initDataLength = initData->length();
}
MediaPlayer::MediaKeyException result = m_player->addKey(keySystem, key.data(), key.length(), initDataPointer, initDataLength, sessionId);
return exceptionOrForMediaKeyException(result);
}
ExceptionOr<void> HTMLMediaElement::webkitCancelKeyRequest(const String& keySystem, const String& sessionId)
{
if (keySystem.isEmpty())
return Exception { SyntaxError };
if (!m_player)
return Exception { InvalidStateError };
MediaPlayer::MediaKeyException result = m_player->cancelKeyRequest(keySystem, sessionId);
return exceptionOrForMediaKeyException(result);
}
#endif
bool HTMLMediaElement::loop() const
{
return hasAttributeWithoutSynchronization(loopAttr);
@@ -4629,9 +4475,6 @@ URL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* ke
MediaEngineSupportParameters parameters;
parameters.type = ContentType(type);
parameters.url = mediaURL;
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
parameters.keySystem = String(); // FIXME: ?
#endif
#if ENABLE(MEDIA_SOURCE)
parameters.isMediaSource = mediaURL.protocolIs(mediaSourceBlobProtocol);
#endif
@@ -286,12 +286,6 @@ class HTMLMediaElement
size_t maximumSourceBufferSize(const SourceBuffer&) const;
#endif
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
ExceptionOr<void> webkitGenerateKeyRequest(const String& keySystem, const RefPtr<Uint8Array>& initData, const String&);
ExceptionOr<void> webkitAddKey(const String& keySystem, Uint8Array& key, const RefPtr<Uint8Array>& initData, const String& sessionId);
ExceptionOr<void> webkitCancelKeyRequest(const String& keySystem, const String& sessionId);
#endif
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
WebKitMediaKeys* webkitKeys() const { return m_webKitMediaKeys.get(); }
void webkitSetMediaKeys(WebKitMediaKeys*);
@@ -645,13 +639,6 @@ class HTMLMediaElement
void mediaPlayerFirstVideoFrameAvailable(MediaPlayer*) override;
void mediaPlayerCharacteristicChanged(MediaPlayer*) override;
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1)
void mediaPlayerKeyAdded(MediaPlayer*, const String& keySystem, const String& sessionId) override;
void mediaPlayerKeyError(MediaPlayer*, const String& keySystem, const String& sessionId, MediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode) override;
void mediaPlayerKeyMessage(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const URL& defaultURL) override;
bool mediaPlayerKeyNeeded(MediaPlayer*, const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength) override;
#endif
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
RefPtr<ArrayBuffer> mediaPlayerCachedKeyForKeyId(const String& keyId) const override;
bool mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array*) override;
@@ -59,7 +59,7 @@ typedef (
readonly attribute TimeRanges buffered;
void load();
#if (defined(ENABLE_LEGACY_ENCRYPTED_MEDIA_V1) && ENABLE_LEGACY_ENCRYPTED_MEDIA_V1) || (defined(ENABLE_LEGACY_ENCRYPTED_MEDIA) && ENABLE_LEGACY_ENCRYPTED_MEDIA)
#if defined(ENABLE_LEGACY_ENCRYPTED_MEDIA) && ENABLE_LEGACY_ENCRYPTED_MEDIA
DOMString canPlayType(DOMString type, optional DOMString? keySystem = null);
#else
DOMString canPlayType(DOMString type);
@@ -106,10 +106,6 @@ typedef (
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitAudioDecodedByteCount;
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitVideoDecodedByteCount;
[Conditional=LEGACY_ENCRYPTED_MEDIA_V1, MayThrowException] void webkitGenerateKeyRequest(DOMString? keySystem, optional Uint8Array? initData = null, optional DOMString customData);
[Conditional=LEGACY_ENCRYPTED_MEDIA_V1, MayThrowException] void webkitAddKey(DOMString? keySystem, Uint8Array key, optional Uint8Array? initData = null, optional DOMString sessionId);
[Conditional=LEGACY_ENCRYPTED_MEDIA_V1, MayThrowException] void webkitCancelKeyRequest(DOMString? keySystem, optional DOMString sessionId);
[Conditional=LEGACY_ENCRYPTED_MEDIA, EnabledAtRuntime=LegacyEncryptedMediaAPI] readonly attribute WebKitMediaKeys webkitKeys;
[Conditional=LEGACY_ENCRYPTED_MEDIA, EnabledAtRuntime=LegacyEncryptedMediaAPI] void webkitSetMediaKeys(WebKitMediaKeys? mediaKeys);
[Conditional=ENCRYPTED_MEDIA, EnabledAtRuntime=EncryptedMediaAPI] readonly attribute MediaKeys mediaKeys;
@@ -38,7 +38,7 @@ class MediaError : public RefCounted<MediaError> {
MEDIA_ERR_NETWORK,
MEDIA_ERR_DECODE,
MEDIA_ERR_SRC_NOT_SUPPORTED
#if ENABLE(LEGACY_ENCRYPTED_MEDIA_V1) || ENABLE(LEGACY_ENCRYPTED_MEDIA)
#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
, MEDIA_ERR_ENCRYPTED
#endif
};
@@ -31,6 +31,6 @@
const unsigned short MEDIA_ERR_NETWORK = 2;
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
[Conditional=LEGACY_ENCRYPTED_MEDIA_V1|LEGACY_ENCRYPTED_MEDIA] const unsigned short MEDIA_ERR_ENCRYPTED = 5;
[Conditional=LEGACY_ENCRYPTED_MEDIA] const unsigned short MEDIA_ERR_ENCRYPTED = 5;
readonly attribute unsigned short code;
};

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 09940ac

Please sign in to comment.