From 1d39ad18367520bb35712dbc88567980f102c0d3 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Wed, 8 Sep 2021 17:29:30 -0400 Subject: [PATCH 1/8] [CoreMedia] Add support for xcode 13 beta 5. --- src/CoreMedia/CMSync.cs | 85 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 88dbe6bfc580..607ae349bd0a 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -8,6 +8,7 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using Foundation; using CoreFoundation; @@ -457,19 +458,103 @@ public CMClock CopyUltimateMasterClock () return new CMClock (ptr, deprecated); } +#if !NET [iOS (9,0)][Mac (10,11)] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("macos12.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios9.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos9.0 Use 'CMTimebaseGetMasterTimebase' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMTimebaseRef */ IntPtr CMTimebaseCopyMasterTimebase (/* CMTimebaseRef */ IntPtr timebase); +#if !NET [iOS (9,0)][Mac (10,11)] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("macos12.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetMasterClock' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyMasterClock (/* CMTimebaseRef */ IntPtr timebase); +#if !NET [iOS (9,0)][Mac (10,11)] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMaster' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("macos12.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetMaster' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe IntPtr /* void* */ CMTimebaseCopyMaster (/* CMTimebaseRef */ IntPtr timebase); +#if !NET [iOS (9,0)][Mac (10,11)] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("macos12.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyUltimateMasterClock (/* CMTimebaseRef */ IntPtr timebase); #endif From 232d489834df31d3ac9717e917ff74a41a204802 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 16 Sep 2021 14:11:55 -0400 Subject: [PATCH 2/8] [CoreMedia] Add support xcode13 beta 5. --- src/CoreMedia/CMSync.cs | 264 +++++++++++++----- tests/xtro-sharpie/MacCatalyst-CoreMedia.todo | 20 -- tests/xtro-sharpie/common-CoreMedia.ignore | 18 ++ tests/xtro-sharpie/iOS-CoreMedia.todo | 28 -- tests/xtro-sharpie/macOS-CoreMedia.todo | 28 -- tests/xtro-sharpie/tvOS-CoreMedia.todo | 28 -- tests/xtro-sharpie/watchOS-CoreMedia.todo | 28 -- 7 files changed, 206 insertions(+), 208 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/iOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/macOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/tvOS-CoreMedia.todo delete mode 100644 tests/xtro-sharpie/watchOS-CoreMedia.todo diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 607ae349bd0a..4b66d34552a4 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -14,6 +14,8 @@ using CoreFoundation; using ObjCRuntime; +#nullable enable + namespace CoreMedia { // CMSync.h @@ -54,7 +56,7 @@ public CMTime CurrentTime { [DllImport(Constants.CoreMediaLibrary)] extern static /* OSStatus */ CMClockError CMAudioClockCreate (/* CFAllocatorRef */ IntPtr allocator, /* CMClockRef* */ out IntPtr clockOut); - public static CMClock CreateAudioClock (out CMClockError clockError) + public static CMClock? CreateAudioClock (out CMClockError clockError) { IntPtr ptr; clockError = CMAudioClockCreate (IntPtr.Zero, out ptr); @@ -112,6 +114,17 @@ private CMTimebase (IntPtr handle, bool owns) } #if !COREBUILD +#if !NET + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif [DllImport(Constants.CoreMediaLibrary)] extern static /* OSStatus */ CMTimebaseError CMTimebaseCreateWithMasterClock (/* CFAllocatorRef */ IntPtr allocator, /* CMClockRef */ IntPtr masterClock, /* CMTimebaseRef* */ out IntPtr timebaseOut); @@ -127,6 +140,17 @@ public CMTimebase (CMClock masterClock) CFObject.CFRetain (Handle); } +#if !NET + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif [DllImport(Constants.CoreMediaLibrary)] extern static /* OSStatus */ CMTimebaseError CMTimebaseCreateWithMasterTimebase (/* CFAllocatorRef */ IntPtr allocator, /* CMTimebaseRef */ IntPtr masterTimebase, /* CMTimebaseRef* */ out IntPtr timebaseOut); @@ -141,7 +165,40 @@ public CMTimebase (CMTimebase masterTimebase) CFObject.CFRetain (Handle); } + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern CMTimebaseError CMTimebaseCreateWithSourceClock (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMClock */ IntPtr sourceClock, /* CMTimebase */ out IntPtr timebaseOut); + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + public CMTimebase (CFAllocator? allocator, CMClock sourceClock) + { + if (sourceClock == null) + throw new ArgumentNullException (nameof(sourceClock)); + + var error = CMTimebaseCreateWithSourceClock (allocator.GetHandle (), sourceClock.Handle, out handle); + if (error != CMTimebaseError.None) + throw new ArgumentException (error.ToString ()); + + CFObject.CFRetain (Handle); + } + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern CMTimebaseError CMTimebaseCreateWithSourceTimebase (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMTimebase */ IntPtr sourceTimebase, /* CMTimebase */ out IntPtr timebaseOut); + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + public CMTimebase (CFAllocator? allocator, CMTimebase sourceTimebase) + { + if (sourceTimebase == null) + throw new ArgumentNullException (nameof(sourceTimebase)); + + var error = CMTimebaseCreateWithSourceTimebase (allocator.GetHandle (), sourceTimebase.Handle, out handle); + if (error != CMTimebaseError.None) + throw new ArgumentException (error.ToString ()); + CFObject.CFRetain (Handle); + } [DllImport(Constants.CoreMediaLibrary)] extern static /* Float64 */ double CMTimebaseGetEffectiveRate (/* CMTimebaseRef */ IntPtr timebase); @@ -194,7 +251,7 @@ public double Rate { [Deprecated (PlatformName.iOS, 9, 0, message : "Use 'CopyMasterTimebase' instead.")] [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'CopyMasterTimebase' instead.")] - public CMTimebase GetMasterTimebase () + public CMTimebase? GetMasterTimebase () { var ptr = CMTimebaseGetMasterTimebase (Handle); if (ptr == IntPtr.Zero) @@ -210,7 +267,7 @@ public CMTimebase GetMasterTimebase () [Deprecated (PlatformName.iOS, 9, 0, message : "Use 'CopyMasterClock' instead.")] [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'CopyMasterClock' instead.")] - public CMClock GetMasterClock () + public CMClock? GetMasterClock () { var ptr = CMTimebaseGetMasterClock (Handle); if (ptr == IntPtr.Zero) @@ -226,7 +283,7 @@ public CMClock GetMasterClock () [Deprecated (PlatformName.iOS, 9, 0, message : "Use 'CopyMaster' instead.")] [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'CopyMaster' instead.")] - public CMClockOrTimebase GetMaster () + public CMClockOrTimebase? GetMaster () { var ptr = CMTimebaseGetMaster (Handle); if (ptr == IntPtr.Zero) @@ -242,7 +299,7 @@ public CMClockOrTimebase GetMaster () [Deprecated (PlatformName.iOS, 9, 0, message : "Use 'CopyUltimateMasterClock' instead.")] [Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'CopyUltimateMasterClock' instead.")] - public CMClock GetUltimateMasterClock () + public CMClock? GetUltimateMasterClock () { var ptr = CMTimebaseGetUltimateMasterClock (Handle); if (ptr == IntPtr.Zero) @@ -343,11 +400,33 @@ public CMTimebaseError SetTimerToFireImmediately (NSTimer timer) return CMTimebaseSetTimerToFireImmediately (Handle, timer.Handle); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif [DllImport(Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterTimebase (/* CMTimebaseRef* */ IntPtr timebase, /* CMTimebaseRef* */ IntPtr newMasterTimebase); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) { if (newMasterTimebase == null) @@ -356,11 +435,33 @@ public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) return CMTimebaseSetMasterTimebase (Handle, newMasterTimebase.Handle); } +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif [DllImport(Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterClock (/* CMTimebaseRef* */ IntPtr timebase, /* CMClockRef* */ IntPtr newMasterClock); +#if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] +#else + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] +#endif public CMTimebaseError SetMasterClock (CMClock newMasterClock) { if (newMasterClock == null) @@ -390,7 +491,7 @@ bool IsDeprecated () #endif } - public CMTimebase CopyMasterTimebase () + public CMTimebase? CopyMasterTimebase () { IntPtr ptr = IntPtr.Zero; bool deprecated = IsDeprecated (); @@ -407,7 +508,7 @@ public CMTimebase CopyMasterTimebase () return new CMTimebase (ptr, deprecated); } - public CMClock CopyMasterClock () + public CMClock? CopyMasterClock () { IntPtr ptr = IntPtr.Zero; bool deprecated = IsDeprecated (); @@ -424,7 +525,7 @@ public CMClock CopyMasterClock () return new CMClock (ptr, deprecated); } - public CMClockOrTimebase CopyMaster () + public CMClockOrTimebase? CopyMaster () { IntPtr ptr = IntPtr.Zero; bool deprecated = IsDeprecated (); @@ -441,7 +542,7 @@ public CMClockOrTimebase CopyMaster () return new CMClockOrTimebase (ptr, deprecated); } - public CMClock CopyUltimateMasterClock () + public CMClock? CopyUltimateMasterClock () { IntPtr ptr = IntPtr.Zero; bool deprecated = IsDeprecated (); @@ -459,101 +560,61 @@ public CMClock CopyUltimateMasterClock () } #if !NET - [iOS (9,0)][Mac (10,11)] - [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] - [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] - [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] - [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [iOS (9,0)][Mac (10,11), NoMacCatalyst] + [Deprecated (PlatformName.iOS, 9, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] + [Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'CMTimebaseGetMasterTimebase' instead.")] #else [UnsupportedOSPlatform ("ios15.0")] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] [UnsupportedOSPlatform ("macos12.0")] -#if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif IOS - [Obsolete ("Starting with ios9.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif TVOS - [Obsolete ("Starting with tvos9.0 Use 'CMTimebaseGetMasterTimebase' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif MONOMAC - [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMasterTimebase' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif #endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMTimebaseRef */ IntPtr CMTimebaseCopyMasterTimebase (/* CMTimebaseRef */ IntPtr timebase); #if !NET [iOS (9,0)][Mac (10,11)] - [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] - [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] - [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] - [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.iOS, 9, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'CMTimebaseGetMasterClock' instead.")] + [Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'CMTimebaseGetMasterClock' instead.")] #else - [UnsupportedOSPlatform ("ios15.0")] - [UnsupportedOSPlatform ("tvos15.0")] - [UnsupportedOSPlatform ("maccatalyst15.0")] - [UnsupportedOSPlatform ("macos12.0")] -#if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif IOS - [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif TVOS - [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetMasterClock' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif MONOMAC - [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif + [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.11")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyMasterClock (/* CMTimebaseRef */ IntPtr timebase); #if !NET - [iOS (9,0)][Mac (10,11)] - [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] - [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetMaster' instead.")] - [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetMaster' instead.")] - [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [iOS (9,0)][Mac (10,11), NoMacCatalyst] + [Deprecated (PlatformName.iOS, 9, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'CMTimebaseGetMaster' instead.")] + [Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'CMTimebaseGetMaster' instead.")] #else - [UnsupportedOSPlatform ("ios15.0")] - [UnsupportedOSPlatform ("tvos15.0")] - [UnsupportedOSPlatform ("maccatalyst15.0")] - [UnsupportedOSPlatform ("macos12.0")] -#if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif IOS - [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif TVOS - [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetMaster' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif MONOMAC - [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetMaster' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif + [UnsupportedOSPlatform ("ios9.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.11")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe IntPtr /* void* */ CMTimebaseCopyMaster (/* CMTimebaseRef */ IntPtr timebase); #if !NET - [iOS (9,0)][Mac (10,11)] - [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] - [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [iOS (9,0)][Mac (10,11), NoMacCatalyst] + [Deprecated (PlatformName.iOS, 9, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] + [Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'CMTimebaseGetUltimateMasterClock' instead.")] #else [UnsupportedOSPlatform ("ios15.0")] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] [UnsupportedOSPlatform ("macos12.0")] -#if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif IOS - [Obsolete ("Starting with ios15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif TVOS - [Obsolete ("Starting with tvos15.0 Use 'CMTimebaseGetUltimateMasterClock' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#elif MONOMAC - [Obsolete ("Starting with macos12.0 Use 'CMTimebaseGetUltimateMasterClock' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] -#endif #endif [DllImport(Constants.CoreMediaLibrary)] static extern unsafe /* CMClockRef */ IntPtr CMTimebaseCopyUltimateMasterClock (/* CMTimebaseRef */ IntPtr timebase); @@ -683,6 +744,57 @@ public static bool MightDrift (CMClockOrTimebase clockOrTimebaseA, CMClockOrTime return CMSyncMightDrift (clockOrTimebaseA.Handle, clockOrTimebaseB.Handle); } + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern /* CMTimebase */ IntPtr CMTimebaseCopySourceTimebase (/* CMTimebase */ IntPtr timebase); + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern int CMTimebaseSetSourceTimebase (/* CMTimebase */ IntPtr timebase, /* CMTimebase */ IntPtr newSourceTimebase); + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + public CMTimebase? SourceTimebase { + get { + var source = CMTimebaseCopySourceTimebase (Handle); + return source == IntPtr.Zero ? null : Runtime.GetINativeObject (source, true); + } + set { + CMTimebaseSetSourceTimebase (Handle, value?.GetHandle () ?? IntPtr.Zero); + } + } + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern /* CMClock */ IntPtr CMTimebaseCopySourceClock (/* CMTimebase */ IntPtr timebase); + + [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern int CMTimebaseSetSourceClock (/* CMTimebase */ IntPtr timebase, /* CMClock */ IntPtr newSourceClock); + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + public CMClock? SourceClock { + get { + var clock = CMTimebaseCopySourceClock (Handle); + return clock == IntPtr.Zero ? null : Runtime.GetINativeObject (clock, true); + } + set { + CMTimebaseSetSourceClock (Handle, value?.GetHandle() ?? IntPtr.Zero); + } + } + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + [DllImport(Constants.CoreMediaLibrary)] + static extern /* CMClock */ IntPtr CMTimebaseCopyUltimateSourceClock (/* CMTimebase */ IntPtr timebase); + + [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] + public CMClock? UltimateSourceClock { + get { + var clock = CMTimebaseCopyUltimateSourceClock (Handle); + return clock == IntPtr.Zero ? null : Runtime.GetINativeObject (clock, true); + } + } + #endif // !COREBUILD } } diff --git a/tests/xtro-sharpie/MacCatalyst-CoreMedia.todo b/tests/xtro-sharpie/MacCatalyst-CoreMedia.todo deleted file mode 100644 index 155b99805fc8..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-CoreMedia.todo +++ /dev/null @@ -1,20 +0,0 @@ -!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound -!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound -!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound -!missing-pinvoke! CMTimebaseCopySource is not bound -!missing-pinvoke! CMTimebaseCopySourceClock is not bound -!missing-pinvoke! CMTimebaseCopySourceTimebase is not bound -!missing-pinvoke! CMTimebaseCopyUltimateSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceTimebase is not bound -!missing-pinvoke! CMTimebaseSetSourceClock is not bound -!missing-pinvoke! CMTimebaseSetSourceTimebase is not bound -!unknown-pinvoke! CMTimebaseCopyMaster bound -!unknown-pinvoke! CMTimebaseCopyMasterClock bound -!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound -!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound -!unknown-pinvoke! CMTimebaseSetMasterClock bound -!unknown-pinvoke! CMTimebaseSetMasterTimebase bound -!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound diff --git a/tests/xtro-sharpie/common-CoreMedia.ignore b/tests/xtro-sharpie/common-CoreMedia.ignore index f14fd2e8b975..cf388945c3a9 100644 --- a/tests/xtro-sharpie/common-CoreMedia.ignore +++ b/tests/xtro-sharpie/common-CoreMedia.ignore @@ -46,6 +46,9 @@ !missing-field! kCMFormatDescriptionExtension_AuxiliaryTypeInfo not bound !missing-field! kCMFormatDescriptionExtension_ContainsAlphaChannel not bound !missing-field! kCMFormatDescriptionExtension_ProtectedContentOriginalFormat not bound +!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound +!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound +!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound !missing-field! kCMFormatDescriptionExtensionKey_MetadataKeyTable not bound !missing-field! kCMFormatDescriptionFieldDetail_SpatialFirstLineEarly not bound !missing-field! kCMFormatDescriptionFieldDetail_SpatialFirstLineLate not bound @@ -378,6 +381,7 @@ !missing-pinvoke! CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer is not bound !missing-pinvoke! CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer is not bound !missing-pinvoke! CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData is not bound +!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound ## block based version of CMBufferQueueCreate (which use callbacks and is already bound) !missing-pinvoke! CMBufferQueueCreateWithHandlers is not bound @@ -387,3 +391,17 @@ ## block based version of CMSampleBufferCreateForImageBuffer (which use callbacks and is already bound) !missing-pinvoke! CMSampleBufferCreateForImageBufferWithMakeDataReadyHandler is not bound + +# they are added because we need to be back compatible yet we do have code to choose the correct one +!unknown-pinvoke! CMTimebaseCopyMaster bound +!unknown-pinvoke! CMTimebaseCopyMasterClock bound +!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound +!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound +!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound +!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 diff --git a/tests/xtro-sharpie/iOS-CoreMedia.todo b/tests/xtro-sharpie/iOS-CoreMedia.todo deleted file mode 100644 index 5cb5e32db156..000000000000 --- a/tests/xtro-sharpie/iOS-CoreMedia.todo +++ /dev/null @@ -1,28 +0,0 @@ -!deprecated-attribute-missing! CMTimebaseCopyMaster missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyUltimateMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterTimebase missing a [Deprecated] attribute -!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound -!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound -!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound -!missing-pinvoke! CMTimebaseCopySource is not bound -!missing-pinvoke! CMTimebaseCopySourceClock is not bound -!missing-pinvoke! CMTimebaseCopySourceTimebase is not bound -!missing-pinvoke! CMTimebaseCopyUltimateSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceTimebase is not bound -!missing-pinvoke! CMTimebaseSetSourceClock is not bound -!missing-pinvoke! CMTimebaseSetSourceTimebase is not bound -!unknown-pinvoke! CMTimebaseCopyMaster bound -!unknown-pinvoke! CMTimebaseCopyMasterClock bound -!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound -!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound -!unknown-pinvoke! CMTimebaseSetMasterClock bound -!unknown-pinvoke! CMTimebaseSetMasterTimebase bound -!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound diff --git a/tests/xtro-sharpie/macOS-CoreMedia.todo b/tests/xtro-sharpie/macOS-CoreMedia.todo deleted file mode 100644 index 5cb5e32db156..000000000000 --- a/tests/xtro-sharpie/macOS-CoreMedia.todo +++ /dev/null @@ -1,28 +0,0 @@ -!deprecated-attribute-missing! CMTimebaseCopyMaster missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyUltimateMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterTimebase missing a [Deprecated] attribute -!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound -!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound -!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound -!missing-pinvoke! CMTimebaseCopySource is not bound -!missing-pinvoke! CMTimebaseCopySourceClock is not bound -!missing-pinvoke! CMTimebaseCopySourceTimebase is not bound -!missing-pinvoke! CMTimebaseCopyUltimateSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceTimebase is not bound -!missing-pinvoke! CMTimebaseSetSourceClock is not bound -!missing-pinvoke! CMTimebaseSetSourceTimebase is not bound -!unknown-pinvoke! CMTimebaseCopyMaster bound -!unknown-pinvoke! CMTimebaseCopyMasterClock bound -!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound -!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound -!unknown-pinvoke! CMTimebaseSetMasterClock bound -!unknown-pinvoke! CMTimebaseSetMasterTimebase bound -!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound diff --git a/tests/xtro-sharpie/tvOS-CoreMedia.todo b/tests/xtro-sharpie/tvOS-CoreMedia.todo deleted file mode 100644 index 5cb5e32db156..000000000000 --- a/tests/xtro-sharpie/tvOS-CoreMedia.todo +++ /dev/null @@ -1,28 +0,0 @@ -!deprecated-attribute-missing! CMTimebaseCopyMaster missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyUltimateMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterTimebase missing a [Deprecated] attribute -!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound -!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound -!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound -!missing-pinvoke! CMTimebaseCopySource is not bound -!missing-pinvoke! CMTimebaseCopySourceClock is not bound -!missing-pinvoke! CMTimebaseCopySourceTimebase is not bound -!missing-pinvoke! CMTimebaseCopyUltimateSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceTimebase is not bound -!missing-pinvoke! CMTimebaseSetSourceClock is not bound -!missing-pinvoke! CMTimebaseSetSourceTimebase is not bound -!unknown-pinvoke! CMTimebaseCopyMaster bound -!unknown-pinvoke! CMTimebaseCopyMasterClock bound -!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound -!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound -!unknown-pinvoke! CMTimebaseSetMasterClock bound -!unknown-pinvoke! CMTimebaseSetMasterTimebase bound -!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound diff --git a/tests/xtro-sharpie/watchOS-CoreMedia.todo b/tests/xtro-sharpie/watchOS-CoreMedia.todo deleted file mode 100644 index 5cb5e32db156..000000000000 --- a/tests/xtro-sharpie/watchOS-CoreMedia.todo +++ /dev/null @@ -1,28 +0,0 @@ -!deprecated-attribute-missing! CMTimebaseCopyMaster missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCopyUltimateMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseCreateWithMasterTimebase missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterClock missing a [Deprecated] attribute -!deprecated-attribute-missing! CMTimebaseSetMasterTimebase missing a [Deprecated] attribute -!missing-field! kCMFormatDescriptionExtension_AmbientViewingEnvironment not bound -!missing-field! kCMFormatDescriptionExtension_BitsPerComponent not bound -!missing-field! kCMFormatDescriptionExtension_HorizontalFieldOfView not bound -!missing-pinvoke! CMTimebaseCopySource is not bound -!missing-pinvoke! CMTimebaseCopySourceClock is not bound -!missing-pinvoke! CMTimebaseCopySourceTimebase is not bound -!missing-pinvoke! CMTimebaseCopyUltimateSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceClock is not bound -!missing-pinvoke! CMTimebaseCreateWithSourceTimebase is not bound -!missing-pinvoke! CMTimebaseSetSourceClock is not bound -!missing-pinvoke! CMTimebaseSetSourceTimebase is not bound -!unknown-pinvoke! CMTimebaseCopyMaster bound -!unknown-pinvoke! CMTimebaseCopyMasterClock bound -!unknown-pinvoke! CMTimebaseCopyMasterTimebase bound -!unknown-pinvoke! CMTimebaseCopyUltimateMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterClock bound -!unknown-pinvoke! CMTimebaseCreateWithMasterTimebase bound -!unknown-pinvoke! CMTimebaseSetMasterClock bound -!unknown-pinvoke! CMTimebaseSetMasterTimebase bound -!missing-field! kCMSampleAttachmentKey_CryptorSubsampleAuxiliaryData not bound From 6e82f353b4b3ec1b223a895d1b4e601de36bd7ad Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 17 Sep 2021 13:42:52 -0400 Subject: [PATCH 3/8] Add missing tests and fix deprecation after the merge. --- src/CoreMedia/CMSync.cs | 44 ++++++++++++----- .../CoreMedia/CMTimebaseTest.cs | 48 +++++++++++++++++++ 2 files changed, 80 insertions(+), 12 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 54ea80d89098..eac56065bbd3 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -468,20 +468,30 @@ public CMTimebaseError SetTimerToFireImmediately (NSTimer timer) #if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] #else - [SupportedOSPlatform ("ios13.0")] - [SupportedOSPlatform ("tvos13.0")] - [SupportedOSPlatform ("macos10.15")] + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] #endif [DllImport(Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterTimebase (/* CMTimebaseRef* */ IntPtr timebase, /* CMTimebaseRef* */ IntPtr newMasterTimebase); #if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] #else - [SupportedOSPlatform ("ios13.0")] - [SupportedOSPlatform ("tvos13.0")] - [SupportedOSPlatform ("macos10.15")] + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] #endif public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) { @@ -493,20 +503,30 @@ public CMTimebaseError SetMasterTimebase (CMTimebase newMasterTimebase) #if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] #else - [SupportedOSPlatform ("ios13.0")] - [SupportedOSPlatform ("tvos13.0")] - [SupportedOSPlatform ("macos10.15")] + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] #endif [DllImport(Constants.CoreMediaLibrary)] extern static CMTimebaseError CMTimebaseSetMasterClock (/* CMTimebaseRef* */ IntPtr timebase, /* CMClockRef* */ IntPtr newMasterClock); #if !NET [TV (13,0), Mac (10,15), iOS (13,0)] + [Deprecated (PlatformName.iOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 9, 0)] + [Deprecated (PlatformName.MacOSX, 10, 10)] + [Deprecated (PlatformName.WatchOS, 6, 0)] #else - [SupportedOSPlatform ("ios13.0")] - [SupportedOSPlatform ("tvos13.0")] - [SupportedOSPlatform ("macos10.15")] + [UnsupportedOSPlatform ("ios8.0")] + [UnsupportedOSPlatform ("tvos9.0")] + [UnsupportedOSPlatform ("maccatalyst")] + [UnsupportedOSPlatform ("macos10.10")] #endif public CMTimebaseError SetMasterClock (CMClock newMasterClock) { diff --git a/tests/monotouch-test/CoreMedia/CMTimebaseTest.cs b/tests/monotouch-test/CoreMedia/CMTimebaseTest.cs index b9e19cc0e7ea..0406205e4aa0 100644 --- a/tests/monotouch-test/CoreMedia/CMTimebaseTest.cs +++ b/tests/monotouch-test/CoreMedia/CMTimebaseTest.cs @@ -116,5 +116,53 @@ void AssertNullOrValidHandle (INativeObject o, string description) return; Assert.AreNotEqual (IntPtr.Zero, o.Handle, "AssertNullOrValidHandle - " + description); } + + [Test] + public void CMClockConstructor () + { + TestRuntime.AssertXcodeVersion (13,0); + Assert.Throws(() => { + var timebase = new CMTimebase (null, (CMClock) null); + }, "Null clock"); + + // if it throws we fail the test + using var timebase = new CMTimebase (null, CMClock.HostTimeClock); + Assert.NotNull (timebase, "Not null"); + } + + [Test] + public void SourceClockProperty () + { + TestRuntime.AssertXcodeVersion (13,0); + using var timebase = new CMTimebase (null, CMClock.HostTimeClock); + Assert.NotNull (timebase.SourceClock, "not null source clock"); + // set and if it throws we fail the test + timebase.SourceClock = CMClock.HostTimeClock; + } + + [Test] + public void CMTimebaseConstructor () + { + TestRuntime.AssertXcodeVersion (13,0); + Assert.Throws(() => { + var timebase = new CMTimebase (null, (CMTimebase) null); + }, "Null clock"); + + // if it throws we fail the test + using var mainTimebase = new CMTimebase (CMClock.HostTimeClock); + using var timebase = new CMTimebase (null, mainTimebase); + } + + [Test] + public void SourceTimebaseProperty () + { + TestRuntime.AssertXcodeVersion (13,0); + using var mainTimebase = new CMTimebase (CMClock.HostTimeClock); + using var timebase = new CMTimebase (null, mainTimebase); + Assert.NotNull (timebase.SourceTimebase, "Not null timebase"); + // if we throw we fail test test + using var secondTimebase = new CMTimebase (CMClock.HostTimeClock); + timebase.SourceTimebase = secondTimebase; + } } } From 446035b31c0db8f2f0fefccb06fc611df2f8cb5c Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 20 Sep 2021 11:34:39 -0400 Subject: [PATCH 4/8] Apply suggestions from code review Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> Co-authored-by: Rolf Bjarne Kvinge --- src/CoreMedia/CMSync.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index eac56065bbd3..73cc59fd007c 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -634,7 +634,7 @@ bool IsDeprecated () #else [UnsupportedOSPlatform ("ios15.0")] [UnsupportedOSPlatform ("tvos15.0")] - [UnsupportedOSPlatform ("maccatalyst15.0")] + [UnsupportedOSPlatform ("maccatalyst")] [UnsupportedOSPlatform ("macos12.0")] #endif [DllImport(Constants.CoreMediaLibrary)] @@ -814,7 +814,7 @@ public static bool MightDrift (CMClockOrTimebase clockOrTimebaseA, CMClockOrTime } [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] - [DllImport(Constants.CoreMediaLibrary)] + [DllImport (Constants.CoreMediaLibrary)] static extern /* CMTimebase */ IntPtr CMTimebaseCopySourceTimebase (/* CMTimebase */ IntPtr timebase); [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] From ccded67ffa3247a50b59940f09b45057ddeaf502 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 20 Sep 2021 12:12:12 -0400 Subject: [PATCH 5/8] Address reviews. --- src/CoreMedia/CMSync.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index eac56065bbd3..12e5f0e297df 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -185,8 +185,6 @@ public CMTimebase (CFAllocator? allocator, CMClock sourceClock) var error = CMTimebaseCreateWithSourceClock (allocator.GetHandle (), sourceClock.Handle, out handle); if (error != CMTimebaseError.None) throw new ArgumentException (error.ToString ()); - - CFObject.CFRetain (Handle); } [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] @@ -202,8 +200,6 @@ public CMTimebase (CFAllocator? allocator, CMTimebase sourceTimebase) var error = CMTimebaseCreateWithSourceTimebase (allocator.GetHandle (), sourceTimebase.Handle, out handle); if (error != CMTimebaseError.None) throw new ArgumentException (error.ToString ()); - - CFObject.CFRetain (Handle); } [DllImport(Constants.CoreMediaLibrary)] @@ -825,7 +821,7 @@ public static bool MightDrift (CMClockOrTimebase clockOrTimebaseA, CMClockOrTime public CMTimebase? SourceTimebase { get { var source = CMTimebaseCopySourceTimebase (Handle); - return source == IntPtr.Zero ? null : Runtime.GetINativeObject (source, true); + return Runtime.GetINativeObject (source, true); } set { CMTimebaseSetSourceTimebase (Handle, value?.GetHandle () ?? IntPtr.Zero); @@ -844,7 +840,7 @@ public CMTimebase? SourceTimebase { public CMClock? SourceClock { get { var clock = CMTimebaseCopySourceClock (Handle); - return clock == IntPtr.Zero ? null : Runtime.GetINativeObject (clock, true); + return Runtime.GetINativeObject (clock, true); } set { CMTimebaseSetSourceClock (Handle, value?.GetHandle() ?? IntPtr.Zero); @@ -859,7 +855,7 @@ public CMClock? SourceClock { public CMClock? UltimateSourceClock { get { var clock = CMTimebaseCopyUltimateSourceClock (Handle); - return clock == IntPtr.Zero ? null : Runtime.GetINativeObject (clock, true); + return Runtime.GetINativeObject (clock, true); } } From 1999eaea05fc8910698910b8e4efb358f45fd724 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 21 Sep 2021 13:55:50 -0400 Subject: [PATCH 6/8] Fix intro tests. --- src/CoreMedia/CMSync.cs | 72 ++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index 53df308cea2f..ea29a4af66c7 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -172,11 +172,19 @@ public CMTimebase (CMTimebase masterTimebase) CFObject.CFRetain (Handle); } - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern CMTimebaseError CMTimebaseCreateWithSourceClock (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMClock */ IntPtr sourceClock, /* CMTimebase */ out IntPtr timebaseOut); - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif public CMTimebase (CFAllocator? allocator, CMClock sourceClock) { if (sourceClock == null) @@ -187,11 +195,19 @@ public CMTimebase (CFAllocator? allocator, CMClock sourceClock) throw new ArgumentException (error.ToString ()); } - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern CMTimebaseError CMTimebaseCreateWithSourceTimebase (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMTimebase */ IntPtr sourceTimebase, /* CMTimebase */ out IntPtr timebaseOut); - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif public CMTimebase (CFAllocator? allocator, CMTimebase sourceTimebase) { if (sourceTimebase == null) @@ -809,15 +825,27 @@ public static bool MightDrift (CMClockOrTimebase clockOrTimebaseA, CMClockOrTime return CMSyncMightDrift (clockOrTimebaseA.Handle, clockOrTimebaseB.Handle); } - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport (Constants.CoreMediaLibrary)] static extern /* CMTimebase */ IntPtr CMTimebaseCopySourceTimebase (/* CMTimebase */ IntPtr timebase); - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern int CMTimebaseSetSourceTimebase (/* CMTimebase */ IntPtr timebase, /* CMTimebase */ IntPtr newSourceTimebase); - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif public CMTimebase? SourceTimebase { get { var source = CMTimebaseCopySourceTimebase (Handle); @@ -828,15 +856,27 @@ public CMTimebase? SourceTimebase { } } - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern /* CMClock */ IntPtr CMTimebaseCopySourceClock (/* CMTimebase */ IntPtr timebase); - [Watch (6,0), TV (9,0), Mac (10,8), iOS (6,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern int CMTimebaseSetSourceClock (/* CMTimebase */ IntPtr timebase, /* CMClock */ IntPtr newSourceClock); - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif public CMClock? SourceClock { get { var clock = CMTimebaseCopySourceClock (Handle); @@ -847,11 +887,19 @@ public CMClock? SourceClock { } } - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif [DllImport(Constants.CoreMediaLibrary)] static extern /* CMClock */ IntPtr CMTimebaseCopyUltimateSourceClock (/* CMTimebase */ IntPtr timebase); - [Watch (6,0), TV (9,0), Mac (10,11), iOS (9,0)] +#if !NET + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] +#else + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] +#endif public CMClock? UltimateSourceClock { get { var clock = CMTimebaseCopyUltimateSourceClock (Handle); From 7bd6836c21160d33cef12a4c55a35c25ed71be0d Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 24 Sep 2021 12:25:11 -0400 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Rolf Bjarne Kvinge --- src/CoreMedia/CMSync.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index ea29a4af66c7..a08a9d5a9902 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -187,8 +187,8 @@ public CMTimebase (CMTimebase masterTimebase) #endif public CMTimebase (CFAllocator? allocator, CMClock sourceClock) { - if (sourceClock == null) - throw new ArgumentNullException (nameof(sourceClock)); + if (sourceClock is null) + throw new ArgumentNullException (nameof (sourceClock)); var error = CMTimebaseCreateWithSourceClock (allocator.GetHandle (), sourceClock.Handle, out handle); if (error != CMTimebaseError.None) @@ -210,8 +210,8 @@ public CMTimebase (CFAllocator? allocator, CMClock sourceClock) #endif public CMTimebase (CFAllocator? allocator, CMTimebase sourceTimebase) { - if (sourceTimebase == null) - throw new ArgumentNullException (nameof(sourceTimebase)); + if (sourceTimebase is null) + throw new ArgumentNullException (nameof (sourceTimebase)); var error = CMTimebaseCreateWithSourceTimebase (allocator.GetHandle (), sourceTimebase.Handle, out handle); if (error != CMTimebaseError.None) @@ -852,7 +852,7 @@ public CMTimebase? SourceTimebase { return Runtime.GetINativeObject (source, true); } set { - CMTimebaseSetSourceTimebase (Handle, value?.GetHandle () ?? IntPtr.Zero); + CMTimebaseSetSourceTimebase (Handle, value.GetHandle ()); } } @@ -883,7 +883,7 @@ public CMClock? SourceClock { return Runtime.GetINativeObject (clock, true); } set { - CMTimebaseSetSourceClock (Handle, value?.GetHandle() ?? IntPtr.Zero); + CMTimebaseSetSourceClock (Handle, value.GetHandle()); } } From d43c6db10a49d6869cdd0fc3b0509ff73bb03a84 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 24 Sep 2021 13:54:28 -0400 Subject: [PATCH 8/8] Fix Catalyst intro. --- src/CoreMedia/CMSync.cs | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/CoreMedia/CMSync.cs b/src/CoreMedia/CMSync.cs index a08a9d5a9902..7a081f7d05c8 100644 --- a/src/CoreMedia/CMSync.cs +++ b/src/CoreMedia/CMSync.cs @@ -173,17 +173,17 @@ public CMTimebase (CMTimebase masterTimebase) } #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern CMTimebaseError CMTimebaseCreateWithSourceClock (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMClock */ IntPtr sourceClock, /* CMTimebase */ out IntPtr timebaseOut); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif public CMTimebase (CFAllocator? allocator, CMClock sourceClock) { @@ -196,17 +196,17 @@ public CMTimebase (CFAllocator? allocator, CMClock sourceClock) } #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern CMTimebaseError CMTimebaseCreateWithSourceTimebase (/* [NullAllowed] CFAllocatorRef */ IntPtr allocator, /* CMTimebase */ IntPtr sourceTimebase, /* CMTimebase */ out IntPtr timebaseOut); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif public CMTimebase (CFAllocator? allocator, CMTimebase sourceTimebase) { @@ -826,25 +826,25 @@ public static bool MightDrift (CMClockOrTimebase clockOrTimebaseA, CMClockOrTime } #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport (Constants.CoreMediaLibrary)] static extern /* CMTimebase */ IntPtr CMTimebaseCopySourceTimebase (/* CMTimebase */ IntPtr timebase); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern int CMTimebaseSetSourceTimebase (/* CMTimebase */ IntPtr timebase, /* CMTimebase */ IntPtr newSourceTimebase); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif public CMTimebase? SourceTimebase { get { @@ -857,25 +857,25 @@ public CMTimebase? SourceTimebase { } #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern /* CMClock */ IntPtr CMTimebaseCopySourceClock (/* CMTimebase */ IntPtr timebase); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern int CMTimebaseSetSourceClock (/* CMTimebase */ IntPtr timebase, /* CMClock */ IntPtr newSourceClock); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif public CMClock? SourceClock { get { @@ -888,17 +888,17 @@ public CMClock? SourceClock { } #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif [DllImport(Constants.CoreMediaLibrary)] static extern /* CMClock */ IntPtr CMTimebaseCopyUltimateSourceClock (/* CMTimebase */ IntPtr timebase); #if !NET - [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #else - [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0")] + [SupportedOSPlatform ("ios15.0"), SupportedOSPlatform ("tvos15.0"), SupportedOSPlatform ("macos12.0"), SupportedOSPlatform ("maccatalyst15.0")] #endif public CMClock? UltimateSourceClock { get {