Skip to content

Conversation

@marcin-mielczarczyk-red
Copy link

@marcin-mielczarczyk-red marcin-mielczarczyk-red commented Nov 13, 2025

When HTMLMediaElement has been created in WPE and HTMLMediaElement::setMediaKeys() method was called to set DRM keys, CDMThunder implementation already allocates CDM resources and they're not released until HTMLMediaElement object is destructed.
HTMLMediaElement destruction is non-deterministic and it's relying on Garbage Collector.
In this case very often we observe that after WPE exit (WPE process is not closed, but some #boot address is being loaded), CDM resources are not released immediately and CDM can't be used by other applications like IP Player or Netflix.

Proposed solution introduces following changes:

  1. CDMPrivateThunder implementation doesn't occupy CDM resources permanently, as it only needs CDM resources to check if server certificate is supported so CDM resources can be acquired before check and released afterwards

  2. CDMInstanceThunder object's CDM resources are released on HTMLMediaElement::stop() to not wait for Garbage Collector
    2c36c43

Build-Tests Layout-Tests
✅ 🛠 wpe-238-amd64-build ✅ 🧪 wpe-238-amd64-layout
✅ 🛠 wpe-238-arm32-build ✅ 🧪 wpe-238-arm32-layout

When HTMLMediaElement has been created in WPE and HTMLMediaElement::setMediaKeys()
method was called to set DRM keys, CDMThunder implementation already allocates CDM
resources and they're not released until HTMLMediaElement object is destructed.
HTMLMediaElement destruction is non-deterministic and it's relying on Garbage Collector.
In this case very often we observe that after WPE exit (WPE process is not closed,
but some #boot address is being loaded), CDM resources are not released immediately
and CDM can't be used by other applications like IP Player or Netflix.

Proposed solution introduces following changes:

1) CDMPrivateThunder implementation doesn't occupy CDM resources permanently,
as it only needs CDM resources to check if server certificate is supported
so CDM resources can be acquired before check and released afterwards

2) CDMInstanceThunder object's CDM resources are released on HTMLMediaElement::stop()
to not wait for Garbage Collector
@calvaris
Copy link
Member

I would need a test case, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants