Dash-Industry-Forum / CPIX

25 stars 9 forks source link

Test Runner for EME/CDM based playback #73

Open haudiobe opened 5 years ago

haudiobe commented 5 years ago

All, below is an overview on how EME/CDM based playback can be started. Can we get this done by only using information on the MPD? This is related to a consistent content model for CTA WAVE. I highlighted what I consider would have to be provided in the manifest. Thanks Thomas 1.1.1 License Acquisition using the EME API Overview of license acquisition process and test runner using the EME API

  1. When a test playlist signals that a test may contain encrypted content, the test runner will query what key systems and configurations are supported using requestMediaKeySystemAccess(DOMString keySystem, sequence supportedConfigurations)

The sequence of MediaKeySystemConfiguration configurations are tried in order. The first element with a satisfiable configuration is used. A configuration is an audio/video content type, optionally including the ‘codecs’ subparameter.

  1. The test runner calls createMediaKeys() to create a new MediaKeys object for keySystem. This object has a sessionId, collects events, exposes the MediaKeyStatusMap, which lists KIDs known to the session and the status of each key.
  2. The test runner calls createSession() to start a MediaKeySession that groups all calls, messages, and events for this key. There can be multiple simultaneous sessions, e.g. for different audio and video keys, subsequent presentations, etc.
  3. When a license request is signaled, the test runner calls generateRequest(DOMString initDataType BufferSource initData) on the key session so the CDM will format a license request from DRM initData, as specified in https://www.w3.org/TR/eme-initdata-registry/ and https://www.w3.org/TR/eme-initdata-cenc/ Note that initData for ISOBMFF is specified as the payload of a ‘pssh’ box and represented in a DASH manifest as an element containing a base64 encoded ‘pssh’ box and an attribute equal to the SystemID of the DRM system. Although a ‘pssh’ box can be included in a file header for each DRM system supported (useful for downloaded files without a manifest), for streaming it is preferable to signal initData in the manifest, so it can be processed once and the necessary licenses can be identified and downloaded in advance of attempting to play the encrypted media.
  4. Application forwards CDM formatted license request to a license server for the selected key system, usually with an access token. A license server must encrypt a license or key with a key bound to the CDM under test, so dynamic generation and download of licenses is required during testing.
  5. The downloaded license is sent to the CDM by the test runner using update(BufferSource response).
  6. The runner may need to create additional sessions and license requests for additional key IDs used by other audio or video Switching Sets and start playback when all the necessary keys have been updated on the CDM.
haudiobe commented 5 years ago

All,

I’ve posted a proposal here: https://github.com/cta-wave/device-playback-task-force/issues/56

Feel free to comment

— Stefan Pham

sandersaares commented 5 years ago

Self-contained content (e.g. playback from local storage) - where does the key go?

@sandersaares review and compare with workflows in https://github.com/Dash-Industry-Forum/DASH-IF-IOP/pull/343