Skip to content

Commit

Permalink
add readout value of tag to it
Browse files Browse the repository at this point in the history
  • Loading branch information
feigenanton committed Apr 2, 2023
1 parent 44bbc2a commit d029e51
Show file tree
Hide file tree
Showing 79 changed files with 1,500 additions and 509 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
switch (localTag.TagValue)
{
case 0x0201:
this.DataDefinition = reader.ReadAUID();
this.DataDefinition = reader.ReadAUID();
localTag.Value = this.DataDefinition;
return true;
case 0x0202:
this.Duration = reader.ReadUInt64();
this.Duration = reader.ReadUInt64();
localTag.Value = this.Duration;
return true;
// TODO replace generic MXFObject with class KLVData once implemented
case 0x0203:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,22 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
case 0x6102:
this.DescribedTrackIDs = reader.ReadArray(reader.ReadUInt32, localTag.Length.Value / sizeof(UInt32));
localTag.Value = this.DescribedTrackIDs;
return true;
case 0x6101:
localTag.AddChild(reader.ReadReference<MXFDescriptiveFramework>("DescriptiveFrameworkObject", localTag.Offset));
return true;
case 0x6101: localTag.AddChild(reader.ReadReference<MXFDescriptiveFramework>("DescriptiveFrameworkObject", localTag.Offset)); return true;
case var _ when localTag.AliasUID == metadataScheme_Key:
this.DescriptiveMetadataScheme = reader.ReadAUID();
this.DescriptiveMetadataScheme = reader.ReadAUID();
localTag.Value = this.DescriptiveMetadataScheme;
return true;
case var _ when localTag.AliasUID == metadataPlugInID_Key:
this.DescriptiveMetadataPlugInID = reader.ReadUUID();
localTag.Value = this.DescriptiveMetadataPlugInID;
return true;
case var _ when localTag.AliasUID == metadataPlugInID_Key: this.DescriptiveMetadataPlugInID = reader.ReadUUID(); return true;
case var _ when localTag.AliasUID == metadataApplicationEnvironmentID_Key:
this.DescriptiveMetadataApplicationEnvironmentID = reader.ReadUTF16String(localTag.Length.Value);
this.DescriptiveMetadataApplicationEnvironmentID = reader.ReadUTF16String(localTag.Length.Value);
localTag.Value = this.DescriptiveMetadataApplicationEnvironmentID;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,21 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x5801: this.DynamicSourcePackageID = reader.ReadUMIDKey(); return true;
case 0x5802: reader.ReadArray(reader.ReadUInt32, localTag.Length.Value); return true;
case 0x5803: this.SourceIndex = reader.ReadBytes((int)localTag.Length.Value); return true;
case 0x5804: this.SourceSpecies = reader.ReadBytes((int)localTag.Length.Value); return true;
case 0x5801:
this.DynamicSourcePackageID = reader.ReadUMIDKey();
localTag.Value = this.DynamicSourcePackageID;
return true;
case 0x5802:
this.DynamicSourceTrackIDs = reader.ReadArray(reader.ReadUInt32, localTag.Length.Value);
localTag.Value = this.DynamicSourceTrackIDs;
return true;
case 0x5803:
this.SourceIndex = reader.ReadBytes((int)localTag.Length.Value);
localTag.Value = this.SourceIndex;
return true;
case 0x5804: this.SourceSpecies = reader.ReadBytes((int)localTag.Length.Value);
localTag.Value = this.SourceSpecies;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x5701: this.ToleranceMode = (MXFToleranceMode)reader.ReadByte(); return true;
case 0x5703: this.ToleranceWindow = reader.ReadArray<byte>(reader.ReadByte, localTag.Length.Value); return true;
case 0x5701:
this.ToleranceMode = (MXFToleranceMode)reader.ReadByte();
localTag.Value = this.ToleranceMode;
return true;
case 0x5703:
this.ToleranceWindow = reader.ReadArray<byte>(reader.ReadByte, localTag.Length.Value);
localTag.Value = this.ToleranceWindow;
return true;
// TODO replace generic MXFObject with class ApplicationPluginObject once implemented
case 0x5702: localTag.AddChild(reader.ReadReference<MXFObject>("InterpolationDefinition", localTag.Offset)); return true;
case 0x5702:
localTag.AddChild(reader.ReadReference<MXFObject>("InterpolationDefinition", localTag.Offset));
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x0601: this.EventPosition = reader.ReadUInt64(); return true;
case 0x0602: this.EventComment = reader.ReadUTF16String(localTag.Length.Value); return true;
case 0x0601:
this.EventPosition = reader.ReadUInt64();
localTag.Value = this.EventPosition;
return true;
case 0x0602:
this.EventComment = reader.ReadUTF16String(localTag.Length.Value);
localTag.Value = this.EventComment;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x0801: this.ActiveState = reader.ReadBoolean(); return true;
case 0x0801:
this.ActiveState = reader.ReadBoolean();
localTag.Value = this.ActiveState;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
20 changes: 16 additions & 4 deletions MXF/Metadata/InterchangeObjects/Components/Segments/MXFEdgeCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,22 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x0404: this.EdgeCodeHeader = reader.ReadBytes((int)localTag.Length.Value); return true;
case 0x0401: this.EdgeCodeStart = reader.ReadUInt64(); return true;
case 0x0403: this.EdgeCodeFormat = (MXFEdge)reader.ReadUInt16(); return true;
case 0x0402: this.EdgeCodeFilmFormat = (MXFFilm)reader.ReadUInt16(); return true;
case 0x0404:
this.EdgeCodeHeader = reader.ReadBytes((int)localTag.Length.Value);
localTag.Value = this.EdgeCodeHeader;
return true;
case 0x0401:
this.EdgeCodeStart = reader.ReadUInt64();
localTag.Value = this.EdgeCodeStart;
return true;
case 0x0403:
this.EdgeCodeFormat = (MXFEdge)reader.ReadUInt16();
localTag.Value = this.EdgeCodeFormat;
return true;
case 0x0402:
this.EdgeCodeFilmFormat = (MXFFilm)reader.ReadUInt16();
localTag.Value = this.EdgeCodeFilmFormat;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
localTag.AddChild(reader.ReadReference<MXFOperationDefinition>("Operation", localTag.Offset));
return true;
case 0x0B04:
this.BypassOverride = reader.ReadUInt32();
this.BypassOverride = reader.ReadUInt32();
localTag.Value = this.BypassOverride;
return true;
case 0x0B05:
localTag.AddChild(reader.ReadReference<MXFSourceReference>("Rendering", localTag.Offset));
Expand Down
19 changes: 15 additions & 4 deletions MXF/Metadata/InterchangeObjects/Components/Segments/MXFPulldown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,21 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x0D03: this.PulldownDirection = (MXFPulldownDirection?)reader.ReadByte(); return true;
case 0x0D02: this.PulldownKind = (MXFPulldownKind?)reader.ReadByte(); return true;
case 0x0D04: this.PhaseFrame = reader.ReadUInt32(); return true;
case 0x0D01: localTag.AddChild(reader.ReadReference<MXFSegment>("InputSegment", localTag.Offset)); return true;
case 0x0D03:
this.PulldownDirection = (MXFPulldownDirection?)reader.ReadByte();
localTag.Value = this.PulldownDirection;
return true;
case 0x0D02:
this.PulldownKind = (MXFPulldownKind?)reader.ReadByte();
localTag.Value = this.PulldownKind;
return true;
case 0x0D04:
this.PhaseFrame = reader.ReadUInt32();
localTag.Value = this.PhaseFrame;
return true;
case 0x0D01:
localTag.AddChild(reader.ReadReference<MXFSegment>("InputSegment", localTag.Offset));
return true;
}

