/// <summary> /// Parse this tag /// </summary> /// <param name="reader"></param> public void Parse(MXFReader reader) { if (this.Size == 1) { this.Value = reader.ReadB(); } else if (this.Size == 2) { this.Value = reader.ReadW(); } else if (this.Size == 4) { this.Value = reader.ReadD(); } else if (this.Size == 8) { this.Value = reader.ReadL(); } else { byte[] data = new byte[this.Size]; for (int n = 0; n < this.Size; n++) { data[n] = reader.ReadB(); } this.Value = data; } }
public MXFEntryIndex(UInt64 index, MXFReader reader, byte?sliceCount, byte?posTableCount, UInt32 length) : base(reader) { this.m_eType = MXFObjectType.Index; this.Length = length; this.Index = index; this.TemporalOffset = reader.ReadsB(); this.KeyFrameOffset = reader.ReadsB(); this.Flags = reader.ReadB(); this.StreamOffset = reader.ReadL(); if (sliceCount.HasValue && sliceCount.Value > 0) { this.SliceOffsets = new UInt32[sliceCount.Value]; for (int n = 0; n < sliceCount; n++) { this.SliceOffsets[n] = reader.ReadD(); } } if (posTableCount.HasValue && posTableCount.Value > 0) { this.PosTable = new MXFRational[posTableCount.Value]; for (int n = 0; n < posTableCount; n++) { this.PosTable[n] = reader.ReadRational(); } } }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x3D0A: this.BlockAlign = reader.ReadW(); return(true); case 0x3D0B: this.SequenceOffset = reader.ReadB(); return(true); case 0x3D09: this.AveragesBytesPerSecond = reader.ReadD(); return(true); case 0x3D32: this.ChannelAssignment = reader.ReadKey(); return(true); case 0x3D29: this.PeakEnvelopeVersion = reader.ReadD(); return(true); case 0x3D2A: this.PeakEnvelopeFormat = reader.ReadD(); return(true); case 0x3D2B: this.PointsPerPeakValue = reader.ReadD(); return(true); case 0x3D2C: this.PeakEnvelopeBlockSize = reader.ReadD(); return(true); case 0x3D2D: this.PeakChannels = reader.ReadD(); return(true); case 0x3D2E: this.PeakFrames = reader.ReadD(); return(true); case 0x3D2F: this.PeakOfPeaksPosition = reader.ReadL(); return(true); case 0x3D30: this.PeakEnvelopeTimestamp = reader.ReadTimestamp(); return(true); case 0x3D31: this.PeakEnvelopeData = new byte[localTag.Size]; reader.Read(this.PeakEnvelopeData, localTag.Size); return(true); } return(base.ParseLocalTag(reader, localTag)); }
public MXFEntryRIP(MXFReader reader) : base(reader) { this.m_eType = MXFObjectType.RIP; this.BodySID = reader.ReadD(); this.PartitionOffset = reader.ReadL(); this.Length = 12; // Fixed length }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x4B01: this.EditRate = reader.ReadRational(); return(true); case 0x4B02: this.Origin = reader.ReadL(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x0201: this.DataDefinition = reader.ReadKey(); return(true); case 0x0202: this.Duration = reader.ReadL(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x0601: this.EventStartPosition = reader.ReadL(); return(true); case 0x0602: this.EventComment = reader.ReadS(localTag.Size); return(true); } return(base.ParseLocalTag(reader, localTag)); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x1501: this.StartTimecode = reader.ReadL(); return(true); case 0x1502: this.RoundedTimecodeBase = reader.ReadW(); return(true); case 0x1503: this.DropFrame = (reader.ReadB() != 0); return(true); } return(base.ParseLocalTag(reader, localTag)); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x1201: this.StartPosition = reader.ReadL(); return(true); case 0x1101: this.SourcePackageID = reader.ReadUMIDKey(); return(true); case 0x1102: this.SourceTrackId = reader.ReadD(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x3006: this.LinkedTrackId = reader.ReadD(); return(true); case 0x3001: this.SampleRate = reader.ReadRational(); return(true); case 0x3002: this.ContainerDuration = reader.ReadL(); return(true); case 0x3004: this.EssenceContainer = reader.ReadKey(); return(true); case 0x3005: this.Codec = reader.ReadKey(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
public MXFPartition(MXFReader reader, MXFKLV headerKLV) : base(headerKLV, "Partition", KeyType.Partition) { this.m_eType = MXFObjectType.Partition; // Determine the partition type switch (this.Key[13]) { case 2: this.PartitionType = PartitionType.Header; break; case 3: this.PartitionType = PartitionType.Body; break; case 4: this.PartitionType = PartitionType.Footer; break; default: this.PartitionType = PartitionType.Unknown; Log(MXFLogType.Error, "unknown partition type"); break; } this.Closed = (this.PartitionType == PartitionType.Footer) || (this.Key[14] & 0x01) == 0x00; this.Complete = (this.Key[14] > 2); // Make sure we read at the data position reader.Seek(this.DataOffset); reader.ReadD(); // Skip 4 bytes this.KagSize = reader.ReadD(); this.ThisPartition = reader.ReadL(); this.PreviousPartition = reader.ReadL(); this.FooterPartition = reader.ReadL(); this.HeaderByteCount = reader.ReadL(); this.IndexByteCount = reader.ReadL(); this.IndexSID = reader.ReadD(); this.BodyOffset = reader.ReadL(); this.BodySID = reader.ReadD(); this.OP = new MXFKey(reader, 16); MXFObject essenceContainers = reader.ReadKeyList("Essence Containers", "Essence Container"); this.AddChild(essenceContainers); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x3F05: this.EditUnitByteCount = reader.ReadD(); return(true); case 0x3F06: this.IndexSID = reader.ReadD(); return(true); case 0x3F07: this.BodySID = reader.ReadD(); return(true); case 0x3F08: this.SliceCount = reader.ReadB(); return(true); case 0x3F0C: this.IndexStartPosition = reader.ReadL(); return(true); case 0x3F0D: this.IndexDuration = reader.ReadL(); return(true); case 0x3F0E: this.PosTableCount = reader.ReadB(); return(true); case 0x3F0F: this.ExtStartOffset = reader.ReadL(); return(true); case 0x3F10: this.VBEByteCount = reader.ReadL(); return(true); case 0x3F0B: this.IndexEditRate = reader.ReadRational(); return(true); case 0x3F0A: // Index entry array { UInt32 NbIndexEntries = reader.ReadD(); UInt32 entryLength = reader.ReadD(); if (NbIndexEntries > 0) { this.IndexEntries = new List <MXFEntryIndex>(); MXFObject indexCollection = new MXFNamedObject("IndexEntries", reader.Position, MXFObjectType.Index); for (UInt64 i = 0; i < NbIndexEntries; i++) { long next = reader.Position + entryLength; MXFEntryIndex newEntry = new MXFEntryIndex((ulong)this.IndexStartPosition + i, reader, this.SliceCount, this.PosTableCount, entryLength); this.IndexEntries.Add(newEntry); // Also add this entry to the local list // And to the child collection indexCollection.AddChild(newEntry); reader.Seek(next); } this.AddChild(indexCollection); } } return(true); case 0x3F09: // Delta entry array { UInt32 NbDeltaEntries = reader.ReadD(); UInt32 entryLength = reader.ReadD(); if (NbDeltaEntries > 0) { MXFObject deltaCollection = new MXFNamedObject("DeltaEntries", reader.Position, MXFObjectType.Index); for (int i = 0; i < NbDeltaEntries; i++) { long next = reader.Position + entryLength; deltaCollection.AddChild(new MXFEntryDelta(reader, entryLength)); reader.Seek(next); } this.AddChild(deltaCollection); } } return(true); } return(base.ParseLocalTag(reader, localTag)); }