applemedia: Fix pixel format for I420

In Intel Macs, using full range 8-bit 4:2:0 YCbCr results in a failure on
initialization. I've validated this to be the correct pixel format with FFmpeg:

8653dcaf7d/libavutil/hwcontext_videotoolbox.c (L45)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5191>
This commit is contained in:
L. E. Segovia 2023-08-15 21:45:56 +00:00 committed by GStreamer Marge Bot
parent 2cc30770cf
commit e52e1db5ab
3 changed files with 5 additions and 1 deletions

View file

@ -123,6 +123,8 @@ static GstVideoFormat
gst_core_media_buffer_get_video_format (OSType format) gst_core_media_buffer_get_video_format (OSType format)
{ {
switch (format) { switch (format) {
case kCVPixelFormatType_420YpCbCr8Planar:
return GST_VIDEO_FORMAT_I420;
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange:
return GST_VIDEO_FORMAT_NV12; return GST_VIDEO_FORMAT_NV12;
case kCVPixelFormatType_422YpCbCr8_yuvs: case kCVPixelFormatType_422YpCbCr8_yuvs:

View file

@ -216,6 +216,8 @@ static GstVideoFormat
gst_core_video_get_video_format (OSType format) gst_core_video_get_video_format (OSType format)
{ {
switch (format) { switch (format) {
case kCVPixelFormatType_420YpCbCr8Planar:
return GST_VIDEO_FORMAT_I420;
case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange: case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange:
return GST_VIDEO_FORMAT_NV12; return GST_VIDEO_FORMAT_NV12;
case kCVPixelFormatType_422YpCbCr8_yuvs: case kCVPixelFormatType_422YpCbCr8_yuvs:

View file

@ -59,7 +59,7 @@ gst_video_format_to_cvpixelformat (GstVideoFormat fmt)
switch (fmt) { switch (fmt) {
/* YUV */ /* YUV */
case GST_VIDEO_FORMAT_I420: case GST_VIDEO_FORMAT_I420:
return kCVPixelFormatType_420YpCbCr8PlanarFullRange; return kCVPixelFormatType_420YpCbCr8Planar;
case GST_VIDEO_FORMAT_NV12: case GST_VIDEO_FORMAT_NV12:
return kCVPixelFormatType_420YpCbCr8BiPlanarFullRange; return kCVPixelFormatType_420YpCbCr8BiPlanarFullRange;
case GST_VIDEO_FORMAT_UYVY: case GST_VIDEO_FORMAT_UYVY: