PSSH: Remove from_init_data()

This is unused and will soon be unnecessary.
This commit is contained in:
rlaphoenix 2022-07-30 02:21:02 +01:00
parent 676110c01e
commit 8f7cacb10a
1 changed files with 0 additions and 22 deletions

View File

@ -22,28 +22,6 @@ class PSSH:
def __init__(self, box: Container): def __init__(self, box: Container):
self._box = box self._box = box
@staticmethod
def from_init_data(init_data: Union[str, bytes, WidevinePsshData]) -> Container:
"""Craft a new PSSH Box from just Widevine PSSH Data (init data)."""
if isinstance(init_data, str):
init_data = base64.b64decode(init_data)
if isinstance(init_data, bytes):
cenc_header = WidevinePsshData()
cenc_header.ParseFromString(init_data)
init_data = cenc_header
if not isinstance(init_data, WidevinePsshData):
raise ValueError(f"Unexpected value for init_data, {init_data!r}")
box = Box.parse(Box.build(dict(
type=b"pssh",
version=0,
flags=0,
system_ID=PSSH.SystemId.Widevine,
init_data=init_data.SerializeToString()
)))
return box
@staticmethod @staticmethod
def from_playready_pssh(box: Container) -> Container: def from_playready_pssh(box: Container) -> Container:
""" """