[FFmpeg-devel] [PATCH 04/15] ffmpeg_videotoolbox: support 4:2:2/4:4:4 formats

rcombs rcombs at rcombs.me
Sat Nov 13 23:09:05 EET 2021


---
 fftools/ffmpeg_videotoolbox.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/fftools/ffmpeg_videotoolbox.c b/fftools/ffmpeg_videotoolbox.c
index 4ba8618539..6c89fb48d1 100644
--- a/fftools/ffmpeg_videotoolbox.c
+++ b/fftools/ffmpeg_videotoolbox.c
@@ -65,6 +65,28 @@ static int videotoolbox_retrieve_data(AVCodecContext *s, AVFrame *frame)
 #if HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE
     case kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange:
     case kCVPixelFormatType_420YpCbCr10BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_P010; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR8BIPLANARVIDEORANGE
+    case kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange:
+    case kCVPixelFormatType_422YpCbCr8BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_NV16; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR10BIPLANARVIDEORANGE
+    case kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange:
+    case kCVPixelFormatType_422YpCbCr10BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_NV20; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_422YPCBCR16BIPLANARVIDEORANGE
+    case kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_P216; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR8BIPLANARVIDEORANGE
+    case kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange:
+    case kCVPixelFormatType_444YpCbCr8BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_NV24; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR10BIPLANARVIDEORANGE
+    case kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange:
+    case kCVPixelFormatType_444YpCbCr10BiPlanarFullRange: vt->tmp_frame->format = AV_PIX_FMT_P410; break;
+#endif
+#if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
+    case kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange: vt->tmp_frame->format = AV_PIX_FMT_P416; break;
 #endif
     default:
         av_log(NULL, AV_LOG_ERROR,
-- 
2.33.1



More information about the ffmpeg-devel mailing list