internal TrackEntry(Stream stream) { List <BlockAdditionMapping> blockAdditionMappinglist = null; List <string> codecInfoURLlist = null; List <string> codecDownloadURLlist = null; List <ulong> trackOverlaylist = null; List <TrackTranslate> trackTranslatelist = null; ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.TrackNumber: trackNumber = reader.readUlong(); break; case eElement.TrackUID: trackUID = reader.readUlong(); break; case eElement.TrackType: trackType = (eTrackType)reader.readByte(); break; case eElement.FlagEnabled: flagEnabled = (byte)reader.readUint(1); break; case eElement.FlagDefault: flagDefault = (byte)reader.readUint(1); break; case eElement.FlagForced: flagForced = (byte)reader.readUint(0); break; case eElement.FlagLacing: flagLacing = (byte)reader.readUint(1); break; case eElement.MinCache: minCache = reader.readUlong(0); break; case eElement.MaxCache: maxCache = reader.readUlong(); break; case eElement.DefaultDuration: defaultDuration = reader.readUlong(); break; case eElement.DefaultDecodedFieldDuration: defaultDecodedFieldDuration = reader.readUlong(); break; case eElement.TrackOffset: trackOffset = reader.readInt(0); break; case eElement.MaxBlockAdditionID: maxBlockAdditionID = reader.readUlong(0); break; case eElement.BlockAdditionMapping: if (null == blockAdditionMappinglist) { blockAdditionMappinglist = new List <BlockAdditionMapping>(); } blockAdditionMappinglist.Add(new BlockAdditionMapping(stream)); break; case eElement.Name: name = reader.readUtf8(); break; case eElement.Language: language = reader.readAscii(); break; case eElement.LanguageIETF: languageIETF = reader.readAscii(); break; case eElement.CodecID: codecID = reader.readAscii(); break; case eElement.CodecPrivate: codecPrivate = reader.readByteArray(); break; case eElement.CodecName: codecName = reader.readUtf8(); break; case eElement.AttachmentLink: attachmentLink = reader.readUlong(); break; case eElement.CodecSettings: codecSettings = reader.readUtf8(); break; case eElement.CodecInfoURL: if (null == codecInfoURLlist) { codecInfoURLlist = new List <string>(); } codecInfoURLlist.Add(reader.readAscii()); break; case eElement.CodecDownloadURL: if (null == codecDownloadURLlist) { codecDownloadURLlist = new List <string>(); } codecDownloadURLlist.Add(reader.readAscii()); break; case eElement.CodecDecodeAll: codecDecodeAll = (byte)reader.readUint(1); break; case eElement.TrackOverlay: if (null == trackOverlaylist) { trackOverlaylist = new List <ulong>(); } trackOverlaylist.Add(reader.readUlong()); break; case eElement.CodecDelay: codecDelay = reader.readUlong(0); break; case eElement.SeekPreRoll: seekPreRoll = reader.readUlong(0); break; case eElement.TrackTranslate: if (null == trackTranslatelist) { trackTranslatelist = new List <TrackTranslate>(); } trackTranslatelist.Add(new TrackTranslate(stream)); break; case eElement.Video: video = new Video(stream); break; case eElement.Audio: audio = new Audio(stream); break; case eElement.TrackOperation: trackOperation = new TrackOperation(stream); break; case eElement.TrickTrackUID: trickTrackUID = reader.readUlong(); break; case eElement.TrickTrackSegmentUID: trickTrackSegmentUID = reader.readGuid(); break; case eElement.TrickTrackFlag: trickTrackFlag = reader.readUlong(0); break; case eElement.TrickMasterTrackUID: trickMasterTrackUID = reader.readUlong(); break; case eElement.TrickMasterTrackSegmentUID: trickMasterTrackSegmentUID = reader.readGuid(); break; case eElement.ContentEncodings: contentEncodings = new ContentEncodings(stream); break; default: reader.skipElement(); break; } } if (blockAdditionMappinglist != null) { blockAdditionMapping = blockAdditionMappinglist.ToArray(); } if (codecInfoURLlist != null) { codecInfoURL = codecInfoURLlist.ToArray(); } if (codecDownloadURLlist != null) { codecDownloadURL = codecDownloadURLlist.ToArray(); } if (trackOverlaylist != null) { trackOverlay = trackOverlaylist.ToArray(); } if (trackTranslatelist != null) { trackTranslate = trackTranslatelist.ToArray(); } }
internal BlockGroup(Stream stream) { block = default; blockVirtual = default; blockAdditions = default; blockDuration = default; referencePriority = 0; referenceBlock = default; referenceVirtual = default; codecState = default; discardPadding = default; slices = default; referenceFrame = default; List <int> referenceBlocklist = null; ElementReader reader = new ElementReader(stream); while (!reader.EOF) { eElement id = reader.readElementId(); switch (id) { case eElement.Block: block = Blob.read(reader); break; case eElement.BlockVirtual: blockVirtual = Blob.read(reader); break; case eElement.BlockAdditions: blockAdditions = new BlockAdditions(stream); break; case eElement.BlockDuration: blockDuration = reader.readUlong(); break; case eElement.ReferencePriority: referencePriority = reader.readUlong(0); break; case eElement.ReferenceBlock: if (null == referenceBlocklist) { referenceBlocklist = new List <int>(); } referenceBlocklist.Add(reader.readInt()); break; case eElement.ReferenceVirtual: referenceVirtual = reader.readInt(); break; case eElement.CodecState: codecState = reader.readByteArray(); break; case eElement.DiscardPadding: discardPadding = reader.readInt(); break; case eElement.Slices: slices = new Slices(stream); break; case eElement.ReferenceFrame: referenceFrame = new ReferenceFrame(stream); break; default: reader.skipElement(); break; } } if (referenceBlocklist != null) { referenceBlock = referenceBlocklist.ToArray(); } }