diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.cpp index e6e12e8131d9a..00e75ae0afb6e 100644 --- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.cpp @@ -90,8 +90,7 @@ bool CDMProxyThunder::decrypt(CDMProxyThunder::DecryptionContext& input) GST_TRACE("decrypting"); // Decrypt cipher. - OpenCDMError errorCode = opencdm_gstreamer_session_decrypt(session->get(), input.dataBuffer, input.subsamplesBuffer, input.numSubsamples, - input.ivBuffer, input.keyIDBuffer, 0); + OpenCDMError errorCode = opencdm_gstreamer_session_decrypt_buffer(session->get(), input.dataBuffer, input.caps.get()); if (errorCode) { GST_ERROR("decryption failed, error code %X", errorCode); return false; diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.h b/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.h index ad544364a483b..7c1ff0129ed17 100644 --- a/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.h +++ b/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.h @@ -52,6 +52,7 @@ class CDMProxyThunder final : public CDMProxy, public CanMakeWeakPtr caps; size_t numSubsamples; WeakPtr cdmProxyDecryptionClient; }; diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp index f8a5e4c2e8a14..cdf18c4743c60 100644 --- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp +++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp @@ -155,6 +155,13 @@ static bool decrypt(WebKitMediaCommonEncryptionDecrypt* decryptor, GstBuffer* iv return false; } + GRefPtr sinkpad = adoptGRef(gst_element_get_static_pad(reinterpret_cast(self), "sink")); + GRefPtr caps = adoptGRef(gst_pad_get_current_caps(sinkpad.get())); + + GstStructure *capstruct = gst_caps_get_structure(caps.get(), 0); + const gchar* capsinfo = gst_structure_get_string(capstruct, "original-media-type"); + GST_DEBUG_OBJECT(self, "CAPS %p - Stream Type = %s", caps.get(), capsinfo); + CDMProxyThunder::DecryptionContext context = { }; context.keyIDBuffer = keyIDBuffer; context.ivBuffer = ivBuffer; @@ -162,6 +169,7 @@ static bool decrypt(WebKitMediaCommonEncryptionDecrypt* decryptor, GstBuffer* iv context.numSubsamples = subsampleCount; context.subsamplesBuffer = subsampleCount ? subsamplesBuffer : nullptr; context.cdmProxyDecryptionClient = webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient(decryptor); + context.caps = caps; bool result = priv->cdmProxy->decrypt(context); return result;