From 1062764255c7d4ade8ec3a5afd2b6c7ba2b7ff54 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 16 Jan 2025 20:34:55 +0100 Subject: [PATCH 1/2] [CoreMedia] Fix all availability attributes in this framework. * Add/adjust availability attributes. * Remove version checks that will always return the same value. This is a step towards fixing https://github.com/dotnet/macios/issues/21185. --- src/CoreMedia/CMSampleBuffer.cs | 4 + src/CoreMedia/CMSync.cs | 276 ++++++++++-------- src/CoreMedia/CMTag.cs | 4 + src/CoreMedia/NSValue.cs | 4 + .../ApiAvailabilityTest.KnownFailures.cs | 18 -- tests/cecil-tests/ApiAvailabilityTest.cs | 2 +- .../Documentation.KnownFailures.txt | 1 + .../common-CoreMedia.ignore | 4 - 8 files changed, 175 insertions(+), 138 deletions(-) diff --git a/src/CoreMedia/CMSampleBuffer.cs b/src/CoreMedia/CMSampleBuffer.cs index ca991637e0a3..714958fea1ea 100644 --- a/src/CoreMedia/CMSampleBuffer.cs +++ b/src/CoreMedia/CMSampleBuffer.cs @@ -1054,6 +1054,10 @@ public bool? EndsPreviousSampleDuration { /// To be added. /// To be added. /// To be added. + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] public string? DroppedFrameReason { get { return GetStringValue (CMSampleAttachmentKey.DroppedFrameReason); diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 2b15ba073bf8..6c568621f0a3 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -131,13 +131,21 @@ private CMTimebase (NativeHandle handle, bool owns) [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios9.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] unsafe extern static /* OSStatus */ CMTimebaseError CMTimebaseCreateWithMasterClock (/* CFAllocatorRef */ IntPtr allocator, /* CMClockRef */ IntPtr masterClock, /* CMTimebaseRef* */ IntPtr* timebaseOut); + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCreateWithSourceClock' instead.")] static IntPtr Create (CMClock masterClock) { if (masterClock is null) @@ -154,6 +162,14 @@ static IntPtr Create (CMClock masterClock) return handle; } + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use the (CFAllocator, CMClock) overload instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use the (CFAllocator, CMClock) overload instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use the (CFAllocator, CMClock) overload instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use the (CFAllocator, CMClock) overload instead.")] public CMTimebase (CMClock masterClock) : base (Create (masterClock), true) { @@ -163,13 +179,21 @@ public CMTimebase (CMClock masterClock) [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios8.0")] - [ObsoletedOSPlatform ("maccatalyst13.0")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] [DllImport (Constants.CoreMediaLibrary)] unsafe extern static /* OSStatus */ CMTimebaseError CMTimebaseCreateWithMasterTimebase (/* CFAllocatorRef */ IntPtr allocator, /* CMTimebaseRef */ IntPtr masterTimebase, /* CMTimebaseRef* */ IntPtr* timebaseOut); + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCreateWithSourceTimebase' instead.")] static IntPtr Create (CMTimebase masterTimebase) { if (masterTimebase is null) @@ -186,6 +210,14 @@ static IntPtr Create (CMTimebase masterTimebase) return handle; } + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use the (CFAllocator, CMTimebase) overload instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use the (CFAllocator, CMTimebase) overload instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use the (CFAllocator, CMTimebase) overload instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use the (CFAllocator, CMTimebase) overload instead.")] public CMTimebase (CMTimebase masterTimebase) : base (Create (masterTimebase), true) { @@ -198,6 +230,10 @@ public CMTimebase (CMTimebase masterTimebase) [DllImport (Constants.CoreMediaLibrary)] unsafe static extern CMTimebaseError CMTimebaseCreateWithSourceClock (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMClock */ IntPtr sourceClock, /* CMTimebase */ IntPtr* timebaseOut); + [SupportedOSPlatform ("tvos15.0")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("ios15.0")] + [SupportedOSPlatform ("maccatalyst")] static IntPtr Create (CFAllocator? allocator, CMClock sourceClock) { if (sourceClock is null) @@ -231,6 +267,10 @@ public CMTimebase (CFAllocator? allocator, CMClock sourceClock) [DllImport (Constants.CoreMediaLibrary)] unsafe static extern CMTimebaseError CMTimebaseCreateWithSourceTimebase (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMTimebase */ IntPtr sourceTimebase, /* CMTimebase */ IntPtr* timebaseOut); + [SupportedOSPlatform ("tvos15.0")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("ios15.0")] + [SupportedOSPlatform ("maccatalyst")] static IntPtr Create (CFAllocator? allocator, CMTimebase sourceTimebase) { if (sourceTimebase is null) @@ -313,10 +353,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios9.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCopySourceTimebase' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static /* CMTimebaseRef */ IntPtr CMTimebaseGetMasterTimebase (/* CMTimebaseRef */ IntPtr timebase); @@ -324,10 +364,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CopyMasterTimebase' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CopyMasterTimebase' instead.")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CopyMasterTimebase' instead.")] - [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'CopyMasterTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'SourceTimebase' instead.")] public CMTimebase? GetMasterTimebase () { var ptr = CMTimebaseGetMasterTimebase (Handle); @@ -341,10 +381,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios9.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCopySourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static /* CMClockRef */ IntPtr CMTimebaseGetMasterClock (/* CMTimebaseRef */ IntPtr timebase); @@ -352,10 +392,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CopyMasterClock' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CopyMasterClock' instead.")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CopyMasterClock' instead.")] - [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'CopyMasterClock' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'SourceClock' instead.")] public CMClock? GetMasterClock () { var ptr = CMTimebaseGetMasterClock (Handle); @@ -369,10 +409,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.11")] - [ObsoletedOSPlatform ("ios9.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("macos10.11", message: "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCopySource' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static /* CMClockOrTimebaseRef */ IntPtr CMTimebaseGetMaster (/* CMTimebaseRef */ IntPtr timebase); @@ -397,10 +437,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.11")] - [ObsoletedOSPlatform ("ios9.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", message: "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", message: "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static /* CMClockRef */ IntPtr CMTimebaseGetUltimateMasterClock (/* CMTimebaseRef */ IntPtr timebase); @@ -408,10 +448,10 @@ public double Rate { [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CopyUltimateMasterClock' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CopyUltimateMasterClock' instead.")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CopyUltimateMasterClock' instead.")] - [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'CopyUltimateMasterClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'UltimateSourceClock' instead.")] public CMClock? GetUltimateMasterClock () { var ptr = CMTimebaseGetUltimateMasterClock (Handle); @@ -531,9 +571,9 @@ public CMTimebaseError SetTimerToFireImmediately (NSTimer timer) [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios8.0")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseSetSourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseSetSourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'CMTimebaseSetSourceTimebase' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterTimebase (/* CMTimebaseRef* */ IntPtr timebase, /* CMTimebaseRef* */ IntPtr newMasterTimebase); @@ -541,10 +581,10 @@ public CMTimebaseError SetTimerToFireImmediately (NSTimer timer) [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios8.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'SourceTimebase' instead.")] public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) { if (newMasterTimebase is null) @@ -559,10 +599,10 @@ public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios8.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'CMTimebaseSetSourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'CMTimebaseSetSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'CMTimebaseSetSourceClock' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'CMTimebaseSetSourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterClock (/* CMTimebaseRef* */ IntPtr timebase, /* CMClockRef* */ IntPtr newMasterClock); @@ -570,10 +610,10 @@ public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] - [ObsoletedOSPlatform ("maccatalyst13.0")] - [ObsoletedOSPlatform ("tvos9.0")] - [ObsoletedOSPlatform ("macos10.10")] - [ObsoletedOSPlatform ("ios8.0")] + [ObsoletedOSPlatform ("maccatalyst13.0", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.10", message: "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("ios8.0", message: "Use 'SourceClock' instead.")] public CMTimebaseError SetMasterClock (CMClock newMasterClock) { if (newMasterClock is null) @@ -586,86 +626,86 @@ public CMTimebaseError SetMasterClock (CMClock newMasterClock) #endif #if !COREBUILD - bool IsDeprecated () - { -#if __MACCATALYST__ - return true; -#elif IOS - return SystemVersion.CheckiOS (9, 0); -#elif MONOMAC - return SystemVersion.CheckmacOS (10, 11); -#elif TVOS - return true; -#endif - } - + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'SourceTimebase' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'SourceTimebase' instead.")] public CMTimebase? CopyMasterTimebase () { - IntPtr ptr = IntPtr.Zero; - bool deprecated = IsDeprecated (); - if (deprecated) - ptr = CMTimebaseCopyMasterTimebase (Handle); - else - ptr = CMTimebaseGetMasterTimebase (Handle); - + var ptr = CMTimebaseCopyMasterTimebase (Handle); if (ptr == IntPtr.Zero) return null; - - return new CMTimebase (ptr, deprecated); + return new CMTimebase (ptr, true); } + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'SourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'SourceClock' instead.")] public CMClock? CopyMasterClock () { - IntPtr ptr = IntPtr.Zero; - bool deprecated = IsDeprecated (); - if (deprecated) - ptr = CMTimebaseCopyMasterClock (Handle); - else - ptr = CMTimebaseGetMasterClock (Handle); - + var ptr = CMTimebaseCopyMasterClock (Handle); if (ptr == IntPtr.Zero) return null; - - return new CMClock (ptr, deprecated); + return new CMClock (ptr, true); } + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'CopySource' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'CopySource' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'CopySource' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'CopySource' instead.")] public CMClockOrTimebase? CopyMaster () { - IntPtr ptr = IntPtr.Zero; - bool deprecated = IsDeprecated (); - if (deprecated) - ptr = CMTimebaseCopyMaster (Handle); - else - ptr = CMTimebaseGetMaster (Handle); - + var ptr = CMTimebaseCopyMaster (Handle); if (ptr == IntPtr.Zero) return null; + return new CMClockOrTimebase (ptr, true); + } - return new CMClockOrTimebase (ptr, deprecated); + public CMClockOrTimebase? CopySource () + { + var ptr = CMTimebaseCopySource (Handle); + if (ptr == IntPtr.Zero) + return null; + return new CMClockOrTimebase (ptr, true); } + [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] + [SupportedOSPlatform ("tvos")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'UltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'UltimateSourceClock' instead.")] public CMClock? CopyUltimateMasterClock () { - IntPtr ptr = IntPtr.Zero; - bool deprecated = IsDeprecated (); - if (deprecated) - ptr = CMTimebaseCopyUltimateMasterClock (Handle); - else - ptr = CMTimebaseGetUltimateMasterClock (Handle); - + var ptr = CMTimebaseCopyUltimateMasterClock (Handle); if (ptr == IntPtr.Zero) return null; - - return new CMClock (ptr, deprecated); + return new CMClock (ptr, true); } [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseGetMasterTimebase' instead.")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseGetMasterTimebase' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseGetMasterTimebase' instead.")] - [UnsupportedOSPlatform ("maccatalyst")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseCopySourceTimebase' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'CMTimebaseCopySourceTimebase' instead.")] [DllImport (Constants.CoreMediaLibrary)] static extern unsafe /* CMTimebaseRef */ IntPtr CMTimebaseCopyMasterTimebase (/* CMTimebaseRef */ IntPtr timebase); @@ -673,33 +713,39 @@ bool IsDeprecated () [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'CMTimebaseGetMasterClock' instead.")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseGetMasterClock' instead.")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseGetMasterClock' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseGetMasterClock' instead.")] + [ObsoletedOSPlatform ("maccatalyst13.0", "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseCopySourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseCopySourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyMasterClock (/* CMTimebaseRef */ IntPtr timebase); [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("macos")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseGetMaster' instead.")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseGetMaster' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseGetMaster' instead.")] - [UnsupportedOSPlatform ("maccatalyst")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseCopySource' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'CMTimebaseCopySource' instead.")] [DllImport (Constants.CoreMediaLibrary)] static extern unsafe IntPtr /* void* */ CMTimebaseCopyMaster (/* CMTimebaseRef */ IntPtr timebase); [SupportedOSPlatform ("ios")] + [SupportedOSPlatform ("maccatalyst")] [SupportedOSPlatform ("macos")] [SupportedOSPlatform ("tvos")] - [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [UnsupportedOSPlatform ("maccatalyst")] + [ObsoletedOSPlatform ("tvos9.0", "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("macos10.11", "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("ios9.0", "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] + [ObsoletedOSPlatform ("maccatalyst", "Use 'CMTimebaseCopyUltimateSourceClock' instead.")] [DllImport (Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyUltimateMasterClock (/* CMTimebaseRef */ IntPtr timebase); #endif + + [DllImport (Constants.CoreMediaLibrary)] + static extern unsafe IntPtr /* CMClockOrTimebaseRef * */ CMTimebaseCopySource (/* CMTimebaseRef */ IntPtr timebase); + // // Dispatch timers not supported // diff --git a/src/CoreMedia/CMTag.cs b/src/CoreMedia/CMTag.cs index 94b264c134b2..38f41e6767b6 100644 --- a/src/CoreMedia/CMTag.cs +++ b/src/CoreMedia/CMTag.cs @@ -91,6 +91,10 @@ public bool IsValid { public static CMTag ProjectionTypeEquirectangular { get => CMTagConstants.ProjectionTypeEquirectangular; } /// + [SupportedOSPlatform ("ios18.0")] + [SupportedOSPlatform ("tvos18.0")] + [SupportedOSPlatform ("maccatalyst18.0")] + [SupportedOSPlatform ("macos15.0")] public static CMTag ProjectionTypeHalfEquirectangular { get => CMTagConstants.ProjectionTypeHalfEquirectangular; } /// diff --git a/src/CoreMedia/NSValue.cs b/src/CoreMedia/NSValue.cs index 14996937f10b..5c7143aedd36 100644 --- a/src/CoreMedia/NSValue.cs +++ b/src/CoreMedia/NSValue.cs @@ -50,6 +50,10 @@ public static CMTimeMapping ToCMTimeMapping (NativeHandle handle) /// /// The native handle. /// The CMTimeRange. + [SupportedOSPlatform ("ios16.0")] + [SupportedOSPlatform ("macos13.0")] + [SupportedOSPlatform ("maccatalyst16.0")] + [SupportedOSPlatform ("tvos16.0")] public static CMVideoDimensions ToCMVideoDimensions (NativeHandle handle) { using var nsvalue = Runtime.GetNSObject (handle)!; diff --git a/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs b/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs index 6b4064c57784..9235797989cd 100644 --- a/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs +++ b/tests/cecil-tests/ApiAvailabilityTest.KnownFailures.cs @@ -17,24 +17,6 @@ namespace Cecil.Tests { public partial class ApiAvailabilityTest { static HashSet knownFailuresAvailabilityWarnings = new HashSet { - "/src/CoreMedia/CMSampleBuffer.cs has 3 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMSampleAttachmentKey.DroppedFrameReason.get' is supported on: 'ios', 'maccatalyst', 'tvos'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCopyMaster(nint)' is obsoleted on: 'ios' 9.0 and later (Use 'CMTimebaseGetMaster' instead.), 'macOS/OSX' 10.11 and later (Use 'CMTimebaseGetMaster' instead.), 'tvos' 9.0 and later (Use 'CMTimebaseGetMaster' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCopyMasterClock(nint)' is obsoleted on: 'ios' 9.0 and later (Use 'CMTimebaseGetMasterClock' instead.), 'maccatalyst' 9.0 and later (Use 'CMTimebaseGetMasterClock' instead.), 'macOS/OSX' 10.11 and later (Use 'CMTimebaseGetMasterClock' instead.), 'tvos' 9.0 and later (Use 'CMTimebaseGetMasterClock' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCopyMasterTimebase(nint)' is obsoleted on: 'ios' 9.0 and later (Use 'CMTimebaseGetMasterTimebase' instead.), 'macOS/OSX' 10.11 and later (Use 'CMTimebaseGetMasterTimebase' instead.), 'tvos' 9.0 and later (Use 'CMTimebaseGetMasterTimebase' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCopyUltimateMasterClock(nint)' is obsoleted on: 'ios' 9.0 and later (Use 'CMTimebaseGetUltimateMasterClock' instead.), 'macOS/OSX' 10.11 and later (Use 'CMTimebaseGetUltimateMasterClock' instead.), 'tvos' 9.0 and later (Use 'CMTimebaseGetUltimateMasterClock' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCreateWithMasterClock(nint, nint, nint*)' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later, 'macOS/OSX' 10.10 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCreateWithMasterTimebase(nint, nint, nint*)' is obsoleted on: 'ios' 8.0 and later, 'maccatalyst' 8.0 and later, 'macOS/OSX' 10.10 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCreateWithSourceClock(nint, nint, nint*)' is supported on: 'ios' 15.0 and later, 'tvos' 15.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseCreateWithSourceTimebase(nint, nint, nint*)' is supported on: 'ios' 15.0 and later, 'tvos' 15.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetMaster(nint)' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later, 'macOS/OSX' 10.11 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetMasterClock(nint)' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later, 'macOS/OSX' 10.10 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetMasterClock(nint)' is obsoleted on: 'macOS/OSX' 10.10 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetMasterTimebase(nint)' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later, 'macOS/OSX' 10.10 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetMasterTimebase(nint)' is obsoleted on: 'macOS/OSX' 10.10 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMSync.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CMTimebase.CMTimebaseGetUltimateMasterClock(nint)' is obsoleted on: 'ios' 9.0 and later, 'maccatalyst' 9.0 and later, 'macOS/OSX' 10.11 and later, 'tvos' 9.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", - "/src/CoreMedia/CMTag.cs has 4 occurrences of This call site is reachable on: 'ios' 17.0 and later, 'maccatalyst' 17.0 and later, 'macOS/OSX' 14.0 and later, 'tvos' 17.0 and later. 'CMTagConstants.ProjectionTypeHalfEquirectangular.get' is supported on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", - "/src/CoreMedia/CMTag.cs has 4 occurrences of This call site is reachable on: 'ios' 17.0 and later, 'maccatalyst' 17.0 and later, 'macOS/OSX' 14.0 and later, 'tvos' 17.0 and later. 'CMTagConstants.ProjectionTypeHalfEquirectangular' is supported on: 'ios' 18.0 and later, 'maccatalyst' 18.0 and later, 'macOS/OSX' 15.0 and later, 'tvos' 18.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", - "/src/CoreMedia/NSValue.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'NSValue.CMVideoDimensionsValue' is supported on: 'ios' 16.0 and later, 'maccatalyst' 16.0 and later, 'macOS/OSX' 13.0 and later, 'tvos' 16.0 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)", "/src/CoreText/CTFont.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CTFontFeatureLetterCase' is obsoleted on: 'ios' 6.0 and later, 'maccatalyst' 6.0 and later, 'macOS/OSX' 10.7 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/CoreText/CTFont.cs has 4 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'FontFeatureGroup.LetterCase' is obsoleted on: 'ios' 6.0 and later, 'maccatalyst' 6.0 and later, 'macOS/OSX' 10.7 and later. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", "/src/CoreText/CTParagraphStyle.cs has 8 occurrences of This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'CTParagraphStyleSpecifier.LineSpacing' is obsoleted on: 'ios' 6.0 and later (Use 'MaximumLineSpacing' instead.), 'maccatalyst' 6.0 and later (Use 'MaximumLineSpacing' instead.), 'macOS/OSX' 10.8 and later (Use 'MaximumLineSpacing' instead.), 'tvos' 16.0 and later (Use 'MaximumLineSpacing' instead.). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1422)", diff --git a/tests/cecil-tests/ApiAvailabilityTest.cs b/tests/cecil-tests/ApiAvailabilityTest.cs index 2ca413c69373..eb3ca318709e 100644 --- a/tests/cecil-tests/ApiAvailabilityTest.cs +++ b/tests/cecil-tests/ApiAvailabilityTest.cs @@ -69,7 +69,7 @@ public void Warnings () } finally { Console.WriteLine ($"There's a total of {totalWarnings} warnings."); } - Assert.AreEqual (884, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed. + Assert.AreEqual (813, totalWarnings, "Total warnings"); // this is just to see how the warning count changes as issues are fixed. } public record ObsoletedFailure : IComparable { diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index f87e2dcb24d5..25804b45e798 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -21985,6 +21985,7 @@ M:CoreMedia.CMTimebase.AddTimer(Foundation.NSTimer,Foundation.NSRunLoop) M:CoreMedia.CMTimebase.CopyMaster M:CoreMedia.CMTimebase.CopyMasterClock M:CoreMedia.CMTimebase.CopyMasterTimebase +M:CoreMedia.CMTimebase.CopySource M:CoreMedia.CMTimebase.CopyUltimateMasterClock M:CoreMedia.CMTimebase.GetMaster M:CoreMedia.CMTimebase.GetMasterClock diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-CoreMedia.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-CoreMedia.ignore index 499156bc2399..99bb6c8fca4d 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-CoreMedia.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-CoreMedia.ignore @@ -411,7 +411,3 @@ !unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound !unknown-pinvoke! CMTimebaseSetMasterClock bound !unknown-pinvoke! CMTimebaseSetMasterTimebase bound - -# it can return a Clock or a Timebase but the API already has a way to access the clock source (CMTimebaseCopySourceClock) -# and the Timebase (CMTimebaseCopySourceTimebase) so there is no reason atm to add this method -!missing-pinvoke! CMTimebaseCopySource is not bound From e68fb97c907a2df3efeb4a8a23efdf54f5e00f1a Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Thu, 27 Mar 2025 16:32:40 +0000 Subject: [PATCH 2/2] Auto-format source code --- src/CoreMedia/CMSync.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 6c568621f0a3..218aee5c2ac7 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -652,7 +652,7 @@ public CMTimebaseError SetMasterClock (CMClock newMasterClock) [ObsoletedOSPlatform ("ios9.0", "Use 'SourceClock' instead.")] public CMClock? CopyMasterClock () { - var ptr = CMTimebaseCopyMasterClock (Handle); + var ptr = CMTimebaseCopyMasterClock (Handle); if (ptr == IntPtr.Zero) return null; return new CMClock (ptr, true);