Esempio n. 1
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 0x8113: this.CameraSettingFileURI = reader.ReadUTF8String(localTag.Size); return(true);

            case 0x8114: this.CameraAttributes = reader.ReadUTF8String(localTag.Size); return(true);

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

            case 0x8106: this.CaptureFrameRate = reader.ReadRational(); return(true);

            case 0x8100: this.AutoExposureMode = reader.ReadULKey(); return(true);

            case 0x8101: this.AutoFocusSensingAreaSetting = (MXFAutoFocusSensingAreaSetting)reader.ReadByte(); return(true);

            case 0x8102: this.ColorCorrectionFilterWheelSetting = (MXFColorCorrectionFilterWheelSetting)reader.ReadByte(); return(true);

            case 0x8103: this.NeutralDensityFilterWheelSetting = reader.ReadUInt16(); return(true);

            case 0x8104: this.ImageSensorDimensionEffectiveWidth = reader.ReadUInt16(); return(true);

            case 0x8105: this.ImageSensorDimensionEffectiveHeight = reader.ReadUInt16(); return(true);

            case 0x8107: this.ImageSensorReadoutMode = (MXFImageSensorReadoutMode)reader.ReadByte(); return(true);

            case 0x8108: this.ShutterSpeedAngle = reader.ReadUInt32(); return(true);

            case 0x8109: this.ShutterSpeedTime = reader.ReadRational(); return(true);

            case 0x810a: this.CameraMasterGainAdjustment = (short)reader.ReadUInt16(); return(true);

            case 0x810b: this.ISOSensitivity = reader.ReadUInt16(); return(true);

            case 0x810c: this.ElectricalExtenderMagnification = reader.ReadUInt16(); return(true);

            case 0x8115: this.ExposureIndexOfPhotoMeter = reader.ReadUInt16(); return(true);

            case 0x8118: this.ColorMatrix = reader.ReadArray(reader.ReadRational, localTag.Size); return(true);

            case 0x810d: this.AutoWhiteBalanceMode = (MXFAutoWhiteBalanceMode)reader.ReadByte(); return(true);

            case 0x810e: this.WhiteBalance = reader.ReadUInt16(); return(true);

            case 0x810f: this.CameraMasterBlackLevel = (short)reader.ReadUInt16(); return(true);

            case 0x8110: this.CameraKneePoint = reader.ReadUInt16(); return(true);

            case 0x8111: this.CameraKneeSlope = reader.ReadUInt16(); return(true);

            case 0x8112: this.CameraLuminanceDynamicRange = reader.ReadUInt16(); return(true);

            case 0x8116: this.GammaForCDL = reader.ReadByte(); return(true);
            }


            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 2
0
        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.ReadSignedByte();
            this.KeyFrameOffset = reader.ReadSignedByte();
            this.Flags          = new IndexEntryFlags(reader.ReadByte());
            this.StreamOffset   = reader.ReadUInt64();

            if (sliceCount.HasValue && sliceCount.Value > 0)
            {
                this.SliceOffsets = new UInt32[sliceCount.Value];
                for (int n = 0; n < sliceCount; n++)
                {
                    this.SliceOffsets[n] = reader.ReadUInt32();
                }
            }

            if (posTableCount.HasValue && posTableCount.Value > 0)
            {
                this.PosTable = new MXFRational[posTableCount.Value];
                for (int n = 0; n < posTableCount; n++)
                {
                    this.PosTable[n] = reader.ReadRational();
                }
            }
        }
Esempio n. 3
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 0x3D03: this.AudioSamplingRate = reader.ReadRational(); return(true);

            case 0x3D02: this.Locked = reader.ReadBool(); return(true);

            case 0x3D04: this.AudioRefLevel = reader.ReadSignedByte(); return(true);

            case 0x3D05: this.ElectroSpatialFormulation = (MXFElectroSpatialFormulation)reader.ReadByte(); return(true);

            case 0x3D07: this.ChannelCount = reader.ReadUInt32(); return(true);

            case 0x3D01: this.QuantizationBits = reader.ReadUInt32(); return(true);

            case 0x3D0C: this.DialNorm = reader.ReadSignedByte(); return(true);

            case 0x3D06: this.SoundEssenceCoding = reader.ReadULKey(); return(true);

            case var _ when localTag.Key == refImageEditRate_Key: this.ReferenceImageEditRate = reader.ReadRational(); return(true);

            case var _ when localTag.Key == refAudioAlignmentLevel: this.ReferenceAudioAlignmentLevel = reader.ReadByte(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 4
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 0x4901: this.EventTrackEditRate = reader.ReadRational(); return(true);

            case 0x4902: this.EventTrackOrigin = reader.ReadUInt64(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 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 0x1601: this.TimecodeStreamSampleRate = reader.ReadRational(); return(true);

            case 0x1603: this.TimecodeSource = (MXFTCSource?)reader.ReadByte(); return(true);

            case 0x1602: this.TimecodeStreamData = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);
            }

            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 6
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 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));
        }
