PR #20679 opened by timblechmann
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20679
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20679.patch

i'd appreciate a second pair of eyes on this patch: it tries to enable support 
for kCVPixelFormatType_422YpCbCr8_yuvs mapped to AV_PIX_FMT_YUYV422. it is an 
attempt to fix a bug in qtmultimedia when feeding video frames using 
kCVPixelFormatType_422YpCbCr8_yuvs into ffmpeg.

context:
https://bugreports.qt.io/browse/QTBUG-137436

any thoughts if this goes into the correct direction?


>From 7c01c559d47210bcc231d95ee62d5246218a8b15 Mon Sep 17 00:00:00 2001
From: Tim Blechmann <[email protected]>
Date: Tue, 24 Jun 2025 12:27:05 +0800
Subject: [PATCH] CoreVideo: add support for kCVPixelFormatType_422YpCbCr8_yuvs

---
 configure                          | 1 +
 libavutil/hwcontext_videotoolbox.c | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/configure b/configure
index 7828381b5d..a323492b9b 100755
--- a/configure
+++ b/configure
@@ -2531,6 +2531,7 @@ TYPES_LIST="
     kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange
     kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange
     kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange
+    kCVPixelFormatType_422YpCbCr8_yuvs
     kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
     kCVImageBufferTransferFunction_ITU_R_2100_HLG
     kCVImageBufferTransferFunction_Linear
diff --git a/libavutil/hwcontext_videotoolbox.c 
b/libavutil/hwcontext_videotoolbox.c
index 102fa485e5..2764097413 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -82,6 +82,9 @@ static const struct {
 #if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
     { kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange, false, AV_PIX_FMT_P416 
},
 #endif
+#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8_YUVS
+    { kCVPixelFormatType_422YpCbCr8_yuvs,               false, 
AV_PIX_FMT_YUYV422 },
+#endif
 };
 
 static const enum AVPixelFormat supported_formats[] = {
@@ -112,6 +115,9 @@ static const enum AVPixelFormat supported_formats[] = {
 #endif
 #if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
     AV_PIX_FMT_P416,
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8_YUVS
+    AV_PIX_FMT_YUYV422,
 #endif
     AV_PIX_FMT_BGRA,
 };
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to