Skip to content

Commit

Permalink
Add AVDictionary* to MediaDictionary conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Sep 22, 2022
1 parent d26ef06 commit 3271df0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/Sdcb.FFmpeg.AutoGen/Gen2/G2TypeConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static G2TypeConverter Create(Dictionary<string, G2TransformDef> knownDef
{
TypeCastDef.StaticCastStruct("AVCodec*", "Codec"),
TypeCastDef.StaticCastStruct("AVClass*", "FFmpegClass"),
TypeCastDef.StaticCastClass("AVDictionary*", "MediaDictionary", isOwner: false),
TypeCastDef.Force("void*", "IntPtr"),
TypeCastDef.Force("byte*", "IntPtr"),
});
Expand Down
7 changes: 4 additions & 3 deletions src/Sdcb.FFmpeg/Codecs/Frame.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,14 @@ public long PktDuration
}

/// <summary>
/// <para>original type: AVDictionary*</para>
/// <para>metadata. - encoding: Set by user. - decoding: Set by libavcodec.</para>
/// <see cref="AVFrame.metadata" />
/// </summary>
public AVDictionary* Metadata
public MediaDictionary Metadata
{
get => _ptr->metadata;
set => _ptr->metadata = value;
get => MediaDictionary.FromNative(_ptr->metadata, false);
set => _ptr->metadata = (AVDictionary*)value;
}

/// <summary>
Expand Down
7 changes: 4 additions & 3 deletions src/Sdcb.FFmpeg/Formats/FormatContext.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ public AVChapter** Chapters
}

/// <summary>
/// <para>original type: AVDictionary*</para>
/// <para>Metadata that applies to the whole file.</para>
/// <see cref="AVFormatContext.metadata" />
/// </summary>
public AVDictionary* Metadata
public MediaDictionary Metadata
{
get => _ptr->metadata;
set => _ptr->metadata = value;
get => MediaDictionary.FromNative(_ptr->metadata, false);
set => _ptr->metadata = (AVDictionary*)value;
}

/// <summary>
Expand Down
7 changes: 4 additions & 3 deletions src/Sdcb.FFmpeg/Formats/MediaProgram.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ public uint NbStreamIndexes
}

/// <summary>
/// <para>original type: AVDictionary*</para>
/// <see cref="AVProgram.metadata" />
/// </summary>
public AVDictionary* Metadata
public MediaDictionary Metadata
{
get => _ptr->metadata;
set => _ptr->metadata = value;
get => MediaDictionary.FromNative(_ptr->metadata, false);
set => _ptr->metadata = (AVDictionary*)value;
}

/// <summary>
Expand Down
7 changes: 4 additions & 3 deletions src/Sdcb.FFmpeg/Formats/MediaStream.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ public AVRational SampleAspectRatio
}

/// <summary>
/// <para>original type: AVDictionary*</para>
/// <see cref="AVStream.metadata" />
/// </summary>
public AVDictionary* Metadata
public MediaDictionary Metadata
{
get => _ptr->metadata;
set => _ptr->metadata = value;
get => MediaDictionary.FromNative(_ptr->metadata, false);
set => _ptr->metadata = (AVDictionary*)value;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Sdcb.FFmpeg/Sdcb.FFmpeg.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageId>Sdcb.FFmpeg</PackageId>
<VersionPrefix>5.1.1</VersionPrefix>
<VersionSuffix>preview.6</VersionSuffix>
<VersionSuffix>preview.7</VersionSuffix>
<LangVersion>latest</LangVersion>
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
<IncludeSymbols>true</IncludeSymbols>
Expand Down

0 comments on commit 3271df0

Please sign in to comment.