Esempio n. 7
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 0x4B01: this.EditRate = reader.ReadRational(); return(true);

            case 0x4B02: this.Origin = reader.ReadUInt64(); return(true);

            case 0x4B03: this.MarkIn = reader.ReadUInt64(); return(true);

            case 0x4B05: this.UserPosition = reader.ReadUInt64(); return(true);

            case 0x4B06: this.PackageMarkInPosition = reader.ReadUInt64(); return(true);

            case 0x4B04: this.MarkOut = reader.ReadUInt64(); return(true);

            case 0x4B07: this.PackageMarkOutPosition = reader.ReadUInt64(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 8
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 0x3D03: this.AudioSamplingRate = reader.ReadRational(); return(true);

            case 0x3D02: this.Locked = reader.ReadBool(); return(true);

            case 0x3D04: this.AudioRefLevel = reader.ReadsB(); return(true);

            case 0x3D05: this.ElectroSpatialFormulation = reader.ReadB(); return(true);

            case 0x3D07: this.ChannelCount = reader.ReadD(); return(true);

            case 0x3D01: this.QuantizationBits = reader.ReadD(); return(true);

            case 0x3D0C: this.DialNorm = reader.ReadsB(); return(true);

            case 0x3D06: this.SoundEssenceCoding = reader.ReadKey(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 9
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));
        }
Esempio n. 10
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 = reader.ReadB(); return(true);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            case 0x320D:
                this.VideoLineMap    = new Int32[4];
                this.VideoLineMap[0] = (Int32)reader.ReadD();
                this.VideoLineMap[1] = (Int32)reader.ReadD();
                this.VideoLineMap[2] = (Int32)reader.ReadD();
                this.VideoLineMap[3] = (Int32)reader.ReadD();
                return(true);

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

            case 0x3210: this.TransferCharacteristics = reader.ReadKey(); return(true);

            case 0x3211: this.ImageAlignmentOffset = reader.ReadD(); return(true);

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

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

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

            case 0x3201: this.PictureEssenceCoding = reader.ReadKey(); return(true);

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

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

            //PropertyDescriptor prop = TypeDescriptor.GetProperties(typeof(MXFGenericPictureEssenceDescriptor))["StoredWidth"];
            //DescriptionAttribute attr = prop.Attributes[typeof(DescriptionAttribute)] as DescriptionAttribute;
            //FieldInfo fi = attr.GetType().GetField("description", BindingFlags.NonPublic | BindingFlags.Instance);
            //if (fi != null)
            //	fi.SetValue(attr, "DIT IS GELUKT!!!");

            return(base.ParseLocalTag(reader, localTag));
        }
Esempio n. 11
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 0x3F05: this.EditUnitByteCount = reader.ReadUInt32(); return(true);

            case 0x3F06: this.IndexSID = reader.ReadUInt32(); return(true);

            case 0x3F07: this.BodySID = reader.ReadUInt32(); return(true);

            case 0x3F08: this.SliceCount = reader.ReadByte(); return(true);

            case 0x3F0C: this.IndexStartPosition = reader.ReadUInt64(); return(true);

            case 0x3F0D: this.IndexDuration = reader.ReadUInt64(); return(true);

            case 0x3F0E: this.PosTableCount = reader.ReadByte(); return(true);

            case 0x3F0F: this.ExtStartOffset = reader.ReadUInt64(); return(true);

            case 0x3F10: this.VBEByteCount = reader.ReadUInt64(); return(true);

            case 0x3F11: this.SingleIndexLocation = reader.ReadBool(); return(true);

            case 0x3F12: this.SingleEssenceLocation = reader.ReadBool(); return(true);

            case 0x3F13: this.ForwardIndexDirection = reader.ReadBool(); return(true);

            case 0x3F0B: this.IndexEditRate = reader.ReadRational(); return(true);

            case 0x3F0A:                      // Index entry array
            {
                UInt32 NbIndexEntries = reader.ReadUInt32();
                UInt32 entryLength    = reader.ReadUInt32();
                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.ReadUInt32();
                UInt32 entryLength    = reader.ReadUInt32();
                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));
        }