Changeset 276708 in webkit
- Timestamp:
- Apr 28, 2021, 7:31:25 AM (5 years ago)
- Location:
- releases/WebKitGTK/webkit-2.32/Source/WebCore
- Files:
-
- 11 edited
-
ChangeLog (modified) (1 diff)
-
platform/encryptedmedia/CDMProxy.cpp (modified) (4 diffs)
-
platform/encryptedmedia/CDMProxy.h (modified) (4 diffs)
-
platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/CDMProxyClearKey.h (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/CDMProxyThunder.cpp (modified) (3 diffs)
-
platform/graphics/gstreamer/eme/CDMProxyThunder.h (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp (modified) (11 diffs)
-
platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog
r276703 r276708 1 2021-04-07 Enrique Ocaña González <eocanha@igalia.com> 2 3 [EME][GStreamer] Abort decryptor operations immediately and without errors on flush 4 https://bugs.webkit.org/show_bug.cgi?id=223742 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 A decryptor transformInPlace() operation can cause potentially long waits in 9 two situations: 10 11 - transformInPlace() is waiting to get the cdmProxy. 12 - The CDMProxy::decrypt() method is internally waiting for a specific key to 13 become available. 14 15 If a seek operation is performed during those long waits, the main thread will 16 be blocked until the seek finishes the conditions those long waits are waiting 17 for will never be fulfilled (because the operations that complete them happen 18 in the main thread, which is blocked), the internal wait timeouts will trigger 19 and the decoder will trigger an unrecoverable error. 20 21 The solution for this is to break the waits by issuing the right notifications, 22 and to detect the flushes performed by the seek, distinguising this special 23 "abort" case from a regular error, so that the situation is no longer 24 unrecoverable. 25 26 This solution involves changes in several layers. A public 27 CDMProxy::abortWaitingForKey() method is exposed to allow the decryptor to 28 awake the inner waitFor() that checks for the key. The cdmProxy wait is also 29 awaken in case there's no cdmProxy available yet. 30 31 In order to distinguish if the awakenings are caused by real errors (no 32 cdmProxy, no key available) or by a flush operation (caused by the seek), the 33 decryptor first needs to keep track of the "flushing" state and allow other 34 objects to know about it. CDMProxy is one of those objects, but due to layer 35 limitations it can't directly ask about it to the decryptor (it can't "see" 36 it). 37 38 A new CDMProxyDecryptionClient interface is created, and the decryptor will 39 hold an implementation of it (as CDMProxyDecryptorClientImplementation). 40 CDMProxy can then know the client isAborting(), and the client will know the 41 decryptor and will ask about it. 42 43 As the pipeline, and thus the decryptor, can be destroyed at any moment, 44 the client holds a WeakPtr to the decryptor and will only ask if isAborting() 45 if the pointer is still alive. 46 47 * platform/encryptedmedia/CDMProxy.cpp: 48 (WebCore::CDMProxy::abortWaitingForKey const): Notify waiting threads. 49 (WebCore::CDMProxy::tryWaitForKeyHandle const): Take a client and ask it if it's aborting. 50 (WebCore::CDMProxy::getOrWaitForKeyHandle const): Pass the client along. 51 (WebCore::CDMProxy::getOrWaitForKeyValue const): Ditto. 52 * platform/encryptedmedia/CDMProxy.h: Declaration and usage of the CDMProxyDecryptionClient interface. 53 * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp: 54 (WebCore::CDMProxyClearKey::cencSetDecryptionKey): Pass the client along from the context. 55 * platform/graphics/gstreamer/eme/CDMProxyClearKey.h: Store client in the cencDecryptContext. 56 * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: 57 (WebCore::CDMProxyThunder::getDecryptionSession const): Pass the client along from the context. 58 (WebCore::CDMProxyThunder::decrypt): Abort operations aren't an error, so just trigger a warning if there's no session. 59 * platform/graphics/gstreamer/eme/CDMProxyThunder.h: Store client in DecryptionContext. 60 * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: 61 (decrypt): Ask for client to the superclass and store it in the context. 62 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: 63 (CDMProxyDecryptionClientImplementation::CDMProxyDecryptionClientImplementation): Implementation of the CDMProxyDecryptionClient interface. 64 (CDMProxyDecryptionClientImplementation::isAborting): Ask if the decryptor is flushing. 65 (constructed): Initialize the client. 66 (transformInPlace): Check the flush status after waiting for the CDMProxy and for the decryption performed by the subclasses. Release the lock when not needed. 67 (isCDMProxyAvailable): Renamed mutex to be more generic. 68 (attachCDMProxy): Ditto. Also renamed condition for the same reason. 69 (sinkEventHandler): Manage isFlushing status and awake waits for cdmProxy or for session depending on the lifecycle stage. 70 (webKitMediaCommonEncryptionDecryptIsFlushing): Expose isFlushing status. 71 (webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient): Return Weak reference to the client. 72 (changeState): Renamed condition. 73 (setContext): Renamed mutex. 74 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: New getters for isFlushing and the client. 75 * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: 76 (decrypt): Ask for client to the superclass and store it in the context. 77 1 78 2021-04-06 Alicia Boya García <aboya@igalia.com> 2 79 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/encryptedmedia/CDMProxy.cpp
r264219 r276708 272 272 } 273 273 274 Optional<Ref<KeyHandle>> CDMProxy::tryWaitForKeyHandle(const KeyIDType& keyID) const 274 void CDMProxy::abortWaitingForKey() const 275 { 276 LOG(EME, "EME - CDMProxy - abort waiting for key ID"); 277 m_keysCondition.notifyAll(); 278 } 279 280 Optional<Ref<KeyHandle>> CDMProxy::tryWaitForKeyHandle(const KeyIDType& keyID, WeakPtr<CDMProxyDecryptionClient>&& client) const 275 281 { 276 282 startedWaitingForKey(); … … 282 288 }); 283 289 LOG(EME, "EME - CDMProxy - trying to wait for key ID %s", vectorToHexString(keyID).ascii().data()); 284 bool wasKey Received= false;290 bool wasKeyAvailable = false; 285 291 { 286 292 auto locker = holdLock(m_keysMutex); 287 wasKeyReceived = m_keysCondition.waitFor(m_keysMutex, CDMProxy::MaxKeyWaitTimeSeconds, [&, this, keyID]() { 288 return keyAvailableUnlocked(keyID); 293 294 m_keysCondition.waitFor(m_keysMutex, CDMProxy::MaxKeyWaitTimeSeconds, [this, keyID, client = WTFMove(client), &wasKeyAvailable]() { 295 if (!client || client->isAborting()) 296 return true; 297 wasKeyAvailable = keyAvailableUnlocked(keyID); 298 return wasKeyAvailable; 289 299 }); 290 300 } 291 301 292 if (wasKeyReceived) { 302 if (wasKeyAvailable) { 303 RefPtr<KeyHandle> handle = keyHandle(keyID); 293 304 LOG(EME, "EME - CDMProxy - successfully waited for key ID %s", vectorToHexString(keyID).ascii().data()); 294 RefPtr<KeyHandle> handle = keyHandle(keyID);295 305 return makeOptional(handle.releaseNonNull()); 296 306 } 297 298 LOG(EME, "EME - CDMProxy - key ID %s not available ", vectorToHexString(keyID).ascii().data());307 308 LOG(EME, "EME - CDMProxy - key ID %s not available or operation aborted", vectorToHexString(keyID).ascii().data()); 299 309 return WTF::nullopt; 300 310 } … … 311 321 } 312 322 313 Optional<Ref<KeyHandle>> CDMProxy::getOrWaitForKeyHandle(const KeyIDType& keyID ) const323 Optional<Ref<KeyHandle>> CDMProxy::getOrWaitForKeyHandle(const KeyIDType& keyID, WeakPtr<CDMProxyDecryptionClient>&& client) const 314 324 { 315 325 if (!keyAvailable(keyID)) { 316 326 LOG(EME, "EME - CDMProxy key cache does not contain key ID %s", vectorToHexString(keyID).ascii().data()); 317 return tryWaitForKeyHandle(keyID );327 return tryWaitForKeyHandle(keyID, WTFMove(client)); 318 328 } 319 329 … … 322 332 } 323 333 324 Optional<KeyHandleValueVariant> CDMProxy::getOrWaitForKeyValue(const KeyIDType& keyID ) const325 { 326 if (auto keyHandle = getOrWaitForKeyHandle(keyID ))334 Optional<KeyHandleValueVariant> CDMProxy::getOrWaitForKeyValue(const KeyIDType& keyID, WeakPtr<CDMProxyDecryptionClient>&& client) const 335 { 336 if (auto keyHandle = getOrWaitForKeyHandle(keyID, WTFMove(client))) 327 337 return makeOptional((*keyHandle)->value()); 328 338 return WTF::nullopt; -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/encryptedmedia/CDMProxy.h
r264219 r276708 147 147 148 148 class CDMInstanceProxy; 149 class CDMProxyDecryptionClient; 149 150 150 151 // Handle to a "real" CDM, not the JavaScript facade. This can be used … … 158 159 void updateKeyStore(const KeyStore& newKeyStore); 159 160 void setInstance(CDMInstanceProxy*); 161 void abortWaitingForKey() const; 160 162 161 163 virtual void releaseDecryptionResources() … … 169 171 bool keyAvailable(const KeyIDType&) const; 170 172 bool keyAvailableUnlocked(const KeyIDType&) const; 171 Optional<Ref<KeyHandle>> tryWaitForKeyHandle(const KeyIDType& ) const;172 Optional<Ref<KeyHandle>> getOrWaitForKeyHandle(const KeyIDType& ) const;173 Optional<KeyHandleValueVariant> getOrWaitForKeyValue(const KeyIDType& ) const;173 Optional<Ref<KeyHandle>> tryWaitForKeyHandle(const KeyIDType&, WeakPtr<CDMProxyDecryptionClient>&&) const; 174 Optional<Ref<KeyHandle>> getOrWaitForKeyHandle(const KeyIDType&, WeakPtr<CDMProxyDecryptionClient>&&) const; 175 Optional<KeyHandleValueVariant> getOrWaitForKeyValue(const KeyIDType&, WeakPtr<CDMProxyDecryptionClient>&&) const; 174 176 void startedWaitingForKey() const; 175 177 void stoppedWaitingForKey() const; … … 280 282 }; 281 283 284 class CDMProxyDecryptionClient : public CanMakeWeakPtr<CDMProxyDecryptionClient, WeakPtrFactoryInitialization::Eager> { 285 public: 286 virtual bool isAborting() = 0; 287 virtual ~CDMProxyDecryptionClient() = default; 288 }; 289 282 290 } // namespace WebCore 283 291 -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp
r268975 r276708 114 114 } 115 115 116 bool CDMProxyClearKey::cencSetDecryptionKey(c onst cencDecryptContext& in)116 bool CDMProxyClearKey::cencSetDecryptionKey(cencDecryptContext& in) 117 117 { 118 118 // FIXME: Unnecessary copy, can we avoid this while still exposing … … 122 122 keyIDVec.append(in.keyID, in.keyIDSizeInBytes); 123 123 124 auto keyData = getOrWaitForKeyValue(keyIDVec );124 auto keyData = getOrWaitForKeyValue(keyIDVec, WTFMove(in.cdmProxyDecryptionClient)); 125 125 if (!keyData) 126 126 return false; -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyClearKey.h
r263658 r276708 92 92 size_t subsamplesBufferSizeInBytes; 93 93 size_t numSubsamples; 94 WeakPtr<CDMProxyDecryptionClient> cdmProxyDecryptionClient; 94 95 95 96 bool isSubsampled() const { return numSubsamples; } … … 108 109 // reuse some Crypto APIs in WebCore? 109 110 bool cencSetCounterVector(const cencDecryptContext&); 110 bool cencSetDecryptionKey(c onst cencDecryptContext&);111 bool cencSetDecryptionKey(cencDecryptContext&); 111 112 bool cencDecryptFullSample(cencDecryptContext&); 112 113 bool cencDecryptSubsampled(cencDecryptContext&); -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.cpp
r264762 r276708 45 45 const WTF::Seconds s_licenseKeyResponseTimeout = WTF::Seconds(6); 46 46 47 BoxPtr<OpenCDMSession> CDMProxyThunder::getDecryptionSession( constDecryptionContext& in) const47 BoxPtr<OpenCDMSession> CDMProxyThunder::getDecryptionSession(DecryptionContext& in) const 48 48 { 49 49 GstMappedBuffer mappedKeyID(in.keyIDBuffer, GST_MAP_READ); … … 55 55 auto keyID = mappedKeyID.createVector(); 56 56 57 auto keyHandle = getOrWaitForKeyHandle(keyID );57 auto keyHandle = getOrWaitForKeyHandle(keyID, WTFMove(in.cdmProxyDecryptionClient)); 58 58 if (!keyHandle.hasValue() || !keyHandle.value()->isStatusCurrentlyValid()) 59 59 return nullptr; … … 85 85 BoxPtr<OpenCDMSession> session = getDecryptionSession(input); 86 86 if (!session) { 87 GST_ ERROR("there is no valid session to decrypt for the provided key ID");87 GST_WARNING("there is no valid session to decrypt for the provided key ID (or the operation was aborted)"); 88 88 return false; 89 89 } -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/CDMProxyThunder.h
r264219 r276708 54 54 GstBuffer* subsamplesBuffer; 55 55 size_t numSubsamples; 56 WeakPtr<CDMProxyDecryptionClient> cdmProxyDecryptionClient; 56 57 }; 57 58 … … 60 61 61 62 private: 62 BoxPtr<OpenCDMSession> getDecryptionSession( constDecryptionContext&) const;63 BoxPtr<OpenCDMSession> getDecryptionSession(DecryptionContext&) const; 63 64 String m_keySystem; 64 65 }; -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp
r266721 r276708 126 126 } 127 127 128 CDMProxyClearKey::cencDecryptContext context ;128 CDMProxyClearKey::cencDecryptContext context = { }; 129 129 context.keyID = mappedKeyIdBuffer.data(); 130 130 context.keyIDSizeInBytes = mappedKeyIdBuffer.size(); … … 146 146 context.subsamplesBufferSizeInBytes = mappedSubsamplesBuffer.size(); 147 147 } 148 context.cdmProxyDecryptionClient = webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient(self); 148 149 149 150 return priv->cdmProxy->cencDecrypt(context); -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
r272129 r276708 37 37 using WebCore::CDMProxy; 38 38 39 // Instances of this class are tied to the decryptor lifecycle. They can't be alive after the decryptor has been destroyed. 40 class CDMProxyDecryptionClientImplementation : public WebCore::CDMProxyDecryptionClient { 41 WTF_MAKE_FAST_ALLOCATED; 42 public: 43 CDMProxyDecryptionClientImplementation(WebKitMediaCommonEncryptionDecrypt* decryptor) 44 : m_decryptor(decryptor) { } 45 virtual bool isAborting() 46 { 47 return webKitMediaCommonEncryptionDecryptIsFlushing(m_decryptor); 48 } 49 virtual ~CDMProxyDecryptionClientImplementation() = default; 50 private: 51 WebKitMediaCommonEncryptionDecrypt* m_decryptor; 52 }; 53 39 54 #define WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_MEDIA_CENC_DECRYPT, WebKitMediaCommonEncryptionDecryptPrivate)) 40 55 struct _WebKitMediaCommonEncryptionDecryptPrivate { 41 56 RefPtr<CDMProxy> cdmProxy; 42 57 43 Lock cdmAttachmentMutex; 44 Condition cdmAttachmentCondition; 58 // Protect the access to the structure members. 59 Lock mutex; 60 Condition condition; 61 62 bool isFlushing { false }; 63 std::unique_ptr<CDMProxyDecryptionClientImplementation> cdmProxyDecryptionClientImplementation; 45 64 }; 46 65 … … 86 105 gst_base_transform_set_passthrough(base, FALSE); 87 106 gst_base_transform_set_gap_aware(base, FALSE); 107 108 WebKitMediaCommonEncryptionDecrypt* self = WEBKIT_MEDIA_CENC_DECRYPT(base); 109 WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); 110 priv->cdmProxyDecryptionClientImplementation = WTF::makeUnique<CDMProxyDecryptionClientImplementation>(self); 88 111 } 89 112 … … 169 192 } 170 193 171 LockHolder locker(priv->cdmAttachmentMutex); 194 LockHolder locker(priv->mutex); 195 196 if (priv->isFlushing) { 197 GST_DEBUG_OBJECT(self, "Decryption aborted because of flush"); 198 return GST_FLOW_FLUSHING; 199 } 172 200 173 201 // The CDM instance needs to be negotiated before we can begin decryption. 174 202 if (!priv->cdmProxy) { 175 203 GST_DEBUG_OBJECT(self, "CDM not available, going to wait for it"); 176 priv->c dmAttachmentCondition.waitFor(priv->cdmAttachmentMutex, MaxSecondsToWaitForCDMProxy, [priv] {177 return priv-> cdmProxy;204 priv->condition.waitFor(priv->mutex, MaxSecondsToWaitForCDMProxy, [priv] { 205 return priv->isFlushing || priv->cdmProxy; 178 206 }); 207 // Note that waitFor() releases the mutex lock internally while it waits, so isFlushing may have been changed. 208 if (priv->isFlushing) { 209 GST_DEBUG_OBJECT(self, "Decryption aborted because of flush"); 210 return GST_FLOW_FLUSHING; 211 } 179 212 if (!priv->cdmProxy) { 180 213 GST_ERROR_OBJECT(self, "CDMProxy was not retrieved in time"); … … 183 216 GST_DEBUG_OBJECT(self, "CDM now available with address %p", priv->cdmProxy.get()); 184 217 } 218 185 219 auto removeProtectionMetaOnReturn = makeScopeExit([buffer, protectionMeta] { 186 220 gst_buffer_remove_meta(buffer, reinterpret_cast<GstMeta*>(protectionMeta)); … … 246 280 247 281 GST_TRACE_OBJECT(self, "decrypting"); 248 if (!klass->decrypt(self, ivBuffer, keyIDBuffer, buffer, subSampleCount, subSamplesBuffer)) { 282 283 // Temporarily release the lock while we don't need to access priv. The lower level API is used 284 // in order to avoid creating several scopes with different LockHolder instances in each one. 285 priv->mutex.unlock(); 286 287 bool didDecryptionSucceed = klass->decrypt(self, ivBuffer, keyIDBuffer, buffer, subSampleCount, subSamplesBuffer); 288 289 // Accessing priv members again. 290 priv->mutex.lock(); 291 292 if (!didDecryptionSucceed) { 293 if (priv->isFlushing) { 294 GST_DEBUG_OBJECT(self, "Decryption aborted because of flush"); 295 return GST_FLOW_FLUSHING; 296 } 249 297 GST_ERROR_OBJECT(self, "Decryption failed"); 250 298 return GST_FLOW_NOT_SUPPORTED; … … 257 305 { 258 306 WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); 259 auto locker = holdLock(priv-> cdmAttachmentMutex);307 auto locker = holdLock(priv->mutex); 260 308 return priv->cdmProxy; 261 309 } … … 290 338 WebKitMediaCommonEncryptionDecryptClass* klass = WEBKIT_MEDIA_CENC_DECRYPT_GET_CLASS(self); 291 339 292 auto locker = holdLock(priv-> cdmAttachmentMutex);340 auto locker = holdLock(priv->mutex); 293 341 GST_ERROR_OBJECT(self, "Attaching CDMProxy %p", proxy); 294 342 priv->cdmProxy = proxy; 295 343 klass->cdmProxyAttached(self, priv->cdmProxy); 296 priv->c dmAttachmentCondition.notifyOne();344 priv->condition.notifyOne(); 297 345 } 298 346 … … 319 367 { 320 368 WebKitMediaCommonEncryptionDecrypt* self = WEBKIT_MEDIA_CENC_DECRYPT(trans); 321 gboolean result = FALSE;369 WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); 322 370 323 371 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=191355 … … 331 379 ASSERT(gst_event_has_name(event, "attempt-to-decrypt")); 332 380 GST_DEBUG_OBJECT(self, "Handling attempt-to-decrypt"); 333 result = installCDMProxyIfNotAvailable(self);381 gboolean result = installCDMProxyIfNotAvailable(self); 334 382 gst_event_unref(event); 383 return result; 384 } 385 case GST_EVENT_FLUSH_START: 386 GST_DEBUG_OBJECT(self, "Flush-start"); 387 { 388 LockHolder locker(priv->mutex); 389 bool isCdmProxyAttached = priv->cdmProxy; 390 priv->isFlushing = true; 391 if (isCdmProxyAttached) { 392 locker.unlockEarly(); 393 priv->cdmProxy->abortWaitingForKey(); 394 } else 395 priv->condition.notifyOne(); 396 } 335 397 break; 336 } 398 case GST_EVENT_FLUSH_STOP: 399 GST_DEBUG_OBJECT(self, "Flush-stop"); 400 { 401 LockHolder locker(priv->mutex); 402 priv->isFlushing = false; 403 } 404 break; 337 405 default: 338 result = GST_BASE_TRANSFORM_CLASS(parent_class)->sink_event(trans, event);339 406 break; 340 407 } 341 408 342 return result; 409 return GST_BASE_TRANSFORM_CLASS(parent_class)->sink_event(trans, event); 410 } 411 412 bool webKitMediaCommonEncryptionDecryptIsFlushing(WebKitMediaCommonEncryptionDecrypt* self) 413 { 414 WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); 415 LockHolder locker(priv->mutex); 416 return priv->isFlushing; 417 } 418 419 WeakPtr<WebCore::CDMProxyDecryptionClient> webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient(WebKitMediaCommonEncryptionDecrypt* self) 420 { 421 WebKitMediaCommonEncryptionDecryptPrivate* priv = WEBKIT_MEDIA_CENC_DECRYPT_GET_PRIVATE(self); 422 return makeWeakPtr(*priv->cdmProxyDecryptionClientImplementation); 343 423 } 344 424 … … 351 431 case GST_STATE_CHANGE_PAUSED_TO_READY: 352 432 GST_DEBUG_OBJECT(self, "PAUSED->READY"); 353 priv->c dmAttachmentCondition.notifyOne();433 priv->condition.notifyOne(); 354 434 break; 355 435 default: … … 372 452 if (gst_context_has_context_type(context, "drm-cdm-proxy")) { 373 453 const GValue* value = gst_structure_get_value(gst_context_get_structure(context), "cdm-proxy"); 374 LockHolder locker(priv-> cdmAttachmentMutex);454 LockHolder locker(priv->mutex); 375 455 priv->cdmProxy = value ? reinterpret_cast<CDMProxy*>(g_value_get_pointer(value)) : nullptr; 376 456 GST_DEBUG_OBJECT(self, "received new CDMInstance %p", priv->cdmProxy.get()); -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h
r264219 r276708 29 29 #include <gst/gst.h> 30 30 #include <wtf/RefPtr.h> 31 #include <wtf/WeakPtr.h> 31 32 32 33 G_BEGIN_DECLS … … 45 46 46 47 GType webkit_media_common_encryption_decrypt_get_type(void); 48 49 bool webKitMediaCommonEncryptionDecryptIsFlushing(WebKitMediaCommonEncryptionDecrypt*); 50 WeakPtr<WebCore::CDMProxyDecryptionClient> webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient(WebKitMediaCommonEncryptionDecrypt*); 47 51 48 52 struct _WebKitMediaCommonEncryptionDecrypt { -
releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp
r273311 r276708 157 157 } 158 158 159 CDMProxyThunder::DecryptionContext context ;159 CDMProxyThunder::DecryptionContext context = { }; 160 160 context.keyIDBuffer = keyIDBuffer; 161 161 context.ivBuffer = ivBuffer; … … 163 163 context.numSubsamples = subsampleCount; 164 164 context.subsamplesBuffer = subsampleCount ? subsamplesBuffer : nullptr; 165 context.cdmProxyDecryptionClient = webKitMediaCommonEncryptionDecryptGetCDMProxyDecryptionClient(self); 166 bool result = priv->cdmProxy->decrypt(context); 165 167 166 return priv->cdmProxy->decrypt(context);168 return result; 167 169 } 168 170
Note:
See TracChangeset
for help on using the changeset viewer.