diff --git a/package/wpe/wpewebkit/0001-EME-OpenCDM-Manage-lifetime-of-media-OpenCdm-session.patch b/package/wpe/wpewebkit/0001-EME-OpenCDM-Manage-lifetime-of-media-OpenCdm-session.patch deleted file mode 100644 index dbe7dcb6e0f9..000000000000 --- a/package/wpe/wpewebkit/0001-EME-OpenCDM-Manage-lifetime-of-media-OpenCdm-session.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 7348e896c600bddda3e09eb49c43da7dbca28470 Mon Sep 17 00:00:00 2001 -From: Charlie Turner -Date: Wed, 31 Jan 2018 10:38:39 +0000 -Subject: [PATCH] [EME, OpenCDM] Manage lifetime of media::OpenCdm sessions - -Also rename from openCdmSession -> openCdmBackend, because in my opinion this -better reflects what it is (sessions are multiplexed over the backend -connection) - -* platform/graphics/gstreamer/eme/CDMOpenCDM.cpp: -(WebCore::CDMPrivateOpenCDM::CDMPrivateOpenCDM): -(WebCore::CDMPrivateOpenCDM::supportsConfiguration const): -(WebCore::CDMPrivateOpenCDM::createInstance): -(WebCore::CDMInstanceOpenCDM::CDMInstanceOpenCDM): -(WebCore::CDMInstanceOpenCDM::setServerCertificate): -(WebCore::CDMInstanceOpenCDM::requestLicense): -(WebCore::CDMInstanceOpenCDM::updateLicense): -(WebCore::CDMInstanceOpenCDM::loadSession): -(WebCore::CDMInstanceOpenCDM::closeSession): -(WebCore::CDMInstanceOpenCDM::removeSessionData): -(WebCore::CDMPrivateOpenCDM::getOpenCdmInstance): Deleted. -* platform/graphics/gstreamer/eme/CDMOpenCDM.h: ---- - .../platform/graphics/gstreamer/eme/CDMOpenCDM.cpp | 56 +++++++++------------- - .../platform/graphics/gstreamer/eme/CDMOpenCDM.h | 6 +-- - 2 files changed, 25 insertions(+), 37 deletions(-) - -diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -index dd08ea1b887..d569fb006da 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -+++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -@@ -42,15 +42,11 @@ using namespace Inspector; - - namespace WebCore { - --class CDMPrivateOpenCDM : public CDMPrivate { -- -- String m_openCdmKeySystem; -- static std::unique_ptr s_openCdm; -- -+// FIXME: Move these classes to their own files like the rest of WebKit. -+class CDMPrivateOpenCDM final : public CDMPrivate { - public: -- - CDMPrivateOpenCDM(const String&); -- virtual ~CDMPrivateOpenCDM(); -+ ~CDMPrivateOpenCDM() override = default; - - bool supportsInitDataType(const AtomicString&) const override; - bool supportsConfiguration(const MediaKeySystemConfiguration&) const override; -@@ -67,10 +63,11 @@ public: - bool supportsInitData(const AtomicString&, const SharedBuffer&) const override; - RefPtr sanitizeResponse(const SharedBuffer&) const override; - std::optional sanitizeSessionId(const String&) const override; -- static media::OpenCdm* getOpenCdmInstance(); --}; - --std::unique_ptr CDMPrivateOpenCDM::s_openCdm; -+private: -+ String m_openCdmKeySystem; -+ std::unique_ptr m_openCdmBackend; -+}; - - static media::OpenCdm::LicenseType webKitLicenseTypeToOpenCDM(CDMInstance::LicenseType licenseType) - { -@@ -116,11 +113,11 @@ static CDMInstance::KeyStatus openCDMKeyStatusToWebKit(media::OpenCdm::KeyStatus - - CDMPrivateOpenCDM::CDMPrivateOpenCDM(const String& keySystem) - : m_openCdmKeySystem(keySystem) -+ , m_openCdmBackend(std::make_unique()) - { -+ RELEASE_ASSERT(m_openCdmBackend); - } - --CDMPrivateOpenCDM::~CDMPrivateOpenCDM() = default; -- - bool CDMPrivateOpenCDM::supportsInitDataType(const AtomicString& initDataType) const - { - return equalLettersIgnoringASCIICase(initDataType, "cenc"); -@@ -129,11 +126,11 @@ bool CDMPrivateOpenCDM::supportsInitDataType(const AtomicString& initDataType) c - bool CDMPrivateOpenCDM::supportsConfiguration(const MediaKeySystemConfiguration& config) const - { - for (auto& audioCapability : config.audioCapabilities) { -- if (!getOpenCdmInstance()->IsTypeSupported(m_openCdmKeySystem.utf8().data(), audioCapability.contentType.utf8().data())) -+ if (!m_openCdmBackend->IsTypeSupported(m_openCdmKeySystem.utf8().data(), audioCapability.contentType.utf8().data())) - return false; - } - for (auto& videoCapability : config.videoCapabilities) { -- if (!getOpenCdmInstance()->IsTypeSupported(m_openCdmKeySystem.utf8().data(), videoCapability.contentType.utf8().data())) -+ if (!m_openCdmBackend->IsTypeSupported(m_openCdmKeySystem.utf8().data(), videoCapability.contentType.utf8().data())) - return false; - } - return true; -@@ -154,13 +151,6 @@ bool CDMPrivateOpenCDM::supportsRobustness(const String&) const - return false; - } - --media::OpenCdm* CDMPrivateOpenCDM::getOpenCdmInstance() --{ -- if (!s_openCdm) -- s_openCdm = std::make_unique(); -- return s_openCdm.get(); --} -- - MediaKeysRequirement CDMPrivateOpenCDM::distinctiveIdentifiersRequirement(const MediaKeySystemConfiguration&, const MediaKeysRestrictions&) const - { - return MediaKeysRequirement::Optional; -@@ -178,8 +168,8 @@ bool CDMPrivateOpenCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable(con - - RefPtr CDMPrivateOpenCDM::createInstance() - { -- getOpenCdmInstance()->SelectKeySystem(m_openCdmKeySystem.utf8().data()); -- return adoptRef(new CDMInstanceOpenCDM(getOpenCdmInstance(), m_openCdmKeySystem)); -+ m_openCdmBackend->SelectKeySystem(m_openCdmKeySystem.utf8().data()); -+ return adoptRef(new CDMInstanceOpenCDM(std::move(m_openCdmBackend), m_openCdmKeySystem)); - } - - void CDMPrivateOpenCDM::loadAndInitialize() -@@ -230,14 +220,12 @@ bool CDMFactoryOpenCDM::supportsKeySystem(const String& keySystem) - return GStreamerEMEUtilities::isPlayReadyKeySystem(keySystem) || GStreamerEMEUtilities::isWidevineKeySystem(keySystem); - } - --CDMInstanceOpenCDM::CDMInstanceOpenCDM(media::OpenCdm* session, const String& keySystem) -- : m_openCdmSession(session) -+CDMInstanceOpenCDM::CDMInstanceOpenCDM(std::unique_ptr backend, const String& keySystem) -+ : m_openCdmBackend(std::move(backend)) - , m_keySystem(keySystem) - { - } - --CDMInstanceOpenCDM::~CDMInstanceOpenCDM() = default; -- - CDMInstance::SuccessValue CDMInstanceOpenCDM::initializeWithConfiguration(const MediaKeySystemConfiguration&) - { - return Succeeded; -@@ -256,7 +244,7 @@ CDMInstance::SuccessValue CDMInstanceOpenCDM::setPersistentStateAllowed(bool) - CDMInstance::SuccessValue CDMInstanceOpenCDM::setServerCertificate(Ref&& certificate) - { - CDMInstance::SuccessValue ret = WebCore::CDMInstance::SuccessValue::Failed; -- if (m_openCdmSession->SetServerCertificate(reinterpret_cast(const_cast(certificate->data())), certificate->size())) -+ if (m_openCdmBackend->SetServerCertificate(reinterpret_cast(const_cast(certificate->data())), certificate->size())) - ret = WebCore::CDMInstance::SuccessValue::Succeeded; - return ret; - } -@@ -273,7 +261,7 @@ void CDMInstanceOpenCDM::requestLicense(LicenseType licenseType, const AtomicStr - - GST_TRACE("Going to request a new session ID"); - -- bool createdSession = m_openCdmSession->CreateSession(mimeType.utf8().data(), reinterpret_cast(const_cast(initData->data())), -+ bool createdSession = m_openCdmBackend->CreateSession(mimeType.utf8().data(), reinterpret_cast(const_cast(initData->data())), - initData->size(), sessionId, webKitLicenseTypeToOpenCDM(licenseType)); - - if (!createdSession) { -@@ -293,7 +281,7 @@ void CDMInstanceOpenCDM::requestLicense(LicenseType licenseType, const AtomicStr - // below will detect an failure to retrieve a key message. That awkwardness will go when we move - // to std::string. - int destinationUrlLength = sizeof(temporaryUrl); -- m_openCdmSession->GetKeyMessage(message, &messageLength, temporaryUrl, &destinationUrlLength); -+ m_openCdmBackend->GetKeyMessage(message, &messageLength, temporaryUrl, &destinationUrlLength); - if (!messageLength || !destinationUrlLength) { - callback(WTFMove(initData), sessionIdValue, false, Failed); - return; -@@ -319,7 +307,7 @@ void CDMInstanceOpenCDM::updateLicense(const String& sessionId, LicenseType, con - { - // FIXME: At some point we will probably need to fix the API in OpenCDM, handle a key status vector and probably call the update key statuses algoritm. - std::string responseMessage; -- media::OpenCdm::KeyStatus keyStatus = m_openCdmSession->Update(reinterpret_cast(const_cast(response.data())), response.size(), responseMessage); -+ media::OpenCdm::KeyStatus keyStatus = m_openCdmBackend->Update(reinterpret_cast(const_cast(response.data())), response.size(), responseMessage); - GST_DEBUG("session id %s, key status is %ld", sessionId.utf8().data(), static_cast(keyStatus)); - if (keyStatus == media::OpenCdm::KeyStatus::Usable) { - SharedBuffer* initData = sessionIdMap.get(sessionId); -@@ -398,7 +386,7 @@ void CDMInstanceOpenCDM::loadSession(LicenseType, const String& sessionId, const - { - std::string responseMessage; - SessionLoadFailure sessionFailure = SessionLoadFailure::None; -- int ret = m_openCdmSession->Load(responseMessage); -+ int ret = m_openCdmBackend->Load(responseMessage); - if (!ret) { - std::string request = "message:"; - if (!responseMessage.compare(0, request.length(), request.c_str())) { -@@ -421,7 +409,7 @@ void CDMInstanceOpenCDM::loadSession(LicenseType, const String& sessionId, const - - void CDMInstanceOpenCDM::closeSession(const String&, CloseSessionCallback callback) - { -- m_openCdmSession->Close(); -+ m_openCdmBackend->Close(); - callback(); - } - -@@ -429,7 +417,7 @@ void CDMInstanceOpenCDM::removeSessionData(const String& sessionId, LicenseType, - { - std::string responseMessage; - KeyStatusVector keys; -- int ret = m_openCdmSession->Remove(responseMessage); -+ int ret = m_openCdmBackend->Remove(responseMessage); - if (!ret) { - std::string request = "message:"; - if (!responseMessage.compare(0, request.length(), request.c_str())) { -diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.h b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.h -index 72c4e84ea8e..404846d53b8 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.h -+++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.h -@@ -51,8 +51,8 @@ private: - - class CDMInstanceOpenCDM final : public CDMInstance { - public: -- CDMInstanceOpenCDM(media::OpenCdm*, const String&); -- virtual ~CDMInstanceOpenCDM(); -+ CDMInstanceOpenCDM(std::unique_ptr openCdmBackend, const String&); -+ ~CDMInstanceOpenCDM() override = default; - - ImplementationType implementationType() const { return ImplementationType::OpenCDM; } - SuccessValue initializeWithConfiguration(const MediaKeySystemConfiguration&) override; -@@ -77,7 +77,7 @@ private: - SessionLoadFailure getSessionLoadStatus(std::string &); - size_t checkMessageLength(std::string &, std::string &); - -- media::OpenCdm* m_openCdmSession; -+ std::unique_ptr m_openCdmBackend; - HashMap> sessionIdMap; - String m_keySystem; - }; --- -2.15.1 - diff --git a/package/wpe/wpewebkit/0003-brcm_frame_decoded.patch b/package/wpe/wpewebkit/0001-brcm_frame_decoded.patch similarity index 100% rename from package/wpe/wpewebkit/0003-brcm_frame_decoded.patch rename to package/wpe/wpewebkit/0001-brcm_frame_decoded.patch diff --git a/package/wpe/wpewebkit/0002-Remove-closed-sessions-from-session-id-map.patch b/package/wpe/wpewebkit/0002-Remove-closed-sessions-from-session-id-map.patch deleted file mode 100644 index 11fa57b8657a..000000000000 --- a/package/wpe/wpewebkit/0002-Remove-closed-sessions-from-session-id-map.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8f8d2537a2401774be6ed8e1d9510844eb80e798 Mon Sep 17 00:00:00 2001 -From: Charlie Turner -Date: Thu, 1 Feb 2018 17:11:31 +0000 -Subject: [PATCH] Remove closed sessions from session id map - -This isn't a final fix, the session id handling is completely bonkers... But -this does fix the issue of gstreamer selecting incorrect sessions -non-determinisically IFF session.close() is called by the application. -Multi-key will be refactoring much of this session handling stuff. - -* platform/graphics/gstreamer/eme/CDMOpenCDM.cpp: -(WebCore::CDMInstanceOpenCDM::loadSession): -(WebCore::CDMInstanceOpenCDM::closeSession): ---- - Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -index d569fb006da..a2cf71ac758 100644 ---- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -+++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMOpenCDM.cpp -@@ -407,14 +407,18 @@ void CDMInstanceOpenCDM::loadSession(LicenseType, const String& sessionId, const - } - } - --void CDMInstanceOpenCDM::closeSession(const String&, CloseSessionCallback callback) -+void CDMInstanceOpenCDM::closeSession(const String& sessionId, CloseSessionCallback callback) - { -+ if (!sessionIdMap.remove(sessionId)) { -+ GST_WARNING("%s is an unknown session", sessionId.utf8().data()); -+ } - m_openCdmBackend->Close(); - callback(); - } - - void CDMInstanceOpenCDM::removeSessionData(const String& sessionId, LicenseType, RemoveSessionDataCallback callback) - { -+ // FIXME: Should the session id be removed from the map here as well as in closeSession? - std::string responseMessage; - KeyStatusVector keys; - int ret = m_openCdmBackend->Remove(responseMessage); --- -2.15.1 -