コード例 #1
0
ファイル: MXFPreface.cs プロジェクト: rayden84/MXFInspect
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x3B02: this.LastModificationDate = reader.ReadTimestamp(); return(true);

            case 0x3B05: this.Version = reader.ReadVersion(); return(true);

            case 0x3B07: this.ObjectModelVersion = reader.ReadUInt32(); return(true);

            case 0x3B03: this.AddChild(reader.ReadReference <MXFContentStorage>("ContentStorage")); return(true);

            case 0x3B08: this.AddChild(reader.ReadReference <MXFGenericPackage>("PrimaryPackage")); return(true);

            case 0x3B09: this.OperationalPattern = reader.ReadULKey(); return(true);

            case 0x3B06: this.AddChild(reader.ReadReferenceSet <MXFIdentification>("Identifications", "Identification")); return(true);

            case 0x3B0A: this.AddChild(reader.ReadAUIDSet("EssenceContainers", "EssenceContainer")); return(true);

            // TODO review how the metadataschemes are read (especially if there are no schemes present)
            case 0x3B0B: this.AddChild(reader.ReadAUIDSet("Descriptive Metadata Schemes", "DM scheme")); return(true);

            case var _ when localTag.Key == isRIPPresent_Key: this.IsRIPPresent = reader.ReadBool(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
コード例 #2
0
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x001f: ExtendibleEnumerationElementNames = reader.ReadUTF16String(localTag.Size).Split((char)0x00); return(true);

            case 0x0020: this.AddChild(reader.ReadAUIDSet("ExtendibleEnumerationElementValues", "ExtendibleEnumerationElementValue")); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
コード例 #3
0
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x0013: this.AddChild(reader.ReadAUIDSet("TargetSet", "Target")); return(true);

            case 0x0012: WeakReferencedType = reader.ReadULKey(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
コード例 #4
0
ファイル: MXFPartition.cs プロジェクト: ngaullier/MXFInspect
        public MXFPartition(MXFReader reader, MXFKLV headerKLV)
            : base(headerKLV, "Partition", KeyType.Partition)
        {
            this.m_eType  = MXFObjectType.Partition;
            this.IsLoaded = false;

            // 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);

            this.MajorVersion = reader.ReadUInt16();
            this.MinorVersion = reader.ReadUInt16();

            this.KagSize           = reader.ReadUInt32();
            this.ThisPartition     = reader.ReadUInt64();
            this.PreviousPartition = reader.ReadUInt64();
            this.FooterPartition   = reader.ReadUInt64();
            this.HeaderByteCount   = reader.ReadUInt64();
            this.IndexByteCount    = reader.ReadUInt64();
            this.IndexSID          = reader.ReadUInt32();
            this.BodyOffset        = reader.ReadUInt64();
            this.BodySID           = reader.ReadUInt32();

            this.OP = reader.ReadULKey();

            MXFObject essenceContainers = reader.ReadAUIDSet("Essence Containers", "Essence Container");

            this.AddChild(essenceContainers);
        }
コード例 #5
0
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x3215: this.SignalStandard = (MXFSignalStandard)reader.ReadByte(); return(true);

            case 0x320C: this.FrameLayout = (MXFFrameLayout)reader.ReadByte(); return(true);

            case 0x3203: this.StoredWidth = reader.ReadUInt32(); return(true);

            case 0x3202: this.StoredHeight = reader.ReadUInt32(); return(true);

            case 0x3216: this.StoredF2Offset = reader.ReadInt32(); return(true);

            case 0x3205: this.SampledWidth = reader.ReadUInt32(); return(true);

            case 0x3204: this.SampledHeight = reader.ReadUInt32(); return(true);

            case 0x3206: this.SampledXOffset = reader.ReadInt32(); return(true);

            case 0x3207: this.SampledYOffset = reader.ReadInt32(); return(true);

            case 0x3208: this.DisplayHeight = reader.ReadUInt32(); return(true);

            case 0x3209: this.DisplayWidth = reader.ReadUInt32(); return(true);

            case 0x320A: this.DisplayXOffset = reader.ReadInt32(); return(true);

            case 0x320B: this.DisplayYOffset = reader.ReadInt32(); return(true);

            case 0x3217: this.DisplayF2Offset = reader.ReadInt32(); return(true);

            case 0x320E: this.ImageAspectRatio = reader.ReadRational(); return(true);

            case 0x3218: this.ActiveFormatDescriptor = reader.ReadByte(); return(true);

            case 0x320D: this.VideoLineMap = reader.ReadArray(reader.ReadInt32, 4); return(true);

            case 0x320F: this.AlphaTransparency = (MXFAlphaTransparencyType)reader.ReadByte(); return(true);

            case 0x3210: this.TransferCharacteristic = reader.ReadULKey(); return(true);

            case 0x3211: this.ImageAlignmentFactor = reader.ReadUInt32(); return(true);

            case 0x3213: this.ImageStartOffset = reader.ReadUInt32(); return(true);

            case 0x3214: this.ImageEndOffset = reader.ReadUInt32(); return(true);

            case 0x3212: this.FieldDominance = (MXFFieldNumber)reader.ReadByte(); return(true);

            case 0x3201: this.PictureCompression = reader.ReadULKey(); return(true);

            case 0x321A: this.CodingEquations = reader.ReadULKey(); return(true);

            case 0x3219: this.ColorPrimaries = reader.ReadULKey(); return(true);

            case var _ when localTag.Key == altCenterCuts_Key: this.AddChild(reader.ReadAUIDSet("AlternativeCenterCuts", "AlternativeCenterCut")); return(true);

            case var _ when localTag.Key == activeHeight_Key: this.ActiveHeight = reader.ReadUInt32(); return(true);

            case var _ when localTag.Key == activeWidth_Key: this.ActiveHeight = reader.ReadUInt32(); return(true);

            case var _ when localTag.Key == activeXOffset_Key: this.ActiveHeight = reader.ReadUInt32(); return(true);

            case var _ when localTag.Key == activeYOffset_Key: this.ActiveHeight = reader.ReadUInt32(); return(true);

            case var _ when localTag.Key == displayPrimaries_Key: this.MasteringDisplayPrimaries = reader.ReadArray(reader.ReadColorPrimary, 3);  return(true);

            case var _ when localTag.Key == displayWhitePointChromaticity_Key: this.MasteringDisplayWhitePointChromaticity = reader.ReadColorPrimary(); return(true);

            case var _ when localTag.Key == displayMaxLuminance_Key: this.MasteringDisplayMaximumLuminance = reader.ReadUInt32(); return(true);

            case var _ when localTag.Key == displayMinLuminance_Key: this.MasteringDisplayMinimumLuminance = reader.ReadUInt32(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }