/// <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)); }
public MXFAUID(MXFReader reader, string name) : base(reader.Position) { this.Name = name; this.Key = reader.ReadULKey(); this.Length = this.Key.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 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)); }
/// <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)); }
/// <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)); }
/// <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.ReadUInt32(); return(true); case 0x3001: this.SampleRate = reader.ReadRational(); return(true); case 0x3002: this.ContainerDuration = reader.ReadUInt64(); return(true); case 0x3004: this.EssenceContainer = reader.ReadULKey(); return(true); case 0x3005: this.Codec = reader.ReadULKey(); 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 0x3C0A: this.InstanceID = reader.ReadUUIDKey(); return(true); case 0x0102: this.LinkedGenerationID = reader.ReadULKey(); return(true); case 0x0101: this.ObjectClass = reader.ReadULKey(); return(true); // TODO replace generic MXFObject with class ApplicationPluginObject once implemented case var _ when localTag.Key == appPluginObjects_Key: this.AddChild(reader.ReadReferenceSet <MXFObject>("Application Plugin Objects", "Application Plugin Object")); 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 0x3E01: this.DataEssenceCoding = reader.ReadULKey(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
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)); }
protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x0011: ReferencedType = reader.ReadULKey(); return(true); // TODO maybe this is more appropriate? //case 0x0011: this.AddChild(reader.ReadReference<MXFTypeDefinition>("ReferencedType")); return true; } return(base.ParseLocalTag(reader, localTag)); }
public MXFSystemItem(MXFReader reader, MXFKLV headerKLV) : base(headerKLV, "SystemItem (CP)", KeyType.SystemItem) { this.m_eType = MXFObjectType.SystemItem; if (this.Key[12] == 0x14) { this.Key.Name = "SystemItem (GC)"; } reader.Seek(this.DataOffset); // Seek to the start of the data // Parse system bitmap this.SystemBitmap = (SystemBitmap)reader.ReadByte(); // Parse Content package rate byte rate = reader.ReadByte(); int rateIndex = (rate & 0x1E) >> 1; int[] rates = new int[16] { 0, 24, 25, 30, 48, 50, 60, 72, 75, 90, 96, 100, 120, 0, 0, 0 }; int rateNonDrop = 1; if (rateIndex < 16) { rateNonDrop = rates[rateIndex]; } this.PackageRate = rateNonDrop; if ((rate & 0x01) == 0x01) // 1.001 divider active? { this.PackageRate = this.PackageRate / 1.001; } // Parse Content Package Type byte type = reader.ReadByte(); this.StreamStatus = (SystemStreamStatus)((type & 0xE0) >> 5); this.LowLatencyMode = ((type & 0x10) == 0x10); this.TransferMode = (SystemTransferMode)((type & 0x0C) >> 2); this.TimingMode = (SystemTimingMode)(type & 0x03); this.ChannelHandle = reader.ReadUInt16(); this.ContinuityCount = reader.ReadUInt16(); this.SMPTE = reader.ReadULKey(); // Always read even if zero MXFTimeStamp creationTimeStamp = reader.ReadBCDTimeCode(this.PackageRate); this.CreationDate = creationTimeStamp.ToString(); this.UserDate = reader.ReadBCDTimeCode(this.PackageRate); this.UserDateFullFrameNb = this.UserDate.GetString(true); }
/// <summary> /// Overridden method to process local tags /// </summary> /// <param name="localTag"></param> protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x1b01: DefinitionObjectIdentification = reader.ReadULKey(); return(true); case 0x1b02: DefinitionObjectName = reader.ReadUTF16String(localTag.Size); return(true); case 0x1b03: DefinitionObjectDescription = reader.ReadUTF16String(localTag.Size); return(true); } return(base.ParseLocalTag(reader, localTag)); }
protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x000c: IsOptional = reader.ReadBool(); return(true); case 0x000b: PropertyType = reader.ReadULKey(); return(true); case 0x000d: LocalIdentification = reader.ReadUInt16(); return(true); case 0x000e: IsUniqueIdentifier = reader.ReadBool(); return(true); } return(base.ParseLocalTag(reader, localTag)); }
protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case 0x3c0a: InstanceId = reader.ReadUUIDKey(); return(true); case 0x0006: MetaDefinitionName = reader.ReadUTF16String(localTag.Size); return(true); case 0x0005: MetaDefinitionIdentification = reader.ReadULKey(); return(true); case 0x0007: MetaDefinitionDescription = 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) { switch (localTag.Tag) { case 0x3C09: this.ThisGenerationUID = reader.ReadULKey(); return(true); case 0x3C01: this.CompanyName = reader.ReadUTF16String(localTag.Size); return(true); case 0x3C02: this.ProductName = reader.ReadUTF16String(localTag.Size); return(true); case 0x3C03: this.ProductVersion = reader.ReadProductVersion(); return(true); case 0x3C04: this.ProductVersionString = reader.ReadUTF16String(localTag.Size); return(true); case 0x3C05: this.ProductUID = reader.ReadULKey(); return(true); case 0x3C06: this.ModificationDate = reader.ReadTimestamp(); return(true); case 0x3C07: this.ToolkitVersion = reader.ReadProductVersion(); return(true); case 0x3C08: this.Platform = 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) { switch (localTag.Tag) { case 0x0201: this.DataDefinition = reader.ReadULKey(); return(true); case 0x0202: this.Duration = reader.ReadUInt64(); return(true); // TODO replace generic MXFObject with class KLVData once implemented case 0x0203: this.AddChild(reader.ReadReferenceSet <MXFObject>("KLV Data", "KLV Data")); return(true); case 0x0204: this.AddChild(reader.ReadReferenceSet <MXFTaggedValue>("User Comments", "User Comment")); return(true); case 0x0205: this.AddChild(reader.ReadReferenceSet <MXFTaggedValue>("Attributes", "Attribute")); return(true); } return(base.ParseLocalTag(reader, localTag)); }
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); }
/// <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 == cryptoContextId_Key: this.CryptographicContextID = reader.ReadULKey(); return(true); case var _ when localTag.Key == cipherAlgorithm_Key: this.CipherAlgorithm = reader.ReadULKey(); return(true); case var _ when localTag.Key == cryptoKeyID_Key: this.CryptographicKeyID = reader.ReadULKey(); return(true); case var _ when localTag.Key == mICAlgorithm_Key: this.MICAlgorithm = reader.ReadULKey(); return(true); case var _ when localTag.Key == sourceContainerFormat_Key: this.SourceContainerFormat = reader.ReadULKey(); return(true); case var _ when localTag.Key == mICCarriage_Key: this.MICCarriage = reader.ReadULKey(); 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 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)); }
/// <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)); }
protected override bool ParseLocalTag(MXFReader reader, MXFLocalTag localTag) { switch (localTag.Tag) { case var _ when localTag.Key == audioBitRate_Key: this.MPEGAudioBitRate = reader.ReadUInt32(); return(true); case var _ when localTag.Key == channelAssignment_Key: this.MPEGAudioChannelAssignment = reader.ReadULKey(); return(true); } return(base.ParseLocalTag(reader, localTag)); }