示例#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 0x3D0D: this.Emphasis = (MXFEmphasis)reader.ReadByte(); return(true);

            case 0x3D0F: this.BlockStartOffset = reader.ReadUInt16(); return(true);

            case 0x3D08: this.AuxiliaryBitsMode = (MXFAuxBitsMode)reader.ReadByte(); return(true);

            case 0x3D10: this.ChannelStatusMode = reader.ReadArray(reader.ReadChannelstatusMode, 8); return(true);

            case 0x3D11:
                this.FixedChannelStatusData = reader.ReadArray(reader.ReadByte, localTag.Size);
                return(true);

            case 0x3D12:
                this.UserDataMode = reader.ReadArray(reader.ReadUserDataMode, 2); return(true);

            case 0x3D13:
                this.FixedUserData = reader.ReadArray(reader.ReadByte, localTag.Size);
                return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#2
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 0x5801: this.DynamicSourcePackageID = reader.ReadUMIDKey(); return(true);

            case 0x5802: reader.ReadArray(reader.ReadUInt32, localTag.Size); return(true);

            case 0x5803: this.SourceIndex = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

            case 0x5804: this.SourceSpecies = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#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 0x1101: this.SourcePackageID = reader.ReadUMIDKey(); return(true);

            case 0x1102: this.SourceTrackId = reader.ReadUInt32(); return(true);

            case 0x1103: this.ChannelIDs = reader.ReadArray(reader.ReadUInt32, localTag.Size); return(true);

            case 0x1104: this.MonoSourceTrackIDs = reader.ReadArray(reader.ReadUInt32, 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 0x3D0A: this.BlockAlign = reader.ReadUInt16(); return(true);

            case 0x3D0B: this.SequenceOffset = reader.ReadByte(); return(true);

            case 0x3D09: this.AverageBytesPerSecond = reader.ReadUInt32(); return(true);

            case 0x3D32: this.ChannelAssignment = reader.ReadULKey(); return(true);

            case 0x3D29: this.PeakEnvelopeVersion = reader.ReadUInt32(); return(true);

            case 0x3D2A: this.PeakEnvelopeFormat = reader.ReadUInt32(); return(true);

            case 0x3D2B: this.PointsPerPeakValue = reader.ReadUInt32(); return(true);

            case 0x3D2C: this.PeakEnvelopeBlockSize = reader.ReadUInt32(); return(true);

            case 0x3D2D: this.PeakChannels = reader.ReadUInt32(); return(true);

            case 0x3D2E: this.PeakFrames = reader.ReadUInt32(); return(true);

            case 0x3D2F: this.PeakOfPeaksPosition = reader.ReadUInt64(); return(true);

            case 0x3D30: this.PeakEnvelopeTimestamp = reader.ReadTimestamp(); return(true);

            case 0x3D31: this.PeakEnvelopeData = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#5
0
 public MXFCDPFuture(MXFReader reader, byte sectionID)
     : base(reader)
 {
     this.SectionID = sectionID;
     this.Length    = reader.ReadByte();
     this.Data      = reader.ReadArray(reader.ReadByte, (int)this.Length);
 }
示例#6
0
        public MXFANCPacket(MXFReader reader)
            : base(reader)
        {
            this.LineNumber            = reader.ReadUInt16();
            this.WrappingType          = (MXFANCWrappingType)reader.ReadByte();
            this.PayloadSamplingCoding = (MXFANCPayloadCoding)reader.ReadByte();
            this.PayloadSampleCount    = reader.ReadUInt16();

            this.Length = this.PayloadSampleCount;
            if (this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_luma_samples ||
                this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_color_difference_samples ||
                this.PayloadSamplingCoding == MXFANCPayloadCoding.Coding_10_bit_luma_and_color_difference_samples)
            {
                this.Length = 4 * (this.PayloadSampleCount / 3);                 // 3 samples are stored in 4 bytes
            }

            // Skip 8 bytes (seems to be data but cannot find any meaning in the spec!)
            UInt32 unknownData1 = reader.ReadUInt32();
            UInt32 unknownData2 = reader.ReadUInt32();

            // Length Alignment
            this.Length = 4 * ((this.Length + 3) / 4);

            if (this.Length > 3)
            {
                // Read the DID
                this.DID  = reader.ReadByte();
                this.SDID = reader.ReadByte();
                this.Size = reader.ReadByte();

                UInt16 combinedID = (UInt16)((((UInt16)this.DID) << 8) | this.SDID);
                if (m_DIDDescription.ContainsKey(combinedID))
                {
                    this.ContentDescription = m_DIDDescription[combinedID];
                }
                else
                {
                    this.ContentDescription = "<unknown content>";
                }

                switch (combinedID)
                {
                case 0x6101:                         // CDP
                    this.AddChild(new MXFCDPPacket(reader));
                    break;

                case 0x4105:                         // AFD
                    break;

                case 0x4302:                         // OP47
                    break;

                default:
                    // Read the real payload without the did/sdid/size
                    this.Payload = reader.ReadArray(reader.ReadByte, (int)(this.Length - 3));
                    break;
                }
            }
        }
示例#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 0x3101: this.AIFCSummary = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);
     }
     return(base.ParseLocalTag(reader, localTag));
 }
