From e0d65937bc15c9a888e7c54d39c65c08dfb6884b Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 6 Jan 2016 11:40:38 +1100 Subject: [PATCH] applemedia: vtenc: accept UYVY on Mac When doing GLMemory avfvideosrc negotiates UYVY. This change allows avfvideosrc ! tee name=t ! ... ! glimagesink t. ! ... ! gldownload ! vtenc_h264 ! ... to do GLMemory and 0-copy with the encoder (with the CV meta). --- sys/applemedia/vtenc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c index f0af751baf..43366ea5bf 100644 --- a/sys/applemedia/vtenc.c +++ b/sys/applemedia/vtenc.c @@ -136,8 +136,13 @@ static void gst_pixel_buffer_release_cb (void *releaseRefCon, const void *planeAddresses[]); #endif +#ifdef HAVE_IOS 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 ("{ UYVY, NV12, I420 }")); +#endif static void gst_vtenc_base_init (GstVTEncClass * klass) @@ -1164,6 +1169,9 @@ gst_vtenc_encode_frame (GstVTEnc * self, GstVideoCodecFrame * frame) case GST_VIDEO_FORMAT_NV12: pixel_format_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; break; + case GST_VIDEO_FORMAT_UYVY: + pixel_format_type = kCVPixelFormatType_422YpCbCr8; + break; default: gst_vtenc_frame_free (vframe); goto cv_error;