return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x0E01: this.RelativeScope = reader.ReadUInt32(); return true;
case 0x0E02: this.RelativeTrack = reader.ReadUInt32(); return true;
case 0x0E01:
this.RelativeScope = reader.ReadUInt32();
localTag.Value = this.RelativeScope;
return true;
case 0x0E02:
this.RelativeTrack = reader.ReadUInt32();
localTag.Value = this.RelativeTrack;
return true;
}

return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,55 @@
namespace Myriadbits.MXF
{
[ULGroup("urn:smpte:ul:060e2b34.027f0101.0d010101.01011400")]
public class MXFTimecodeComponent : MXFSegment
{
private const string CATEGORYNAME = "TimecodeComponent";
public class MXFTimecodeComponent : MXFSegment
{
private const string CATEGORYNAME = "TimecodeComponent";

[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010102.07020103.01050000")]
public MXFPosition? StartTimecode { get; set; }

[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010102.04040101.02060000")]
public UInt16? FramesPerSecond { get; set; }

[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010101.04040101.05000000")]
public bool? DropFrame { get; set; }
[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010102.07020103.01050000")]
public MXFPosition? StartTimecode { get; set; }

public MXFTimecodeComponent(MXFPack pack)
: base(pack, "TimeCodeComponent")
{
}
[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010102.04040101.02060000")]
public UInt16? FramesPerSecond { get; set; }

public MXFTimecodeComponent(MXFPack pack, string metadataName)
: base(pack, metadataName)
{
}
[Category(CATEGORYNAME)]
[ULElement("urn:smpte:ul:060e2b34.01010101.04040101.05000000")]
public bool? DropFrame { get; set; }

/// <summary>
/// Overridden method to process local tags
/// </summary>
/// <param name="localTag"></param>
protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag localTag)
{
switch (localTag.TagValue)
{
case 0x1501: this.StartTimecode = reader.ReadUInt64(); return true;
case 0x1502: this.FramesPerSecond = reader.ReadUInt16(); return true;
case 0x1503: this.DropFrame = (reader.ReadByte() != 0); return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
public MXFTimecodeComponent(MXFPack pack)
: base(pack, "TimeCodeComponent")
{
}

}
public MXFTimecodeComponent(MXFPack pack, string metadataName)
: base(pack, metadataName)
{
}

/// <summary>
/// Overridden method to process local tags
/// </summary>
/// <param name="localTag"></param>
protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag localTag)
{
switch (localTag.TagValue)
{
case 0x1501:
this.StartTimecode = reader.ReadUInt64();
localTag.Value = this.StartTimecode;
return true;
case 0x1502:
this.FramesPerSecond = reader.ReadUInt16();
localTag.Value = this.FramesPerSecond;
return true;
case 0x1503:
this.DropFrame = reader.ReadBoolean();
localTag.Value = this.DropFrame;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x1601: this.TimecodeStreamSampleRate = reader.ReadRational(); return true;
case 0x1603: this.TimecodeSource = (MXFTCSource?)reader.ReadByte(); return true;
case 0x1602: this.TimecodeStreamData = reader.ReadBytes((int)localTag.Length.Value); return true;
case 0x1601:
this.TimecodeStreamSampleRate = reader.ReadRational();
localTag.Value = this.TimecodeStreamSampleRate;
return true;
case 0x1603:
this.TimecodeSource = (MXFTCSource?)reader.ReadByte();
localTag.Value = this.TimecodeSource;
return true;
case 0x1602:
this.TimecodeStreamData = reader.ReadBytes((int)localTag.Length.Value);
localTag.Value = this.TimecodeStreamData;
return true;
}

return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x1701: this.IncludeSync = reader.ReadBoolean(); return true;
case 0x1701:
this.IncludeSync = reader.ReadBoolean();
localTag.Value = this.IncludeSync;
return true;
}

return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x1801: localTag.AddChild(reader.ReadReference<MXFOperationGroup>("TransitionOperation", localTag.Offset)); return true;
case 0x1802: this.CutPoint = reader.ReadUInt64(); return true;
case 0x1801:
localTag.AddChild(reader.ReadReference<MXFOperationGroup>("TransitionOperation", localTag.Offset));
return true;
case 0x1802:
this.CutPoint = reader.ReadUInt64();
localTag.Value = this.CutPoint;
return true;
}

return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x6103: this.DescriptiveClipDescribedTrackIDs =
reader.ReadArray(reader.ReadUInt32, localTag.Length.Value / sizeof(UInt32));
case 0x6103:
this.DescriptiveClipDescribedTrackIDs =
reader.ReadArray(reader.ReadUInt32, localTag.Length.Value / sizeof(UInt32));
localTag.Value = this.DescriptiveClipDescribedTrackIDs;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ protected override bool ReadLocalTagValue(IKLVStreamReader reader, MXFLocalTag l
{
switch (localTag.TagValue)
{
case 0x1401: this.BeginAnchor = reader.ReadUTF16String(localTag.Length.Value); return true;
case 0x1402: this.EndAnchor = reader.ReadUTF16String(localTag.Length.Value); return true;
case 0x1401:
this.BeginAnchor = reader.ReadUTF16String(localTag.Length.Value);
localTag.Value = this.BeginAnchor;
return true;
case 0x1402:
this.EndAnchor = reader.ReadUTF16String(localTag.Length.Value);
localTag.Value = this.EndAnchor;
return true;
}
return base.ReadLocalTagValue(reader, localTag);
}
Expand Down
Loading

0 comments on commit d029e51

Please sign in to comment.