示例#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 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));
        }
示例#9
0
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            if (localTag.Key != null)
            {
                switch (localTag.Key)
                {
                case var _ when localTag.Key == rsiz: this.Rsiz = reader.ReadUInt16(); return(true);

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

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

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

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

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

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

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

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

                case var _ when localTag.Key == csiz: this.Csiz = reader.ReadUInt16(); return(true);

                case var _ when localTag.Key == pictureComponentSizing:
                    this.PictureComponentSizing = reader.ReadArray(reader.ReadByte, localTag.Size);
                    return(true);

                case var _ when localTag.Key == codingStyleDefault:
                    this.CodingStyleDefault = reader.ReadArray(reader.ReadByte, localTag.Size);
                    return(true);

                case var _ when localTag.Key == quantizationDefault:
                    this.QuantizationDefault = reader.ReadArray(reader.ReadByte, localTag.Size);
                    return(true);

                case var _ when localTag.Key == j2CLayout:
                    this.J2CLayout = reader.ReadRGBALayout();
                    return(true);
                }
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#10
0
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x5001: this.Tag = reader.ReadUTF16String(localTag.Size); return(true);

            case 0x5003: this.IndirectValue = reader.ReadArray <byte>(reader.ReadByte, localTag.Size); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#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 0x6103: this.DescriptiveClipDescribedTrackIDs =
         reader.ReadArray(reader.ReadUInt32, localTag.Size / sizeof(UInt32));
         return(true);
     }
     return(base.ParseLocalTag(reader, localTag));
 }
示例#12
0
 protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
 {
     if (localTag.Key != null)
     {
         switch (localTag.Tag)
         {
         case 0x3801: this.WaveSummary = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);
         }
     }
     return(base.ParseLocalTag(reader, localTag));
 }
示例#13
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));
        }
