[vlc-commits] [Git][videolan/vlc][master] codec: videotoolbox: handle kVTVideoDecoderReferenceMissingErr
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Wed May 25 17:04:14 UTC 2022
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
f7434e60 by Marvin Scholz at 2022-05-25T16:46:20+00:00
codec: videotoolbox: handle kVTVideoDecoderReferenceMissingErr
The kVTVideoDecoderReferenceMissingErr error is not a critical one,
but without it being handled here, it would lead to aborting with
VideoToolbox and falling back to Software.
Reproduced this with a sample provided by zhilizhao(èµµå¿ç«),
related to !1790.
I assume that before this error code was introduced in macOS 12/iOS 15,
VT did just return the NULL image buffer with a success status code,
leading to the issue seen in !1790.
- - - - -
1 changed file:
- modules/codec/videotoolbox.c
Changes:
=====================================
modules/codec/videotoolbox.c
=====================================
@@ -1685,6 +1685,15 @@ static CMSampleBufferRef VTSampleBufferCreate(decoder_t *p_dec,
return sample_buf;
}
+// Error enum values introduced in macOS 12 / iOS 15 SDKs
+#if ((TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED < 120000) || \
+ (TARGET_OS_TV && __TV_OS_VERSION_MAX_ALLOWED < 150000) || \
+ (TARGET_OS_IOS && __IPHONE_OS_VERSION_MAX_ALLOWED < 150000))
+enum {
+ kVTVideoDecoderReferenceMissingErr = -17694
+}
+#endif
+
static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
enum vtsession_status * p_vtsession_status)
{
@@ -1729,6 +1738,7 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
VTERRCASE(kVTCouldNotFindTemporalFilterErr)
VTERRCASE(kVTPixelTransferNotPermittedErr)
VTERRCASE(kVTColorCorrectionImageRotationFailedErr)
+ VTERRCASE(kVTVideoDecoderReferenceMissingErr)
/* Legacy error codes defined in the old Carbon MacErrors.h */
VTERRCASE_LEGACY(-8960, "codecErr")
@@ -1753,6 +1763,7 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
case -8960 /* codecErr */:
case kVTVideoDecoderMalfunctionErr:
case kVTInvalidSessionErr:
+ case kVTVideoDecoderReferenceMissingErr:
*p_vtsession_status = VTSESSION_STATUS_RESTART;
break;
case -8969 /* codecBadDataErr */:
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f7434e60fc38e78b9356600d1452e850eb5ec2d9
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f7434e60fc38e78b9356600d1452e850eb5ec2d9
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list