Skip to content

Commit e830d4e

Browse files
committed
[CoreMedia] Update to Xcode 26 beta 1-7.
TODO: * Needs VideoToolbox first. * Add duplication comments to VideoToolbox as well. * Review
1 parent cc1abfd commit e830d4e

File tree

9 files changed

+410
-193
lines changed

9 files changed

+410
-193
lines changed

src/CoreMedia/CMTaggedBufferGroup.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public nint GetNumberOfMatches (CMTagCollection tagCollection)
287287
IntPtr /* CMTaggedBufferGroupRef CM_NONNULL */ taggedBufferGroup,
288288
IntPtr* /* CM_RETURNS_RETAINED_PARAMETER CMTaggedBufferGroupFormatDescriptionRef CM_NULLABLE * CM_NONNULL */ formatDescription);
289289

290-
/// <summary>Craete a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
290+
/// <summary>Create a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
291291
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
292292
/// <returns>A <see cref="CMFormatDescription" /> for this tagged buffer group, or null in case of failure.</returns>
293293
public CMFormatDescription? CreateFormatDescription (out CMTaggedBufferGroupError status)
@@ -326,7 +326,7 @@ public bool Matches (CMFormatDescription formatDescription)
326326
/// <summary>Create a <see cref="CMSampleBuffer" /> with this tagged buffer group.</summary>
327327
/// <param name="sampleBufferPts">The media time PTS of the sample buffer.</param>
328328
/// <param name="sampleBufferDuration">The media time duration of the sample buffer.</param>
329-
/// <param name="formatDescription">The format description describing this tagged buffer group. This format description may be created by calling <see cref="CreateFormatDescription" />.</param>
329+
/// <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>
330330
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
331331
/// <returns>A new sample buffer for this tagged buffer group, or null in case of failure.</returns>
332332
public CMSampleBuffer? CreateSampleBuffer (CMTime sampleBufferPts, CMTime sampleBufferDuration, CMFormatDescription formatDescription, out CMTaggedBufferGroupError status)
@@ -352,6 +352,31 @@ public bool Matches (CMFormatDescription formatDescription)
352352
GC.KeepAlive (sampleBuffer);
353353
return Create (handle, false);
354354
}
355+
356+
[SupportedOSPlatform ("ios26.0")]
357+
[SupportedOSPlatform ("maccatalyst26.0")]
358+
[SupportedOSPlatform ("macos26.0")]
359+
[SupportedOSPlatform ("tvos26.0")]
360+
[DllImport (Constants.CoreMediaLibrary)]
361+
static unsafe extern CMTaggedBufferGroupError CMTaggedBufferGroupFormatDescriptionCreateForTaggedBufferGroupWithExtensions (
362+
IntPtr /* CFAllocatorRef CM_NULLABLE */ allocator,
363+
IntPtr /* CMTaggedBufferGroupRef CM_NONNULL */ taggedBufferGroup,
364+
IntPtr /* CFDictionaryRef CM_NULLABLE */ extensions,
365+
IntPtr*/* CM_RETURNS_RETAINED_PARAMETER CMTaggedBufferGroupFormatDescriptionRef CM_NULLABLE * CM_NONNULL */ formatDescriptionOut);
366+
367+
/// <summary>Craete a <see cref="CMFormatDescription" /> for this tagged buffer group.</summary>
368+
/// <param name="extensions">A dictionary of extension properties.</param>
369+
/// <param name="status">An error code in case of failure, 0 in case of success.</param>
370+
/// <returns>A <see cref="CMFormatDescription" /> for this tagged buffer group, or null in case of failure.</returns>
371+
public CMFormatDescription? CreateFormatDescription (NSDictionary? extensions, out CMTaggedBufferGroupError status)
372+
{
373+
IntPtr formatDescription;
374+
unsafe {
375+
status = CMTaggedBufferGroupFormatDescriptionCreateForTaggedBufferGroupWithExtensions (IntPtr.Zero, GetCheckedHandle (), extensions.GetHandle (), &formatDescription);
376+
GC.KeepAlive (extensions);
377+
}
378+
return CMFormatDescription.Create (formatDescription, true);
379+
}
355380
#endif // COREBUILD
356381
}
357382
}

0 commit comments

Comments
 (0)