[vlc-commits] [Git][videolan/vlc][3.0.x] codec: videotoolbox: handle kVTVideoDecoderReferenceMissingErr

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun May 29 22:48:41 UTC 2022



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
47776b7f by Marvin Scholz at 2022-05-29T22:33:16+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.

(cherry picked from commit f7434e60fc38e78b9356600d1452e850eb5ec2d9)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

- - - - -


1 changed file:

- modules/codec/videotoolbox.m


Changes:

=====================================
modules/codec/videotoolbox.m
=====================================
@@ -1735,6 +1735,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)
 {
@@ -1777,6 +1786,7 @@ static int HandleVTStatus(decoder_t *p_dec, OSStatus status,
         VTERRCASE(kVTFrameSiloInvalidTimeRangeErr)
         VTERRCASE(kVTCouldNotFindTemporalFilterErr)
         VTERRCASE(kVTPixelTransferNotPermittedErr)
+        VTERRCASE(kVTVideoDecoderReferenceMissingErr)
         case -12219:
             msg_Warn(p_dec, "vt session error: "
                      "'kVTColorCorrectionImageRotationFailedErr'");
@@ -1797,6 +1807,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/47776b7ff15195915eddf52fd28e4f0d25a987d1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/47776b7ff15195915eddf52fd28e4f0d25a987d1
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