From: Sebastian Dröge Date: Sun, 19 Oct 2014 12:51:40 +0000 (+0200) Subject: vtenc: VTCompressionSessionPrepareToEncodeFrames only exists since 10.9.6 X-Git-Tag: 1.19.3~507^2~10122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b57f255f26e8f8cb337b0049b0a96ab1f3f1037f;p=platform%2Fupstream%2Fgstreamer.git vtenc: VTCompressionSessionPrepareToEncodeFrames only exists since 10.9.6 Check with configure for it instead of using one of the availability macros as those wouldn't work as expected with minor versions. --- diff --git a/configure.ac b/configure.ac index c305646..af0435a 100644 --- a/configure.ac +++ b/configure.ac @@ -504,6 +504,16 @@ AC_CHECK_HEADER(AVFoundation/AVFoundation.h, HAVE_AVFOUNDATION="yes", HAVE_AVFOU AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-]) AC_CHECK_HEADER(VideoToolbox/VideoToolbox.h, HAVE_VIDEOTOOLBOX="yes", HAVE_VIDEOTOOLBOX="no", [-]) +if test "x$HAVE_VIDEOTOOLBOX" = "xyes"; then + old_LIBS=$LIBS + LIBS="$LIBS -framework VideoToolbox" + AC_CHECK_FUNC(VTCompressionSessionPrepareToEncodeFrames, [ + AC_DEFINE(HAVE_VIDEOTOOLBOX_10_9_6, 1, [Define if building with VideoToolbox >= 10.9.6]) + ], [ + ]) + LIBS=$old_LIBS +fi + AM_CONDITIONAL(HAVE_AVFOUNDATION, test "x$HAVE_AVFOUNDATION" = "xyes") if test "x$HAVE_AVFOUNDATION" = "xyes"; then AC_DEFINE(HAVE_AVFOUNDATION, 1, [Define if building with AVFoundation]) diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c index 40eb4a2..13c9412 100644 --- a/sys/applemedia/vtenc.c +++ b/sys/applemedia/vtenc.c @@ -492,12 +492,16 @@ gst_vtenc_create_session (GstVTEnc * self) gst_vtenc_session_configure_bitrate (self, session, gst_vtenc_get_bitrate (self)); - status = VTCompressionSessionPrepareToEncodeFrames (session); - if (status != noErr) { - GST_ERROR_OBJECT (self, - "VTCompressionSessionPrepareToEncodeFrames() returned: %d", - (int) status); +#ifdef HAVE_VIDEOTOOLBOX_10_9_6 + if (VTCompressionSessionPrepareToEncodeFrames) { + status = VTCompressionSessionPrepareToEncodeFrames (session); + if (status != noErr) { + GST_ERROR_OBJECT (self, + "VTCompressionSessionPrepareToEncodeFrames() returned: %d", + (int) status); + } } +#endif beach: CFRelease (pb_attrs);