From da4f5a8d1b82203d8df733b993a4ca0aaf375feb Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 21 Feb 2022 20:44:10 +0100 Subject: [PATCH] [VideoToolbox] Remove VTDecompressionSession.Create overload requiring manual reference counting. We already have a better overload that does not need manual reference counting. --- src/VideoToolbox/VTDecompressionSession.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/VideoToolbox/VTDecompressionSession.cs b/src/VideoToolbox/VTDecompressionSession.cs index d581fc0fce15..ccafeb99e231 100644 --- a/src/VideoToolbox/VTDecompressionSession.cs +++ b/src/VideoToolbox/VTDecompressionSession.cs @@ -186,26 +186,27 @@ public static VTDecompressionSession Create (CMVideoFormatDescription formatDesc : null; } #endif - [Obsolete ("This overload requires that the provided compressionOutputCallback manually CFRetain the passed CMSampleBuffer, use Create(VTDecompressionOutputCallback,CMVideoFormatDescription,VTVideoDecoderSpecification,CVPixelBufferAttributes) variant instead which does not have that requirement.")] +#if !NET + [Obsolete ("This overload requires that the provided compressionOutputCallback manually CFRetain the passed CMSampleBuffer, use Create(VTDecompressionOutputCallback,CMVideoFormatDescription,VTVideoDecoderSpecification,CVPixelBufferAttributes) variant instead which does not have that requirement.")] public static VTDecompressionSession? Create (VTDecompressionOutputCallback outputCallback, CMVideoFormatDescription formatDescription, VTVideoDecoderSpecification? decoderSpecification = null, // hardware acceleration is default behavior on iOS. no opt-in required. NSDictionary? destinationImageBufferAttributes = null) { -#if NET - unsafe { - return Create (outputCallback, formatDescription, decoderSpecification, destinationImageBufferAttributes, &DecompressionCallback); - } -#else return Create (outputCallback, formatDescription, decoderSpecification, destinationImageBufferAttributes, static_DecompressionOutputCallback); -#endif } +#endif // !NET public static VTDecompressionSession? Create (VTDecompressionOutputCallback outputCallback, CMVideoFormatDescription formatDescription, +#if NET + VTVideoDecoderSpecification? decoderSpecification = null, // hardware acceleration is default behavior on iOS. no opt-in required. + CVPixelBufferAttributes? destinationImageBufferAttributes = null) +#else VTVideoDecoderSpecification? decoderSpecification, // hardware acceleration is default behavior on iOS. no opt-in required. CVPixelBufferAttributes? destinationImageBufferAttributes) +#endif { #if NET unsafe {