Skip to content

Commit

Permalink
[VideoToolbox] Remove VTDecompressionSession.Create overload requirin…
Browse files Browse the repository at this point in the history
…g manual reference counting. (xamarin#14218)

We already have a better overload that does not need manual reference counting.
  • Loading branch information
rolfbjarne authored and TJ Lambert committed Mar 8, 2022
1 parent 756e2db commit c9570a7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/VideoToolbox/VTDecompressionSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c9570a7

Please sign in to comment.