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).
This commit is contained in:
Alessandro Decina 2016-01-06 11:40:38 +11:00
parent a15d8acff0
commit e0d65937bc

View file

@ -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;