Bug 227403

Summary: [GStreamer][EME] Fix resources release when a MediaKeySession is closed
Product: WebKit Reporter: Xabier Rodríguez Calvar <calvaris>
Component: New BugsAssignee: Xabier Rodríguez Calvar <calvaris>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, eric.carlson, ews-watchlist, glenn, gustavo, jer.noble, menard, philipj, philn, pnormand, sergio, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Xabier Rodríguez Calvar 2021-06-25 08:08:36 PDT
[GStreamer][EME] Fix resources release when a MediaKeySession is closed
Comment 1 Xabier Rodríguez Calvar 2021-06-25 08:32:30 PDT
Created attachment 432273 [details]
Patch
Comment 2 Philippe Normand 2021-06-25 08:51:43 PDT
Comment on attachment 432273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=432273&action=review

> Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:589
> -    if (!m_session || m_sessionID.isEmpty() || opencdm_session_update(m_session.get(), response->data(), response->size()))
> +    if (!m_session || m_sessionID.isEmpty() || opencdm_session_update(m_session->get(), response->dataAsUInt8Ptr(), response->size()))

dataAsUInt8Ptr does not exist anymore. Please revert this part.
Comment 3 Xabier Rodríguez Calvar 2021-06-25 09:09:52 PDT
Created attachment 432277 [details]
Patch
Comment 4 Philippe Normand 2021-06-28 01:32:11 PDT
Comment on attachment 432277 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=432277&action=review

> Source/WebCore/ChangeLog:21
> +        are only needed in the CDMProxy class, which is there they are

s/there/where?

> Source/WebCore/ChangeLog:28
> +        shared among different sessions. We were managing session
> +        references in other stores and they were messing up with the
> +        session in the CDMProxy class, that prevented sessions from
> +        staying when there are other MediaKeySessions referencing the same
> +        key IDs and from being removed then a session was closed and there
> +        was only that reference in the CDMProxy (because they could be
> +        held by the other stores, where references are unnecessary.

This sentence is 7 lines long :) I had some trouble to parse it too.

> Source/WebCore/platform/encryptedmedia/CDMProxy.cpp:186
> +void KeyStore::removeAllKeys()

clear() maybe?
Comment 5 Xabier Rodríguez Calvar 2021-06-28 08:19:53 PDT
Created attachment 432396 [details]
Patch
Comment 6 EWS 2021-06-28 23:12:01 PDT
Committed r279363 (239229@main): <https://commits.webkit.org/239229@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432396 [details].
Comment 7 Radar WebKit Bug Importer 2021-06-28 23:13:16 PDT
<rdar://problem/79899771>