示例#14
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 0x5701: this.ToleranceMode = (MXFToleranceModeType)reader.ReadByte(); return(true);

            case 0x5703: this.ToleranceWindow = reader.ReadArray <byte>(reader.ReadByte, localTag.Size); return(true);

            // TODO replace generic MXFObject with class ApplicationPluginObject once implemented
            case 0x5702: this.AddChild(reader.ReadReference <MXFObject>("InterpolationDefinition")); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#15
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 0x0404: this.EdgeCodeHeader = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

            case 0x0401: this.EdgeCodeStart = reader.ReadUInt64(); return(true);

            case 0x0403: this.EdgeCodeFormat = (MXFEdgeType)reader.ReadUInt16(); return(true);

            case 0x0402: this.EdgeCodeFilmFormat = (MXFFilmType)reader.ReadUInt16(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#16
0
        /// <summary>
        /// Validate if the current position is a valid SMPTE key
        /// </summary>
        private MXFKey CreateAndValidateKey(MXFReader reader)
        {
            long originalPos = reader.Position;

            byte[] prefix = reader.ReadArray(reader.ReadByte, 4);
            bool   valid  = prefix.SequenceEqual(validULPrefix);

            // TODO does this really make sense checking key length if not valid whenever not equal to 16 bytes?
            // read the other bytes of the UL (length is defined in second byte minus two already read bytes)
            byte[] other    = reader.ReadArray(reader.ReadByte, prefix[1] - 2);
            byte[] keyBytes = prefix.Concat(other).ToArray();
            MXFKey key      = new MXFKey(keyBytes);

            // TODO the responsibility for checking the key should be moved to file MXFKey???
            // TODO check that none of the bytes excceds value 7F = 127 according to SMPTE298M
            if (!valid)
            {
                //throw new ApplicationException(string.Format("Invalid SMPTE Key found at offset {0}! Incorrect MXF file!", reader.Position - 4));
                LogError("Invalid SMPTE Key found at offset {0}! Key: {1}", reader.Position - 4, key.Name);
                throw new Exception(string.Format("Invalid SMPTE UL found at @{0}! Key: {1}", originalPos, key.ToString()));
            }
            return(key);
        }
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            switch (localTag.Tag)
            {
            case 0x2701: this.LinkedPackageID = reader.ReadUMIDKey(); return(true);

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

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

            case 0x2702: this.EssenceStream = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

            case 0x2B01: this.SampleIndex = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

            case var _ when localTag.Key == precedingIndexTable_Key: this.PrecedingIndexTable = reader.ReadBool(); return(true);

            case var _ when localTag.Key == followingIndexTable_Key: this.FollowingIndexTable = reader.ReadBool(); return(true);

            case var _ when localTag.Key == isSparse_Key: this.IsSparse = reader.ReadBool(); return(true);

            case var _ when localTag.Key == singularPartitionUsage_Key: this.SingularPartitionUsage = reader.ReadBool(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#18
0
        public MXFEntrySVCInfo(MXFReader reader)
            : base(reader)
        {
            this.Length = 7;             // Fixed

            byte b0 = reader.ReadByte();

            if ((b0 & 0x40) != 0)
            {
                this.CaptionServiceNumber = (byte)(b0 & 0x1F);
            }
            else
            {
                this.CaptionServiceNumber = (byte)(b0 & 0x3F);
            }

            this.Data = reader.ReadArray(reader.ReadByte, 6);

            this.DataString = System.Text.Encoding.ASCII.GetString(this.Data);
        }
示例#19
0
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            if (localTag.Key != null)
            {
                switch (localTag.Tag)
                {
                case 0x3706: this.TIFFSummary = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

                case 0x3703: this.LeadingLines = reader.ReadInt32(); return(true);

                case 0x3704: this.TrailingLines = reader.ReadInt32(); return(true);

                case 0x3701: this.IsUniform = reader.ReadBool(); return(true);

                case 0x3705: this.JPEGTableID = reader.ReadInt32(); return(true);

                case 0x3702: this.IsContiguous = reader.ReadBool(); 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 0x3406: this.ComponentMaxRef = reader.ReadUInt32(); return(true);

            case 0x3407: this.ComponentMinRef = reader.ReadUInt32(); return(true);

            case 0x3408: this.AlphaMaxRef = reader.ReadUInt32(); return(true);

            case 0x3409: this.AlphaMinRef = reader.ReadUInt32(); return(true);

            case 0x3405: this.ScanningDirection = (MXFScanningDirectionType)reader.ReadByte(); return(true);

            case 0x3401: this.PixelLayout = reader.ReadRGBALayout(); return(true);

            case 0x3403: this.Palette = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

            case 0x3404: this.PaletteLayout = reader.ReadRGBALayout(); return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#21
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 0x6102:
                this.DescribedTrackIDs = reader.ReadArray(reader.ReadUInt32, localTag.Size / sizeof(UInt32));
                return(true);

            case 0x6101: this.AddChild(reader.ReadReference <MXFDescriptiveFramework>("DescriptiveFrameworkObject")); return(true);

            case var _ when localTag.Key == metadataScheme_Key:
                this.DescriptiveMetadataScheme = reader.ReadULKey();
                return(true);

            case var _ when localTag.Key == metadataPlugInID_Key: this.DescriptiveMetadataPlugInID = reader.ReadUUIDKey(); return(true);

            case var _ when localTag.Key == metadataApplicationEnvironmentID_Key:
                this.DescriptiveMetadataApplicationEnvironmentID = reader.ReadUTF16String(localTag.Size);
                return(true);
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#22
0
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            if (localTag.Key != null)
            {
                switch (localTag.Key)
                {
                case var _ when localTag.Key == commObjects_Key:
                    this.AddChild(reader.ReadReferenceSet <MXFDescriptiveObject>("CommunicationObjects", "CommunicationObject"));
                    return(true);

                // TODO replace generic MXFObject with class NameValue once implemented
                case var _ when localTag.Key == addrNameValueObjects_Key:
                    this.AddChild(reader.ReadReferenceSet <MXFObject>("AddressNameValueObjects", "AddressNameValueObject"));
                    return(true);

                case var _ when localTag.Key == roomSuiteNumber_Key:
                    this.RoomSuiteNumber = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == streetNumber_Key:
                    this.StreetNumber = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == streetName_Key:
                    this.StreetNumber = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == postalTown_Key:
                    this.PostalTown = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == city_Key:
                    this.City = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == stateProvinceCountry_Key:
                    this.StateProvinceCounty = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == postalCode_Key:
                    this.PostalCode = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == country_Key:
                    this.Country = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == roomSuiteName_Key:
                    this.RoomSuiteName = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == buildingName_Key:
                    this.BuildingName = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == placeName_Key:
                    this.PlaceName = reader.ReadUTF16String(localTag.Size);
                    return(true);

                case var _ when localTag.Key == geoCoordinates_Key:
                    this.GeographicalCoordinates = reader.ReadArray(reader.ReadByte, 12);
                    return(true);

                case var _ when localTag.Key == astroBodyName_Key:
                    this.AstronomicalBodyName = reader.ReadUTF16String(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)
        {
            if (localTag.Key != null)
            {
                switch (localTag.Key)
                {
                case var _ when localTag.Key == aCESAuthoringInformation_Key: this.ACESAuthoringInformation = reader.ReadUTF16String(localTag.Size); return(true);

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

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

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

                case var _ when localTag.Key == aCESMasteringDisplayMinimumLuminance_Key: this.ACESMasteringDisplayMinimumLuminance = reader.ReadUInt32(); return(true);
                }
            }
            return(base.ParseLocalTag(reader, localTag));
        }
示例#24
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));
        }
示例#25
0
        // Add all meta data see spec: SMPTE ST 331:2011
        private void ParseElements(MXFReader reader)
        {
            reader.Seek(this.DataOffset); // Seek to the start of the data

            long end = this.DataOffset + this.Length;

            byte[] byteArray;

            while (reader.Position < end)
            {
                var(Tag, Size) = GetTag(reader);
                var pos = reader.Position;

                switch (Tag)
                {
                // Metadata link
                case 0x80:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "Metadata link", pos, Size));
                    break;

                // SMPTE 12M time-code
                case 0x81:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "SMPTE 12M time-code", pos, Size));
                    break;

                // SMPTE 309M date-time stamp
                case 0x82:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "SMPTE 309M date-time stamp", pos, Size));
                    break;

                // UMID
                case 0x83:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    if (Size == 64)
                    {
                        var umid = new MXFExtendedUMID(byteArray);
                        this.AddChild(new MXFWrapperObject <MXFExtendedUMID>(umid, "ExtendedUMID", pos, Size));
                    }
                    else if (Size == 32)
                    {
                        var umid = new MXFUMID(byteArray);
                        this.AddChild(new MXFWrapperObject <MXFUMID>(umid, "UMID", pos, Size));
                    }
                    else
                    {
                        Debug.WriteLine("Invalid tag size for UMID. Must be 32 bytes or 64 for extended UMID");
                    }
                    break;

                // MPEG-2 picture editing
                case 0x84:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "MPEG-2 picture editing", pos, Size));
                    break;

                // 8-channel AES3 editing
                case 0x85:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "8-channel AES3 editing", pos, Size));
                    break;

                // Picture bit-stream splicing
                case 0x86:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "Picture bit-stream splicing", pos, Size));
                    break;

                // MPEG decoder buffer delay
                case 0x87:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "MPEG decoder buffer delay", pos, Size));
                    break;

                // KLV metadata
                case 0x88:
                    var obj = new MXFKLVFactory().CreateObject(reader, this.Partition);
                    this.AddChild(obj);
                    break;

                // AES3 non-audio metadata
                case 0x89:
                    byteArray = reader.ReadArray(reader.ReadByte, (int)Size);
                    this.AddChild(new MXFWrapperObject <byte[]>(byteArray, "AES3 non-audio metadata", pos, Size));
                    break;

                default:
                    break;
                }

                // seek to next tag position
                reader.Seek(pos + Size);
            }
        }
        /// <summary>
        /// Overridden method to process local tags
        /// </summary>
        /// <param name="localTag"></param>
        protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag)
        {
            if (localTag.Key != null)
            {
                switch (localTag.Key)
                {
                case var _ when localTag.Key == initMetadata_Key: this.VC1InitializationMetadata = reader.ReadArray(reader.ReadByte, localTag.Size); return(true);

                case var _ when localTag.Key == singleSequence_Key: this.VC1SingleSequence = reader.ReadBool(); return(true);

                case var _ when localTag.Key == codedContent_Key: this.VC1CodedContentType = (MXFCodedContentScanning)reader.ReadByte(); return(true);

                case var _ when localTag.Key == identicalGOP_Key: this.VC1IdenticalGOP = reader.ReadBool(); return(true);

                case var _ when localTag.Key == maxGOP_Key: this.VC1MaxGOP = reader.ReadUInt16(); return(true);

                case var _ when localTag.Key == pictureCount_Key: this.VC1BPictureCount = reader.ReadUInt16(); return(true);

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

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

                case var _ when localTag.Key == profile_Key: this.VC1Profile = reader.ReadByte(); return(true);

                case var _ when localTag.Key == level_Key: this.VC1Level = reader.ReadByte(); return(true);
                }
            }

            return(base.ParseLocalTag(reader, localTag));
        }