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.
This commit is contained in:
Sebastian Dröge 2014-10-19 14:51:40 +02:00
parent e79355078e
commit b57f255f26
2 changed files with 19 additions and 5 deletions

View file

@ -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])

View file

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