diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-10-19 14:51:40 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-10-19 14:59:03 +0200 |
commit | a847592640eafe8200bdb839ad41a9d1b4fd64d0 (patch) | |
tree | 0063f538cdb77258ea605b95491c8e0fc674da57 | |
parent | 399766b35b10c24381b1a80e75d217e9665d0953 (diff) | |
download | gstreamer-plugins-bad-a847592640eafe8200bdb839ad41a9d1b4fd64d0.tar.gz |
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.
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | sys/applemedia/vtenc.c | 14 |
2 files changed, 19 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index b4f3b5036..debccc725 100644 --- a/configure.ac +++ b/configure.ac @@ -503,6 +503,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 40eb4a268..13c9412b8 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); |