Commit b57f255f authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

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.
parent e7935507
......@@ -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])
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment