Skip to main content

Module drm

Module drm 

Source
Expand description

System-specific pssh payload decoding.

The data blob inside a Protection System Specific Header box (ISO 23001-7) is opaque at the ISO-BMFF level; its format is defined by each DRM system. This module decodes the two formats seen in practice:

  • Widevine: a small protobuf (WidevinePsshData in Google’s schema).
  • PlayReady: a PlayReady Object — little-endian length-prefixed records carrying a UTF-16LE WRMHEADER XML document.

It also parses raw pssh box bytes outside a file context (parse_pssh_boxes), the form carried by DASH cenc:pssh manifest elements and pasted around in logs and tickets.

Structs§

PlayReadyPsshData
Decoded PlayReady pssh payload (PlayReady Object + WRMHEADER).
WidevinePsshData
Decoded Widevine pssh payload (the WidevinePsshData protobuf).

Constants§

PLAYREADY_SYSTEM_ID
WIDEVINE_SYSTEM_ID

Functions§

parse_playready_pssh_data
Parses a bare PlayReady pssh payload (a PlayReady Object). Returns None for anything that doesn’t carry a readable WRMHEADER record.
parse_pssh_boxes
Parses one or more concatenated raw pssh boxes — the form carried by DASH cenc:pssh manifest elements. Fails on anything that isn’t a well-formed pssh box, so callers can use it as a format probe.
parse_widevine_pssh_data
Parses a bare Widevine pssh payload. Returns None for anything that doesn’t decode cleanly as the Widevine protobuf, so it can double as a “is this Widevine data?” probe.
pssh_from_raw_widevine
Wraps a bare Widevine payload (protobuf without box framing, as found in packager logs) in a synthetic PsshData. Returns None when the bytes don’t decode as Widevine.