From: Davide Bertola Date: Tue, 17 Dec 2013 09:01:42 +0000 (+0100) Subject: applemedia: vtdec: Enable hardware accelerated decoding on 10.9 X-Git-Tag: 1.19.3~507^2~12847 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72e989f2da0fc35d6d8b974a660933a273519566;p=platform%2Fupstream%2Fgstreamer.git applemedia: vtdec: Enable hardware accelerated decoding on 10.9 --- diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c index 7ba1625..c785419 100644 --- a/sys/applemedia/vtdec.c +++ b/sys/applemedia/vtdec.c @@ -96,6 +96,13 @@ static GstStaticPadTemplate gst_vtdec_sink_template = #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 "}") @@ -309,8 +316,15 @@ gst_vtdec_create_session (GstVtdec * vtdec) { 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); @@ -327,7 +341,8 @@ gst_vtdec_create_session (GstVtdec * vtdec) 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);