Closed Bug 1139270 Opened 5 years ago Closed 5 years ago

[EME] Setting a key to output-downscaled causes it to not be playable


(Core :: Audio/Video, defect)

37 Branch
Windows 8.1
Not set



Tracking Status
firefox37 --- fixed
firefox38 --- fixed
firefox39 --- fixed


(Reporter: cpearce, Assigned: jwwang)


(Blocks 1 open bug)



(2 files)

When a CDM/GMP sets a keyId to be output-downscaled, we're supposed to still use the CDM to decrypt content for that key. We're not doing that however, we're stopping sending input to the CDM.

I think this is because we only send input to the CDM if the key is in usable state; we should instead send if the key is usable *or* output-downscaled.

JW: This is blocking Adobe, can you take it please?
To be clear, the fail case/STR is:

CDM plays video encrypted with a keyId, during playback sets keyId as "output-downscaled" status, and Gecko refuses to send more input. Gecko should still send input for "output-downscaled" status keyIds.
Not sure if EMEMediaDataDecoderProxy::Input() is the right place to look at? It looks like we can return true for CDMCaps::AutoLock::IsKeyUsable() when a key is either kGMPUsable or kGMPOutputDownscaled so that SamplesWaitingForKey won't hold samples from Input().
Flags: needinfo?(cpearce)
I suspect that'd do it. You should test it; just temporarily modify set a timer in gmp-clearkey which marks keys as output-downscaled.
Flags: needinfo?(cpearce)
A test case to send "output-downscaled" during playback.
test steps:
1. apply 1139270_testcase.patch
2. ./mach run

You will see video stuck after a while.
Mark kGMPOutputDownscaled keys "able to decrypt" so we can still decrypt samples with keys that are kGMPOutputDownscaled.
Attachment #8572505 - Flags: review?(cpearce)
Comment on attachment 8572505 [details] [diff] [review]

Review of attachment 8572505 [details] [diff] [review]:

We should get a testcase somehow so that we don't regress this, but first let's land this!
Attachment #8572505 - Flags: review?(cpearce) → review+
Must uplift.
Flags: needinfo?(cpearce)
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Comment on attachment 8572505 [details] [diff] [review]

Approval Request Comment
[Feature/regressing bug #]: EME
[User impact if declined]: EME videos could stop playback mid stream.
[Describe test coverage new/current, TreeHerder]: Local manual testing performed. Currently this only affects Adobe's EME plugin, and it's difficult to write a standalone test.
[Risks and why]: Low, this patch makes us more likely to play, not less likely. 
[String/UUID change made/needed]: None.
Flags: needinfo?(cpearce)
Attachment #8572505 - Flags: approval-mozilla-beta?
Attachment #8572505 - Flags: approval-mozilla-aurora?
Comment on attachment 8572505 [details] [diff] [review]

This change is isolated to EME and doesn't look to pose a risk to other video playback paths. Beta+ Aurora+
Attachment #8572505 - Flags: approval-mozilla-beta?
Attachment #8572505 - Flags: approval-mozilla-beta+
Attachment #8572505 - Flags: approval-mozilla-aurora?
Attachment #8572505 - Flags: approval-mozilla-aurora+
Flags: needinfo?(cpearce)
You need to log in before you can comment on or make changes to this bug.