Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(UI16, 'MaXPDUSize'),
(UI16, 'AvgPDUSize'),
(UI32, 'MaxBitRate'),
(UI32, 'AvgBitRate'),
(UI32, 'Reserved'),
]
@Boxes.define
class nmhd(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
]
@Boxes.define
class dinf(BOXLIST): pass
@Boxes.define
class dref(pstruct.type):
class DataEntryBox(BOX): pass
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'EntryCount'),
(lambda s: dyn.array(s.DataEntryBox, s['EntryCount'].li.int()), 'DataEntry'),
]
@Boxes.define
class url(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'EntryCount'),
(lambda s: dyn.array(s.DataEntryBox, s['EntryCount'].li.int()), 'DataEntry'),
]
@Boxes.define
class url(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
]
@Boxes.define
class stbl(BOXLIST): pass
@Boxes.define
class stsd(pstruct.type):
class DESCRIPTIONRECORD(BOX): pass
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'Count'),
(lambda s: dyn.array(DESCRIPTIONRECORD, s['Count'].li.int()), 'Descriptions'),
]
@Boxes.define
class stts(pstruct.type):
class STTSRECORD(pstruct.type):
_fields_ = [(UI32,'SampleCount'),(UI32,'SampleDelta')]
_fields_ = [
@Boxes.define
class meta(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(BOXLIST, 'Boxes'),
]
@Boxes.define
class free(ptype.block): pass
@Boxes.define
class skip(ptype.block): pass
@Boxes.define
class mfra(BOXLIST): pass
@Boxes.define
class tfra(pstruct.type):
class LengthSize(pbinary.struct):
_fields_ = [(26,'Reserved'),(2,'TrafNumMinus1'),(2,'TrunNumMinus1'),(2,'SampleNumMinus1')]
class RandomAccessStructure(pstruct.type):
_fields_ = [
(lambda s: UI64 if s.getparent(tfra)['Version'].li.int() == 1 else UI32, 'Time'),
(lambda s: UI64 if s.getparent(tfra)['Version'].li.int() == 1 else UI32, 'MoofOffset'),
(lambda s: (UI8,UI16,UI24,UI32)[s.getparent(tfra)['LengthSize'].li['TrafNumMinus1']], 'TrafNumber'),
(lambda s: (UI8,UI16,UI24,UI32)[s.getparent(tfra)['LengthSize'].li['TrunNumMinus1']], 'TrunNumber'),
(lambda s: (UI8,UI16,UI24,UI32)[s.getparent(tfra)['LengthSize'].li['SampleNumMinus1']], 'SampleNumber'),
]
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
@Boxes.define
class frma(pstruct.type):
_fields_ = [(UI32,'UnencryptedDataFormat')]
@Boxes.define
class schm(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'SchemeType'),
(UI32, 'SchemeVersion'),
(lambda s: STRING if s['Flags'] == 1 else ptype.undefined, 'SchemeUri'),
]
@Boxes.define
class schi(BOXLIST): pass
@Boxes.define
class adkm(pstruct.type):
class AdobeDRMHeaderBox(BOX): pass
class AdobeDRMAUFormatBox(BOX): pass
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(AdobeDRMHeaderBox, 'Header'),
(AdobeDRMAUFormatBox, 'AUFormat'),
]
@Boxes.define
class ahdr(pstruct.type):
class StandardEncryptionParamsBox(BOX): pass
class AdobeSignatureBox(BOX): pass
(UI32, 'SyncCount'),
(lambda s: dyn.array(UI32, s['SyncCount'].li.int()), 'SyncTable'),
]
@Boxes.define
class sdtp(pstruct.type):
class SAMPLEDEPENDENCY(pbinary.struct):
_fields_ = [(2,name) for name in ('Reserved','SampleDependsOn','SampleIsDependedOn','SampleHasRedundancy')]
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(dyn.clone(parray.infinite, _object_=SAMPLEDEPENDENCY), 'SampleDependency'),
]
@Boxes.define
class mvex(BOXLIST): pass
@Boxes.define
class mehd(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(lambda s: UI32 if s['Version'] == 0 else UI64, 'FragmentDuration'),
]
@Boxes.define
class trex(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'TrackID'),
(UI32, 'DefaultSampleDescriptionIndex'),
_fields_ = [
(__versioned, 'SegmentDuration'),
(__sversioned, 'MediaTime'),
(SI16, 'MediaRateInteger'),
(SI16, 'MediaRateFraction'),
]
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'EntryCount'),
(lambda s: dyn.array(ELSTRECORD, s['EntryCount'].li.int()), 'EditListEntryTable'),
]
@Boxes.define
class mdia(BOXLIST): pass
@Boxes.define
class mdhd(pstruct.type):
__versioned = lambda s: UI32 if s.getparent(elst)['Version'].li.int() == 0 else UI64
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(__versioned, 'CreationTime'),
(__versioned, 'ModificationTime'),
(UI32, 'TimeScale'),
(__versioned, 'Duration'),
(Language, 'Language'),
(UI16, 'Reserved'),
]
@Boxes.define
]
@Boxes.define
class trex(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'TrackID'),
(UI32, 'DefaultSampleDescriptionIndex'),
(UI32, 'DefaultSampleDuration'),
(UI32, 'DefaultSampleSize'),
(SAMPLEFLAGS, 'DefaultSampleFlags'),
]
@Boxes.define
class udta(BOXLIST): pass
@Boxes.define
class moof(BOXLIST): pass
@Boxes.define
class mfhd(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'SequenceNumber'),
]
@Boxes.define
class traf(BOXLIST): pass
@Boxes.define
@Boxes.define
class udta(BOXLIST): pass
@Boxes.define
class moof(BOXLIST): pass
@Boxes.define
class mfhd(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'SequenceNumber'),
]
@Boxes.define
class traf(BOXLIST): pass
@Boxes.define
class tfhd(pstruct.type):
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'TrackID'),
(lambda s: UI64 if s['Flags'].li.int() & 0x01 else pint.uint_t, 'BaseDataOffset'),
(lambda s: UI32 if s['Flags'].li.int() & 0x02 else pint.uint_t, 'SampleDescriptionIndex'),
(lambda s: UI32 if s['Flags'].li.int() & 0x08 else pint.uint_t, 'DefaultSampleDuration'),
(lambda s: UI32 if s['Flags'].li.int() & 0x10 else pint.uint_t, 'DefaultSampleSize'),
(lambda s: SAMPLEFLAGS if s['Flags'].li.int() & 0x20 else pint.uint_t, 'DefaultSampleFlags'),
]
@Boxes.define
class trun(pstruct.type):
def __Payload(self):
bh = self['Header'].li
if bh['TotalSize'].int() == 0:
return BOXLIST
t, sz = bh['BoxType'].li.serialize(), bh.BoxSize()
result = Boxes.withdefault(t, __name__=t, length=sz)
return dyn.clone(result, blocksize=lambda s: sz)
(UI64, 'FirstFragmentTimestamp'),
(UI32, 'FragmentDuration'),
(lambda s: UI8 if s['FragmentDuration'].li.int() == 0 else pint.uint_t, 'DiscontinuityIndicator'),
]
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(UI32, 'TimeScale'),
(UI8, 'QualityEntryCount'),
(lambda s: dyn.array(STRING, s['QualityEntryCount'].li.int()), 'QualitySegmentUrlModifiers'),
(UI32, 'FragmentRunEntryCount'),
(lambda s: dyn.array(FRAGMENTRUNENTRY, s['FragmentRunEntryCount'].li.int()), 'FragmentRunEntryTable'),
]
@Boxes.define
class moov(BOXLIST): pass
@Boxes.define
class mvhd(pstruct.type):
__versioned = lambda s: UI32 if s['Version'].li.int() == 0 else UI64
_fields_ = [
(UI8, 'Version'),
(UI24, 'Flags'),
(__versioned, 'CreationTime'),
(__versioned, 'ModificationTime'),
(UI32, 'TimeScale'),
(__versioned, 'Duration'),
(SI16_16, 'Rate'),
(SI8_8, 'Volume'),
(UI16, 'Reserved(0)'),
(dyn.array(UI32,2), 'Reserved(1)'),
(dyn.array(SI32,9), 'Matrix'),