1 # gstreamer-vaapi package version number
2 m4_define([gst_vaapi_major_version], [0])
3 m4_define([gst_vaapi_minor_version], [3])
4 m4_define([gst_vaapi_micro_version], [1])
5 m4_define([gst_vaapi_pre_version], [1])
6 m4_define([gst_vaapi_version],
7 [gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
8 m4_if(gst_vaapi_pre_version, [0], [], [
9 m4_append([gst_vaapi_version], gst_vaapi_pre_version, [.pre])
13 m4_define([gst_major_version], [0])
14 m4_define([gst_minor_version], [10])
15 m4_define([gst_micro_version], [10])
16 m4_define([gst_major_minor_version],
17 [gst_major_version.gst_minor_version])
18 m4_define([gst_version],
19 [gst_major_version.gst_minor_version.gst_micro_version])
21 # gst plugins-base version number
22 m4_define([gst_plugins_base_major_version], [0])
23 m4_define([gst_plugins_base_minor_version], [10])
24 m4_define([gst_plugins_base_micro_version], [16])
25 m4_define([gst_plugins_base_version],
26 [gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version])
28 # VA-API minimum version number
29 m4_define([va_api_x11_version], [0.31.0])
30 m4_define([va_api_glx_version], [0.32.0])
32 # gst plugins-bad version number
33 m4_define([gst_plugins_bad_major_version], [0])
34 m4_define([gst_plugins_bad_minor_version], [10])
35 m4_define([gst_plugins_bad_micro_version], [22])
36 m4_define([gst_plugins_bad_version],
37 [gst_plugins_bad_major_version.gst_plugins_bad_minor_version.gst_plugins_bad_micro_version])
39 # libva package version number
40 m4_define([libva_x11_package_version], [1.0.3])
41 m4_define([libva_glx_package_version], [1.0.9])
43 # gtk-doc version number
44 # XXX: introspection annotations require gtk-doc >= 1.12
45 m4_define([gtkdoc_major_version], [1])
46 m4_define([gtkdoc_minor_version], [9])
47 m4_define([gtkdoc_version], [gtkdoc_major_version.gtkdoc_minor_version])
50 AC_INIT([gst_vaapi], [gst_vaapi_version],
51 [gwenole.beauchesne@intel.com],
53 AC_CONFIG_SRCDIR([Makefile.am])
56 AM_CONFIG_HEADER([config.h])
58 TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
61 GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version
62 AC_SUBST(GST_VAAPI_MAJOR_VERSION)
64 LIBVA_PACKAGE_VERSION=libva_x11_package_version
65 AC_SUBST(LIBVA_PACKAGE_VERSION)
67 dnl Versions for GStreamer and plugins-base
68 GST_MAJORMINOR=gst_major_minor_version
69 GST_VERSION_REQUIRED=gst_version
70 GST_PLUGINS_BASE_VERSION_REQUIRED=gst_plugins_base_version
71 GST_PLUGINS_BAD_VERSION_REQUIRED=gst_plugins_bad_version
72 AC_SUBST(GST_MAJORMINOR)
73 AC_SUBST(GST_VERSION_REQUIRED)
74 AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED)
76 dnl Use pretty build output with automake >= 1.11
77 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
78 AM_DEFAULT_VERBOSITY=1
79 AC_SUBST(AM_DEFAULT_VERBOSITY)
88 AC_HELP_STRING([--enable-glx],
89 [enable OpenGL/X11 @<:@default=yes@:>@]),
90 [], [enable_glx="yes"])
92 AC_ARG_ENABLE(vaapi-glx,
93 AC_HELP_STRING([--enable-vaapi-glx],
94 [enable VA/GLX extensions @<:@default=yes@:>@]),
95 [], [enable_vaapi_glx="yes"])
97 AC_ARG_ENABLE(vaapisink-glx,
98 AC_HELP_STRING([--enable-vaapisink-glx],
99 [enable OpenGL/X11 to vaapisink @<:@default=yes@:>@]),
100 [], [enable_vaapisink_glx="no"])
102 dnl Check for __attribute__((visibility()))
103 AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
104 vaapi_cv_visibility_attribute,
105 [cat > conftest.c <<EOF
106 int foo __attribute__ ((visibility ("hidden"))) = 1;
107 int bar __attribute__ ((visibility ("protected"))) = 1;
109 vaapi_cv_visibility_attribute=no
110 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
111 if grep '\.hidden.*foo' conftest.s >/dev/null; then
112 if grep '\.protected.*bar' conftest.s >/dev/null; then
113 vaapi_cv_visibility_attribute=yes
119 if test $vaapi_cv_visibility_attribute = yes; then
120 vaapi_cv_visibility_attribute_hidden="__attribute__((visibility(\"hidden\")))"
122 vaapi_cv_visibility_attribute_hidden=""
124 AC_DEFINE_UNQUOTED([attribute_hidden],
125 [$vaapi_cv_visibility_attribute_hidden],
126 [Define the "hidden" visibility attribute])
128 dnl Check for basic libraries
131 dnl Check for Gtk doc
132 GTKDOC_VERSION=gtkdoc_version
133 GTK_DOC_CHECK([$GTKDOC_VERSION])
134 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
135 AC_SUBST(GTKDOC_VERSION)
138 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
139 PKG_CHECK_MODULES([GLIB], [glib-2.0])
140 AC_SUBST(GLIB_CFLAGS)
143 dnl Check for GStreamer
144 PKG_CHECK_MODULES([GST],
145 [gstreamer-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
150 AC_CACHE_CHECK([for GstBaseSink::query hook], ac_cv_have_gst_base_sink_query, [
151 saved_CFLAGS="$CFLAGS"
152 CFLAGS="$CFLAGS $GST_CFLAGS"
154 LIBS="$LIBS $GST_LIBS"
156 [#include <gst/base/gstbasesink.h>],
157 [GstBaseSinkClass klass; klass.query = NULL;],
158 [ac_cv_have_gst_base_sink_query="yes"],
159 [ac_cv_have_gst_base_sink_query="no"]
161 CFLAGS="$saved_CFLAGS"
164 if test "$ac_cv_have_gst_base_sink_query" != "yes"; then
165 AC_MSG_ERROR([GstBaseSink does not contain the 'query' vfunc])
168 dnl Check for GStreamer plugins-base
169 PKG_CHECK_MODULES([GST_PLUGINS_BASE],
170 [gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
172 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
173 AC_SUBST(GST_PLUGINS_BASE_LIBS)
175 V=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR`
176 GST_PLUGINS_BASE_MAJOR_VERSION=`echo "$V" | cut -d'.' -f1`
177 GST_PLUGINS_BASE_MINOR_VERSION=`echo "$V" | cut -d'.' -f2`
178 GST_PLUGINS_BASE_MICRO_VERSION=`echo "$V" | cut -d'.' -f3`
179 AC_SUBST(GST_PLUGINS_BASE_MAJOR_VERSION)
180 AC_SUBST(GST_PLUGINS_BASE_MINOR_VERSION)
181 AC_SUBST(GST_PLUGINS_BASE_MICRO_VERSION)
183 dnl Check for GStreamer base
184 PKG_CHECK_MODULES([GST_BASE],
185 [gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
187 AC_SUBST(GST_BASE_CFLAGS)
188 AC_SUBST(GST_BASE_LIBS)
190 dnl Check for GStreamer video
191 PKG_CHECK_MODULES([GST_VIDEO],
192 [gstreamer-video-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
194 AC_SUBST(GST_VIDEO_CFLAGS)
195 AC_SUBST(GST_VIDEO_LIBS)
197 AC_CACHE_CHECK([for GstVideoOverlayComposition],
198 ac_cv_have_gst_video_overlay_composition, [
199 saved_CFLAGS="$CFLAGS"
200 CFLAGS="$CFLAGS $GST_CFLAGS"
202 LIBS="$LIBS $GST_LIBS"
204 [#include <gst/video/video-overlay-composition.h>],
205 [GstVideoOverlayComposition *c = gst_video_overlay_composition_new(0);],
206 [ac_cv_have_gst_video_overlay_composition="yes"],
207 [ac_cv_have_gst_video_overlay_composition="no"]
209 CFLAGS="$saved_CFLAGS"
212 if test "$ac_cv_have_gst_video_overlay_composition" != "yes"; then
213 AC_MSG_ERROR([GstVideoOverlayComposition is not available])
216 dnl Check for GStreamer basevideo
217 PKG_CHECK_MODULES([GST_BASEVIDEO],
218 [gstreamer-basevideo-$GST_MAJORMINOR >= $GST_PLUGINS_BAD_VERSION_REQUIRED]
220 AC_SUBST(GST_BASEVIDEO_CFLAGS)
221 AC_SUBST(GST_BASEVIDEO_LIBS)
223 dnl Check for GStreamer interfaces
224 PKG_CHECK_MODULES([GST_INTERFACES],
225 [gstreamer-interfaces-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
227 AC_SUBST(GST_INTERFACES_CFLAGS)
228 AC_SUBST(GST_INTERFACES_LIBS)
231 dnl LDFLAGS really should only contain flags, not libs - they get added before
232 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
233 GST_ALL_LDFLAGS="-no-undefined"
234 AC_SUBST(GST_ALL_LDFLAGS)
236 dnl GST_PLUGIN_LDFLAGS:
237 dnl this really should only contain flags, not libs - they get added before
238 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
239 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS"
240 AC_SUBST(GST_PLUGIN_LDFLAGS)
242 dnl Check for the GStreamer plugins directory
243 AC_MSG_CHECKING([for GStreamer plugins directory])
244 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
245 if test -z "$GST_PLUGINS_DIR"; then
246 echo "FAIL FAIL FAIL"
247 GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
249 AC_MSG_RESULT([$GST_PLUGINS_DIR])
250 plugindir="$GST_PLUGINS_DIR"
254 PKG_CHECK_MODULES(X11, [x11])
258 if test "$enable_glx" != "yes"; then
263 AC_CHECK_HEADERS([GL/gl.h GL/glext.h GL/glx.h], [], [USE_GLX=0], [
268 AC_CHECK_LIB(GL, glXCreateContext, [GLX_LIBS="-lGL"], [USE_GLX=0])
273 LIBVA_PKGNAME="libva"
274 PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME])
275 AC_SUBST(LIBVA_PKGNAME)
277 dnl ... original VA-API 0.29
278 AC_CACHE_CHECK([for old VA-API 0.29],
279 ac_cv_have_vaapi_old, [
280 saved_CFLAGS="$CFLAGS"
281 CFLAGS="$CFLAGS $LIBVA_CFLAGS"
283 LIBS="$LIBS $LIBVA_LIBS"
285 [#include <va_x11.h>],
286 [vaGetDisplay(NULL)],
287 [ac_cv_have_vaapi_old="yes"],
288 [ac_cv_have_vaapi_old="no"])
289 CFLAGS="$saved_CFLAGS"
292 if test "$ac_cv_have_vaapi_old" = "yes"; then
293 LIBVA_EXTRA_CFLAGS="$LIBVA_CFLAGS -DGST_VAAPI_USE_OLD_VAAPI_0_29"
296 dnl ... VA-API >= 0.31 or -sds
297 LIBVA_X11_PKGNAME="libva-x11"
298 PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME],
299 [ac_cv_have_vaapi_x11="yes"],
300 [ac_cv_have_vaapi_x11="no"]
302 if test "$ac_cv_have_vaapi_x11" = "no"; then
303 if test "$ac_cv_have_vaapi_old" = "yes"; then
304 LIBVA_X11_PKGNAME="libva"
305 CFLAGS="$CFLAGS $LIBVA_EXTRA_CFLAGS"
306 LIBS="$LIBS $LIBVA_EXTRA_LIBS"
308 AC_MSG_ERROR([could not find VA-API])
311 AC_SUBST(LIBVA_X11_PKGNAME)
313 dnl ... VA-API >= 0.31 or -sds (VA/GLX extensions)
315 if test $USE_GLX -eq 1; then
316 if test "$enable_vaapi_glx" = "yes"; then
317 LIBVA_GLX_PKGNAME="libva-glx"
318 PKG_CHECK_MODULES(LIBVA_GLX, [$LIBVA_GLX_PKGNAME],
319 [ac_cv_have_vaapi_glx="yes" USE_VAAPI_GLX=1],
320 [ac_cv_have_vaapi_glx="no"]
323 if test $USE_VAAPI_GLX -eq 0; then
324 AC_MSG_WARN([VA/GLX not found or disabled. Fallbacking to TFP+FBO])
325 LIBVA_GLX_PKGNAME="$LIBVA_X11_PKGNAME"
328 AC_SUBST(LIBVA_GLX_PKGNAME)
330 AC_SUBST(LIBVA_EXTRA_CFLAGS)
331 AC_SUBST(LIBVA_EXTRA_LIBS)
333 dnl Check for OpenGL support to vaapisink
334 if test "$enable_vaapisink_glx:$USE_GLX" = "yes:1"; then
341 PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec])
342 AC_CHECK_HEADERS([libavcodec/avcodec.h ffmpeg/avcodec.h])
343 AC_CHECK_HEADERS([libavcodec/vaapi.h ffmpeg/vaapi.h], [break],
344 AC_MSG_ERROR([The system FFmpeg headers do not support VA-API]))
346 AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
347 [Defined to 1 if GLX is enabled])
348 AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
350 AC_DEFINE_UNQUOTED(USE_VAAPI_GLX, $USE_VAAPI_GLX,
351 [Defined to 1 if VA/GLX is enabled])
352 AM_CONDITIONAL(USE_VAAPI_GLX, test $USE_VAAPI_GLX -eq 1)
354 AC_DEFINE_UNQUOTED(USE_VAAPISINK_GLX, $USE_VAAPISINK_GLX,
355 [Defined to 1 to enable GLX support to vaapisink])
356 AM_CONDITIONAL(USE_VAAPISINK_GLX, test $USE_VAAPISINK_GLX -eq 1)
358 VA_VERSION=`$PKG_CONFIG --modversion libva`
359 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
360 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
361 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
362 VA_VERSION_STR="$VA_VERSION"
364 pkgconfigdir=${libdir}/pkgconfig
365 AC_SUBST(pkgconfigdir)
369 debian.upstream/Makefile
370 debian.upstream/changelog
371 debian.upstream/control
372 debian.upstream/gstreamer$GST_MAJORMINOR-vaapi.install:\
373 debian.upstream/gstreamer-vaapi.install.in
374 debian.upstream/gstreamer$GST_MAJORMINOR-vaapi-doc.install:\
375 debian.upstream/gstreamer-vaapi-doc.install.in
376 debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
377 debian.upstream/libgstvaapi.install.in
378 debian.upstream/libgstvaapi-dev.install
379 debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
380 debian.upstream/libgstvaapi-x11.install.in
381 debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:\
382 debian.upstream/libgstvaapi-glx.install.in
384 docs/reference/Makefile
385 docs/reference/libs/Makefile
386 docs/reference/libs/libs-docs.xml
387 docs/reference/plugins/Makefile
388 docs/reference/plugins/plugins-docs.xml
390 gst-libs/gst/Makefile
391 gst-libs/gst/gstutils_version.h
392 gst-libs/gst/vaapi/Makefile
394 pkgconfig/gstreamer-vaapi-$GST_MAJORMINOR.pc:\
395 pkgconfig/gstreamer-vaapi.pc.in
396 pkgconfig/gstreamer-vaapi-glx-$GST_MAJORMINOR.pc:\
397 pkgconfig/gstreamer-vaapi-glx.pc.in
398 pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\
399 pkgconfig/gstreamer-vaapi-x11.pc.in
407 test $1 -eq 1 && echo yes || echo no
411 echo $PACKAGE configuration summary:
413 echo VA-API version ................... : $VA_VERSION_STR
414 echo GLX support ...................... : $(yesno $USE_GLX)
415 echo VA/GLX support ................... : $(yesno $USE_VAAPI_GLX)
416 echo VaapiSink/GL ..................... : $(yesno $USE_VAAPISINK_GLX)