configure: improve openh264 check

The openh264 API is still unstable, so check for
structure member that we need to prevent building
against an older incompatible version.
This commit is contained in:
Tim-Philipp Müller 2014-10-22 13:03:30 +01:00
parent 6c8446ffa6
commit 871ec4693c

View file

@ -2575,8 +2575,24 @@ AG_GST_CHECK_FEATURE(OPENEXR, [openexr library], openexr, [
dnl *** openh264 ***
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENH264, true)
AG_GST_CHECK_FEATURE(OPENH264, [openh264 library], openh264, [
AC_LANG_PUSH([C++])
AG_GST_CHECK_LIBHEADER(OPENH264, openh264, WelsSnprintf, $PTHREAD_LIBS,
wels/codec_api.h, OPENH264_LIBS="-lopenh264 $PTHREAD_LIBS")
wels/codec_api.h, [
AC_MSG_CHECKING([for right openh264 version/snapshot])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wels/codec_app_def.h>
#include <wels/codec_api.h>]], [[
SFrameBSInfo frame_info;
int *p = (int *) &frame_info.eFrameType;
*p = 0;
]])], [
AC_MSG_RESULT(yes)
OPENH264_LIBS="-lopenh264 $PTHREAD_LIBS"
], [
AC_MSG_RESULT(no)
HAVE_OPENH264="no"
])
])
AC_LANG_POP([C++])
AC_SUBST(OPENH264_LIBS)
])