def test_full_box_header():
    bs = pack("uintbe:32, bytes:4, uintbe:8, bits:24", 100, b"abcd", 1,
              b"\x00\x00\x07")
    box_header = Parser.parse_header(bs)
    full_box_header = FullBoxHeader()
    full_box_header.extend_header(bs, box_header)
    del box_header

    assert full_box_header.start_pos == 0
    assert full_box_header.type == b"abcd"
    assert full_box_header.box_size == 100
    assert full_box_header.header_size == 12
    assert full_box_header.content_size == 88
    assert full_box_header.version == 1
    assert full_box_header.flags == b"\x00\x00\x07"

    assert bytes(full_box_header) == bs.bytes
Exemple #2
0
 def parse_box(cls, bstr, header):
     full_box_header = FullBoxHeader()
     full_box_header.extend_header(bstr, header)
     del header
     return super().parse_box(bstr, full_box_header)