#define GST_VTDEC_CV_VIDEO_FORMAT kCVPixelFormatType_422YpCbCr8
#endif
+/* define EnableHardwareAcceleratedVideoDecoder in < 10.9 */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1090
+const CFStringRef
+ kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder =
+CFSTR ("EnableHardwareAcceleratedVideoDecoder");
+#endif
+
#define VIDEO_SRC_CAPS \
GST_VIDEO_CAPS_MAKE("{" GST_VTDEC_VIDEO_FORMAT_STR "}")
{
CFMutableDictionaryRef output_image_buffer_attrs;
VTDecompressionOutputCallbackRecord callback;
+ CFMutableDictionaryRef videoDecoderSpecification;
OSStatus status;
+ videoDecoderSpecification =
+ CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ gst_vtutil_dict_set_boolean (videoDecoderSpecification,
+ kVTVideoDecoderSpecification_EnableHardwareAcceleratedVideoDecoder, TRUE);
+
output_image_buffer_attrs =
CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
callback.decompressionOutputRefCon = vtdec;
status = VTDecompressionSessionCreate (NULL, vtdec->format_description,
- NULL, output_image_buffer_attrs, &callback, &vtdec->session);
+ videoDecoderSpecification, output_image_buffer_attrs, &callback,
+ &vtdec->session);
CFRelease (output_image_buffer_attrs);