mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 12:35:13 +00:00
feat(tracks): resume segment decryption and rolling merge through the segment store
This commit is contained in:
@@ -589,13 +589,13 @@ def test_hvcc_profile_tier_level_is_nonzero():
|
||||
assert level_idc != 0
|
||||
|
||||
|
||||
def piff_fragment(flags: int = 0x0, override: bool = False) -> bytes:
|
||||
def piff_fragment(flags: int = 0x0, override: bool = False, iv_size: int = 8) -> bytes:
|
||||
"""Minimal moof+mdat fragment carrying sample encryption in the PIFF uuid box."""
|
||||
ivs = b"".join(bytes([i]) * 8 for i in range(1, 3))
|
||||
ivs = b"".join(bytes([i]) * iv_size for i in range(1, 3))
|
||||
senc_payload = struct.pack(">I", 2) + ivs
|
||||
if override:
|
||||
flags |= 0x1
|
||||
senc_payload = b"\x00\x00\x01" + bytes([8]) + KID + senc_payload # AlgorithmID + IV_size + KID
|
||||
senc_payload = b"\x00\x00\x01" + bytes([iv_size]) + KID + senc_payload # AlgorithmID + IV_size + KID
|
||||
uuid_box = box(b"uuid", PIFF_SENC_UUID + bytes([0]) + flags.to_bytes(3, "big") + senc_payload)
|
||||
tfhd = full_box(b"tfhd", 0, 0x20000, struct.pack(">I", 1))
|
||||
trun = full_box(b"trun", 0, 0x1, struct.pack(">II", 2, 0)) # data_offset placeholder
|
||||
|
||||
Reference in New Issue
Block a user