Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/CoreMedia/CMTaggedBufferGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public nint GetNumberOfMatches (CMTagCollection tagCollection)
IntPtr /* CMTaggedBufferGroupRef CM_NONNULL */ taggedBufferGroup,
IntPtr* /* CM_RETURNS_RETAINED_PARAMETER CMTaggedBufferGroupFormatDescriptionRef CM_NULLABLE * CM_NONNULL */ formatDescription);

/// <summary>Craete a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
/// <summary>Create a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
/// <returns>A <see cref="CMFormatDescription" /> for this tagged buffer group, or null in case of failure.</returns>
public CMFormatDescription? CreateFormatDescription (out CMTaggedBufferGroupError status)
Expand Down Expand Up @@ -326,7 +326,7 @@ public bool Matches (CMFormatDescription formatDescription)
/// <summary>Create a <see cref="CMSampleBuffer" /> with this tagged buffer group.</summary>
/// <param name="sampleBufferPts">The media time PTS of the sample buffer.</param>
/// <param name="sampleBufferDuration">The media time duration of the sample buffer.</param>
/// <param name="formatDescription">The format description describing this tagged buffer group. This format description may be created by calling <see cref="CreateFormatDescription" />.</param>
/// <param name="formatDescription">The format description describing this tagged buffer group. This format description may be created by calling <see cref="CreateFormatDescription(out CMTaggedBufferGroupError)" /> or <see cref="CreateFormatDescription(NSDictionary,out CMTaggedBufferGroupError)" />.</param>
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
/// <returns>A new sample buffer for this tagged buffer group, or null in case of failure.</returns>
public CMSampleBuffer? CreateSampleBuffer (CMTime sampleBufferPts, CMTime sampleBufferDuration, CMFormatDescription formatDescription, out CMTaggedBufferGroupError status)
Expand All @@ -352,6 +352,31 @@ public bool Matches (CMFormatDescription formatDescription)
GC.KeepAlive (sampleBuffer);
return Create (handle, false);
}

[SupportedOSPlatform ("ios26.0")]
[SupportedOSPlatform ("maccatalyst26.0")]
[SupportedOSPlatform ("macos26.0")]
[SupportedOSPlatform ("tvos26.0")]
[DllImport (Constants.CoreMediaLibrary)]
static unsafe extern CMTaggedBufferGroupError CMTaggedBufferGroupFormatDescriptionCreateForTaggedBufferGroupWithExtensions (
IntPtr /* CFAllocatorRef CM_NULLABLE */ allocator,
IntPtr /* CMTaggedBufferGroupRef CM_NONNULL */ taggedBufferGroup,
IntPtr /* CFDictionaryRef CM_NULLABLE */ extensions,
IntPtr*/* CM_RETURNS_RETAINED_PARAMETER CMTaggedBufferGroupFormatDescriptionRef CM_NULLABLE * CM_NONNULL */ formatDescriptionOut);

/// <summary>Craete a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
/// <param name="extensions">A dictionary of extension properties.</param>
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
/// <returns>A <see cref="CMFormatDescription" /> for this tagged buffer group, or null in case of failure.</returns>
public CMFormatDescription? CreateFormatDescription (NSDictionary? extensions, out CMTaggedBufferGroupError status)
{
IntPtr formatDescription;
unsafe {
status = CMTaggedBufferGroupFormatDescriptionCreateForTaggedBufferGroupWithExtensions (IntPtr.Zero, GetCheckedHandle (), extensions.GetHandle (), &formatDescription);
GC.KeepAlive (extensions);
}
return CMFormatDescription.Create (formatDescription, true);
}
#endif // COREBUILD
}
}
Loading
Loading