[GStreamer][EME] waitingforkey event should consider decryptors' waiting status
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2018 12:40:12 +0000 (12:40 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Nov 2018 12:40:12 +0000 (12:40 +0000)
commit3b9208b9f47b00d038f303eab4fee63e41e1bff6
treef7fabd035c2b04742265373c069ee3b695922f6c
parent270b322913d531c988e35c092cfe69e05cc05cb8
[GStreamer][EME] waitingforkey event should consider decryptors' waiting status
https://bugs.webkit.org/show_bug.cgi?id=191459

Reviewed by Carlos Garcia Campos.

The new cross platform architecture to report waitingforkey and
recover from it requires a more accurate knowledge of what is
going on with the decryptors because events are reported only once
(per key exchange run) and crossplatform only continues if we are
actually ready to continue, meaning that no decryptors are
waiting.

* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
GstIterator deleter.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
out if we are requested to not wait anymore but there are still
waiting decryptors.
(WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
Query the pipeline, just a query after pipeline is built and
manual inspection during build. The query is optimal but sometimes
we can get this request when the pipeline is under construction so
queries do not arrive at the decryptors and we have to deliver it
by ourselves.
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
Deleted because it is now inlined.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init): Override
query method.
(webkitMediaCommonEncryptionDecryptTransformInPlace): When the
decryptor is going to block to wait, report before. When the
decryptor receives the key, report it got it.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
handle waitingforkey here.
(webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
decryptor is waiting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/GUniquePtrGStreamer.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp