Closed Bug 1820650 Opened 1 year ago Closed 1 year ago

[wmfme] Use WMFCDMProxy in the media engine playback framework

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

This bug is about hooking the CDM proxy into the media engine by passing a CDM proxy ID over IPC. However, this bug won't make DRM video playback work now, because there are still some missing pieces which we haven't implemented yet.

For media engine playback, we would like to let ExternalStateMachine
being aware of the CDM proxy, so that it can pass the the Id of MFCDM
actor to the remote media engine via MFMediaEngineChild in following
patches.

Depends on D171801

Depends on D171802

Depends on D171803

A quick update. Currently I encountered an error of key mismatching while connecting MFCDM into the media engine pipeline. First, there is a class SamplesWaitingForKey that would guard the decoding until we get a usable keyid. It would use the keyId in the sample to set a listener on CDMCap. When keyid becomes usable in the MFCDM process, we get a keyid from the key session, and send it back to the content process. When we set that received keyid in the content process, we would set it on CDMCap and CDMcap would notify the listener if it find any matched keyid.

However, when I tested this on dash.js, I found the keyIds from samples are different from the keyIds from the key session, so SamplesWaitingForKey would never be notified about the key being usable. Currently, I don't have much progress on this issue.

In addition, I also used this tool to parse the pssh box from the init data, and see another keyid (<KID>....</KID) which is even different from above two (from sample/from key session). So maybe we don't actually need to wait for key? Because now we won't even decrypt samples, decrypt + decode would all happen inside the MFCDM.

One interesting thing I found in EME spec is this, which might indicate expecting the keyId in the first sample equal to the key Id in the init data is not correct.

However, there is no requirement that Initialization Data contain any or all key IDs used in the media data or media resource.

Now I don't have any good explanation or method to handle this issue, I will split it into another bug and try to land the basic patches in this bug first.

Attachment #9321513 - Attachment description: WIP: Bug 1820650 - part1 : add another layer for setting CDM proxy. → Bug 1820650 - part1 : add another layer for setting CDM proxy.
Attachment #9321514 - Attachment description: WIP: Bug 1820650 - part2 : send CDM proxy id to the MF CDM process. → Bug 1820650 - part2 : send CDM proxy id to the MF CDM process.
Attachment #9321515 - Attachment description: WIP: Bug 1820650 - part3 : print cdm id in the log. → Bug 1820650 - part3 : print cdm id in the log.
Attachment #9321516 - Attachment description: WIP: Bug 1820650 - part4 : set CDMProxy to the media engine. → Bug 1820650 - part4 : set CDMProxy to the media engine.
Attachment #9321517 - Attachment description: WIP: Bug 1820650 - part5 : fix incorrect assertion. → Bug 1820650 - part5 : fix incorrect assertion.

We didn't set the length of aByteArrayOut before, which results in an
empty array size, so its content didn't get passed over IPC.

Depends on D171804

Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e0a4ae573d25
part1 : add another layer for setting CDM proxy. r=jolin
https://hg.mozilla.org/integration/autoland/rev/751bdba95291
part2 : send CDM proxy id to the MF CDM process. r=jolin
https://hg.mozilla.org/integration/autoland/rev/d3a683a93cf7
part3 : print cdm id in the log. r=jolin
https://hg.mozilla.org/integration/autoland/rev/cf79d0de211f
part4 : set CDMProxy to the media engine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/59d2d028031c
part5 : fix incorrect assertion. r=jolin
https://hg.mozilla.org/integration/autoland/rev/4ef516b179bf
part6 : fix empty key id and print it out in the log. r=jolin

Backed out for causing bustages on RefPtr.h

Backout link

Push with failures

Failure log

Flags: needinfo?(alwu)
Flags: needinfo?(alwu)

Try result looks good.

Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f9ed9cd299e9
part1 : add another layer for setting CDM proxy. r=jolin
https://hg.mozilla.org/integration/autoland/rev/4af290b14c8f
part2 : send CDM proxy id to the MF CDM process. r=jolin
https://hg.mozilla.org/integration/autoland/rev/a1fe2a6536e9
part3 : print cdm id in the log. r=jolin
https://hg.mozilla.org/integration/autoland/rev/a33ca6190ab1
part4 : set CDMProxy to the media engine. r=jolin
https://hg.mozilla.org/integration/autoland/rev/2a3f0707a210
part5 : fix incorrect assertion. r=jolin
https://hg.mozilla.org/integration/autoland/rev/ecc2d74ea855
part6 : fix empty key id and print it out in the log. r=jolin
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: