[NET 6 Attribute Conversion] VideoToolbox (#14060)

* Remove existing attributes

* Attribute Conversion

* Remove existing attributes

* Attribute Conversion

* reverting whole file as per suggestion

* clean up on aisle 4
This commit is contained in:
Steve Hawley 2022-02-04 09:52:43 -05:00 коммит произвёл GitHub
Родитель 9efcac2eb7
Коммит 2fde8600b2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 153 добавлений и 49 удалений

Просмотреть файл

@ -285,7 +285,11 @@ namespace VideoToolbox {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,9)]
#endif
public VTH264EntropyMode H264EntropyMode {
@ -494,9 +498,9 @@ namespace VideoToolbox {
}
#if NET
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
#else
[Introduced (PlatformName.MacOSX, 10,15)]
[Introduced (PlatformName.iOS, 13,0)]

Просмотреть файл

@ -26,9 +26,11 @@ using NativeHandle = System.IntPtr;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (8,0), TV (10,2)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTCompressionSession : VTSession {
GCHandle callbackHandle;
@ -223,13 +225,21 @@ namespace VideoToolbox {
return null;
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,9)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
extern static VTStatus VTCompressionSessionPrepareToEncodeFrames (IntPtr handle);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,9)]
#endif
public VTStatus PrepareToEncodeFrames ()
@ -337,13 +347,21 @@ namespace VideoToolbox {
return VTCompressionSessionCompleteFrames (GetCheckedHandle (), completeUntilPresentationTimeStamp);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
extern static VTStatus VTCompressionSessionBeginPass (IntPtr session, VTCompressionSessionOptionFlags flags, IntPtr reserved);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
public VTStatus BeginPass (VTCompressionSessionOptionFlags flags)
@ -351,19 +369,31 @@ namespace VideoToolbox {
return VTCompressionSessionBeginPass (GetCheckedHandle (), flags, IntPtr.Zero);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
extern static VTStatus VTCompressionSessionEndPass (IntPtr session, out byte furtherPassesRequestedOut, IntPtr reserved);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
extern static VTStatus VTCompressionSessionEndPass (IntPtr session, IntPtr ptrByte, IntPtr reserved);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
public VTStatus EndPass (out bool furtherPassesRequested)
@ -379,7 +409,11 @@ namespace VideoToolbox {
return VTCompressionSessionEndPass (GetCheckedHandle (), IntPtr.Zero, IntPtr.Zero);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
@ -388,7 +422,11 @@ namespace VideoToolbox {
/* CMItemCount* */ out int itemCount,
/* const CMTimeRange** */ out IntPtr target);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10)]
#endif
public VTStatus GetTimeRangesForNextPass (out CMTimeRange []? timeRanges)

Просмотреть файл

@ -26,9 +26,11 @@ using NativeHandle = System.IntPtr;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (8,0), TV (10,2)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTDecompressionSession : VTSession {
@ -56,7 +58,7 @@ namespace VideoToolbox {
base.Dispose (disposing);
}
[StructLayout(LayoutKind.Sequential)]
[StructLayout (LayoutKind.Sequential)]
struct VTDecompressionOutputCallbackRecord
{
#if NET
@ -363,20 +365,26 @@ namespace VideoToolbox {
}
#if NET
[SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
#else
[Mac (10,13), iOS (11,0), TV (11,0)]
[Mac (10,13)]
[iOS (11,0)]
[TV (11,0)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
extern static bool VTIsHardwareDecodeSupported (CMVideoCodecType codecType);
#if NET
[SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
#else
[Mac (10,13), iOS (11,0), TV (11,0)]
[Mac (10,13)]
[iOS (11,0)]
[TV (11,0)]
#endif
public static bool IsHardwareDecodeSupported (CMVideoCodecType codecType)
{

Просмотреть файл

@ -25,9 +25,13 @@ using NativeHandle = System.IntPtr;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10), iOS (8,0), TV (10,2)]
[Mac (10,10)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTFrameSilo : NativeObject {
#if !NET

Просмотреть файл

@ -25,9 +25,13 @@ using NativeHandle = System.IntPtr;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,10), iOS (8,0), TV (10,2)]
[Mac (10,10)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTMultiPassStorage : NativeObject {
bool closed;

Просмотреть файл

@ -7,6 +7,7 @@
//
using System;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Collections.Generic;
using CoreFoundation;
@ -84,7 +85,10 @@ namespace VideoToolbox {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (10,0)]
#endif
public VTColorPrimaries DestinationColorPrimaries {
@ -124,7 +128,10 @@ namespace VideoToolbox {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (10,0)]
#endif
public VTTransferFunction DestinationTransferFunction {

Просмотреть файл

@ -26,9 +26,11 @@ using NativeHandle = System.IntPtr;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (8,0), TV (10,2)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTSession : NativeObject {
#if !NET

Просмотреть файл

@ -21,9 +21,13 @@ using CoreVideo;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("macos10.11")]
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[Mac (10,11), iOS (9,0), TV (10,2)]
[Mac (10,11)]
[iOS (9,0)]
[TV (10,2)]
#endif
public static class VTUtilities {
[DllImport (Constants.VideoToolboxLibrary)]
@ -53,22 +57,26 @@ namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("ios")]
#else
[NoWatch, NoTV, NoiOS, Mac (11,0)]
[NoWatch]
[NoTV]
[NoiOS]
[Mac (11,0)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
static extern void VTRegisterSupplementalVideoDecoderIfAvailable (uint codecType);
#if NET
[SupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("ios")]
#else
[NoWatch, NoTV, NoiOS, Mac (11,0)]
[NoWatch]
[NoTV]
[NoiOS]
[Mac (11,0)]
#endif
public static void RegisterSupplementalVideoDecoder (CMVideoCodecType codecType)
=> VTRegisterSupplementalVideoDecoderIfAvailable ((uint) codecType);

Просмотреть файл

@ -16,9 +16,11 @@ using CoreMedia;
namespace VideoToolbox {
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("tvos10.2")]
#else
[iOS (8,0), TV (10,2)]
[iOS (8,0)]
[TV (10,2)]
#endif
public class VTVideoEncoder {
@ -49,66 +51,80 @@ namespace VideoToolbox {
public string EncoderName { get; private set; }
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public ulong? GpuRegistryId { get; private set; } // optional, same type as `[MTLDevice registryID]`
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public NSDictionary SupportedSelectionProperties {get; private set; }
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public NSNumber PerformanceRating { get; private set; }
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public NSNumber QualityRating { get; private set; }
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public bool? InstanceLimit { get; private set; }
#if NET
[SupportedOSPlatform ("macos10.14.6")]
[SupportedOSPlatform ("ios13.0")]
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.14.6")]
#else
[Mac (10,14,6), iOS (13,0), TV (13,0)]
[Mac (10,14,6)]
[iOS (13,0)]
[TV (13,0)]
#endif
public bool? IsHardwareAccelerated { get; private set; }
#if NET
[SupportedOSPlatform ("ios14.2")]
[SupportedOSPlatform ("tvos14.2")]
[SupportedOSPlatform ("maccatalyst14.2")]
[SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst14.2")]
#else
[iOS (14,2)][TV (14,2)][Mac (11,0)]
[iOS (14,2)]
[TV (14,2)]
[Mac (11,0)]
[MacCatalyst (14,2)]
#endif
public bool SupportsFrameReordering { get; private set; }
@ -118,13 +134,17 @@ namespace VideoToolbox {
public bool SupportsMultiPass { get; private set; }
#endif // !NET
#if !NET
[iOS (15,0), TV (15,0), MacCatalyst (15,0), Mac (12,0), Watch (8,0)]
#else
#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("macos12.0")]
#else
[iOS (15,0)]
[TV (15,0)]
[MacCatalyst (15,0)]
[Mac (12,0)]
[Watch (8,0)]
#endif
public bool IncludeStandardDefinitionDVEncoders { get; private set; }
@ -189,10 +209,13 @@ namespace VideoToolbox {
}
#if NET
[SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
#else
[Mac (10,13), iOS (11,0), TV (11,0)]
[Mac (10,13)]
[iOS (11,0)]
[TV (11,0)]
#endif
[DllImport (Constants.VideoToolboxLibrary)]
static extern /* OSStatus */ VTStatus VTCopySupportedPropertyDictionaryForEncoder (
@ -205,10 +228,13 @@ namespace VideoToolbox {
);
#if NET
[SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
#else
[Mac (10,13), iOS (11,0), TV (11,0)]
[Mac (10,13)]
[iOS (11,0)]
[TV (11,0)]
#endif
public static VTSupportedEncoderProperties GetSupportedEncoderProperties (int width, int height, CMVideoCodecType codecType, NSDictionary encoderSpecification = null)
{
@ -235,10 +261,13 @@ namespace VideoToolbox {
}
#if NET
[SupportedOSPlatform ("macos10.13")]
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
#else
[Mac (10,13), iOS (11,0), TV (11,0)]
[Mac (10,13)]
[iOS (11,0)]
[TV (11,0)]
#endif
public class VTSupportedEncoderProperties {
public string EncoderId { get; set; }