applemedia: Add ARGB64_BE, RGBA64_LE support to vtenc/vtdec

We can add this now that ARGB64_BE videoconvert support was added in:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1247

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1214>
This commit is contained in:
Nirbheek Chauhan 2021-10-31 13:43:40 +05:30 committed by GStreamer Marge Bot
parent fed69c48b6
commit b8d6fd905e
2 changed files with 17 additions and 2 deletions

View file

@ -117,7 +117,7 @@ const CFStringRef
CFSTR ("RequireHardwareAcceleratedVideoDecoder");
#endif
#define VIDEO_SRC_CAPS_FORMATS "{ NV12, AYUV64 }"
#define VIDEO_SRC_CAPS_FORMATS "{ NV12, AYUV64, RGBA64_LE, ARGB64_BE }"
#define VIDEO_SRC_CAPS_NATIVE \
GST_VIDEO_CAPS_MAKE(VIDEO_SRC_CAPS_FORMATS) ";" \
@ -269,6 +269,8 @@ get_preferred_video_format (GstStructure * s, gboolean prores)
return vfmt;
break;
case GST_VIDEO_FORMAT_AYUV64:
case GST_VIDEO_FORMAT_ARGB64_BE:
case GST_VIDEO_FORMAT_RGBA64_LE:
if (prores)
return vfmt;
break;
@ -655,6 +657,12 @@ gst_vtdec_create_session (GstVtdec * vtdec, GstVideoFormat format,
#endif
cv_format = kCVPixelFormatType_4444AYpCbCr16;
break;
case GST_VIDEO_FORMAT_ARGB64_BE:
cv_format = kCVPixelFormatType_64ARGB;
break;
case GST_VIDEO_FORMAT_RGBA64_LE:
cv_format = kCVPixelFormatType_64RGBALE;
break;
default:
g_warn_if_reached ();
break;

View file

@ -159,7 +159,8 @@ static GstStaticCaps sink_caps =
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ NV12, I420 }"));
#else
static GstStaticCaps sink_caps =
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ AYUV64, UYVY, NV12, I420 }"));
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE
("{ AYUV64, UYVY, NV12, I420, RGBA64_LE, ARGB64_BE }"));
#endif
static void
@ -1549,6 +1550,9 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame)
}
switch (GST_VIDEO_INFO_FORMAT (&self->video_info)) {
case GST_VIDEO_FORMAT_ARGB64_BE:
pixel_format_type = kCVPixelFormatType_64ARGB;
break;
case GST_VIDEO_FORMAT_AYUV64:
/* This is fine for now because Apple only ships LE devices */
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
@ -1556,6 +1560,9 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame)
#endif
pixel_format_type = kCVPixelFormatType_4444AYpCbCr16;
break;
case GST_VIDEO_FORMAT_RGBA64_LE:
pixel_format_type = kCVPixelFormatType_64RGBALE;
break;
case GST_VIDEO_FORMAT_I420:
pixel_format_type = kCVPixelFormatType_420YpCbCr8Planar;
break;