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], [7])
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 AC_ARG_ENABLE(ffmpeg,
103 AC_HELP_STRING([--enable-ffmpeg],
104 [enable bitstream parsing from FFmpeg @<:@default=yes@:>@]),
105 [], [enable_ffmpeg="yes"])
107 AC_ARG_ENABLE(codecparsers,
108 AC_HELP_STRING([--enable-codecparsers],
109 [enable adhoc bitstream parsers from GStreamer @<:@default=yes@:>@]),
110 [], [enable_codecparsers="yes"])
112 dnl Check for __attribute__((visibility()))
113 AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
114 vaapi_cv_visibility_attribute,
115 [cat > conftest.c <<EOF
116 int foo __attribute__ ((visibility ("hidden"))) = 1;
117 int bar __attribute__ ((visibility ("protected"))) = 1;
119 vaapi_cv_visibility_attribute=no
120 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
121 if grep '\.hidden.*foo' conftest.s >/dev/null; then
122 if grep '\.protected.*bar' conftest.s >/dev/null; then
123 vaapi_cv_visibility_attribute=yes
129 if test $vaapi_cv_visibility_attribute = yes; then
130 vaapi_cv_visibility_attribute_hidden="__attribute__((visibility(\"hidden\")))"
132 vaapi_cv_visibility_attribute_hidden=""
134 AC_DEFINE_UNQUOTED([attribute_hidden],
135 [$vaapi_cv_visibility_attribute_hidden],
136 [Define the "hidden" visibility attribute])
138 dnl Check for basic libraries
141 dnl Check for Gtk doc
142 GTKDOC_VERSION=gtkdoc_version
143 GTK_DOC_CHECK([$GTKDOC_VERSION])
144 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
145 AC_SUBST(GTKDOC_VERSION)
148 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
149 PKG_CHECK_MODULES([GLIB], [glib-2.0])
150 AC_CHECK_LIB([glib-2.0], [g_list_free_full], [
151 AC_DEFINE([HAVE_G_LIST_FREE_FULL], [1],
152 [Define to 1 if g_list_free_full() is available.])])
153 AC_SUBST(GLIB_CFLAGS)
156 dnl Check for GStreamer
157 PKG_CHECK_MODULES([GST],
158 [gstreamer-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
163 AC_CACHE_CHECK([for GstBaseSink::query hook], ac_cv_have_gst_base_sink_query, [
164 saved_CFLAGS="$CFLAGS"
165 CFLAGS="$CFLAGS $GST_CFLAGS"
167 LIBS="$LIBS $GST_LIBS"
169 [#include <gst/base/gstbasesink.h>],
170 [GstBaseSinkClass klass; klass.query = NULL;],
171 [ac_cv_have_gst_base_sink_query="yes"],
172 [ac_cv_have_gst_base_sink_query="no"]
174 CFLAGS="$saved_CFLAGS"
177 if test "$ac_cv_have_gst_base_sink_query" != "yes"; then
178 AC_MSG_ERROR([GstBaseSink does not contain the 'query' vfunc])
181 dnl Check for GStreamer plugins-base
182 PKG_CHECK_MODULES([GST_PLUGINS_BASE],
183 [gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
185 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
186 AC_SUBST(GST_PLUGINS_BASE_LIBS)
188 V=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR`
189 GST_PLUGINS_BASE_MAJOR_VERSION=`echo "$V" | cut -d'.' -f1`
190 GST_PLUGINS_BASE_MINOR_VERSION=`echo "$V" | cut -d'.' -f2`
191 GST_PLUGINS_BASE_MICRO_VERSION=`echo "$V" | cut -d'.' -f3`
192 AC_SUBST(GST_PLUGINS_BASE_MAJOR_VERSION)
193 AC_SUBST(GST_PLUGINS_BASE_MINOR_VERSION)
194 AC_SUBST(GST_PLUGINS_BASE_MICRO_VERSION)
196 dnl Check for GStreamer base
197 PKG_CHECK_MODULES([GST_BASE],
198 [gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
200 AC_SUBST(GST_BASE_CFLAGS)
201 AC_SUBST(GST_BASE_LIBS)
203 dnl Check for GStreamer video
204 PKG_CHECK_MODULES([GST_VIDEO],
205 [gstreamer-video-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
207 AC_SUBST(GST_VIDEO_CFLAGS)
208 AC_SUBST(GST_VIDEO_LIBS)
210 AC_CACHE_CHECK([for GstVideoOverlayComposition],
211 ac_cv_have_gst_video_overlay_composition, [
212 saved_CFLAGS="$CFLAGS"
213 CFLAGS="$CFLAGS $GST_CFLAGS"
215 LIBS="$LIBS $GST_LIBS"
217 [#include <gst/video/video-overlay-composition.h>],
218 [GstVideoOverlayComposition *c = gst_video_overlay_composition_new(0);],
219 [ac_cv_have_gst_video_overlay_composition="yes"],
220 [ac_cv_have_gst_video_overlay_composition="no"]
222 CFLAGS="$saved_CFLAGS"
225 if test "$ac_cv_have_gst_video_overlay_composition" != "yes"; then
226 AC_MSG_ERROR([GstVideoOverlayComposition is not available])
229 dnl Check for GStreamer basevideo
230 PKG_CHECK_MODULES([GST_BASEVIDEO],
231 [gstreamer-basevideo-$GST_MAJORMINOR >= $GST_PLUGINS_BAD_VERSION_REQUIRED]
233 AC_SUBST(GST_BASEVIDEO_CFLAGS)
234 AC_SUBST(GST_BASEVIDEO_LIBS)
236 dnl Check for GStreamer codec parsers
238 if test "$enable_codecparsers" = "yes"; then
239 PKG_CHECK_MODULES([GST_CODEC_PARSERS],
240 [gstreamer-codecparsers-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED],
241 [enable_codecparsers="yes" USE_CODEC_PARSERS=1],
242 [enable_codecparsers="no" USE_CODEC_PARSERS=0]
246 AC_DEFINE_UNQUOTED(USE_CODEC_PARSERS, $USE_CODEC_PARSERS,
247 [Defined to 1 if GStreamer codec parsers are used])
248 AM_CONDITIONAL(USE_CODEC_PARSERS, test $USE_CODEC_PARSERS -eq 1)
250 if test "$enable_codecparsers" = "yes"; then
251 AC_CACHE_CHECK([for GstH264SliceHdr::n_emulation_prevention_bytes],
252 ac_cv_have_gst_h264_slice_hdr_epb_count, [
253 saved_CFLAGS="$CFLAGS"
254 CFLAGS="$CFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
256 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
258 [#include <gst/codecparsers/gsth264parser.h>],
259 [GstH264SliceHdr slice_hdr;
260 slice_hdr.n_emulation_prevention_bytes = 0;],
261 [ac_cv_have_gst_h264_slice_hdr_epb_count="yes"],
262 [ac_cv_have_gst_h264_slice_hdr_epb_count="no"]
264 CFLAGS="$saved_CFLAGS"
269 if test "$ac_cv_have_gst_h264_slice_hdr_epb_count" = "yes"; then
270 AC_DEFINE_UNQUOTED(HAVE_GST_H264_SLICE_HDR_EPB_COUNT, 1,
271 [Defined to 1 if GstH264SliceHdr::n_emulation_prevention_bytes exists.])
274 dnl Check for GStreamer interfaces
275 PKG_CHECK_MODULES([GST_INTERFACES],
276 [gstreamer-interfaces-$GST_MAJORMINOR >= $GST_PLUGINS_BASE_VERSION_REQUIRED]
278 AC_SUBST(GST_INTERFACES_CFLAGS)
279 AC_SUBST(GST_INTERFACES_LIBS)
282 dnl LDFLAGS really should only contain flags, not libs - they get added before
283 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
284 GST_ALL_LDFLAGS="-no-undefined"
285 AC_SUBST(GST_ALL_LDFLAGS)
287 dnl GST_PLUGIN_LDFLAGS:
288 dnl this really should only contain flags, not libs - they get added before
289 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
290 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS"
291 AC_SUBST(GST_PLUGIN_LDFLAGS)
293 dnl Check for the GStreamer plugins directory
294 AC_MSG_CHECKING([for GStreamer plugins directory])
295 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
296 if test -z "$GST_PLUGINS_DIR"; then
297 echo "FAIL FAIL FAIL"
298 GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
300 AC_MSG_RESULT([$GST_PLUGINS_DIR])
301 plugindir="$GST_PLUGINS_DIR"
305 PKG_CHECK_MODULES(X11, [x11])
309 if test "$enable_glx" != "yes"; then
314 AC_CHECK_HEADERS([GL/gl.h GL/glext.h GL/glx.h], [], [USE_GLX=0], [
319 AC_CHECK_LIB(GL, glXCreateContext, [GLX_LIBS="-lGL"], [USE_GLX=0])
324 LIBVA_PKGNAME="libva"
325 PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME])
326 AC_SUBST(LIBVA_PKGNAME)
328 dnl ... original VA-API 0.29
329 AC_CACHE_CHECK([for old VA-API 0.29],
330 ac_cv_have_vaapi_old, [
331 saved_CFLAGS="$CFLAGS"
332 CFLAGS="$CFLAGS $LIBVA_CFLAGS"
334 LIBS="$LIBS $LIBVA_LIBS"
336 [#include <va_x11.h>],
337 [vaGetDisplay(NULL)],
338 [ac_cv_have_vaapi_old="yes"],
339 [ac_cv_have_vaapi_old="no"])
340 CFLAGS="$saved_CFLAGS"
343 if test "$ac_cv_have_vaapi_old" = "yes"; then
344 LIBVA_EXTRA_CFLAGS="$LIBVA_CFLAGS -DGST_VAAPI_USE_OLD_VAAPI_0_29"
347 dnl ... VA-API >= 0.31 or -sds
348 LIBVA_X11_PKGNAME="libva-x11"
349 PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME],
350 [ac_cv_have_vaapi_x11="yes"],
351 [ac_cv_have_vaapi_x11="no"]
353 if test "$ac_cv_have_vaapi_x11" = "no"; then
354 if test "$ac_cv_have_vaapi_old" = "yes"; then
355 LIBVA_X11_PKGNAME="libva"
356 CFLAGS="$CFLAGS $LIBVA_EXTRA_CFLAGS"
357 LIBS="$LIBS $LIBVA_EXTRA_LIBS"
359 AC_MSG_ERROR([could not find VA-API])
362 AC_SUBST(LIBVA_X11_PKGNAME)
364 dnl ... VA-API >= 0.31 or -sds (VA/GLX extensions)
366 if test $USE_GLX -eq 1; then
367 if test "$enable_vaapi_glx" = "yes"; then
368 LIBVA_GLX_PKGNAME="libva-glx"
369 PKG_CHECK_MODULES(LIBVA_GLX, [$LIBVA_GLX_PKGNAME],
370 [ac_cv_have_vaapi_glx="yes" USE_VAAPI_GLX=1],
371 [ac_cv_have_vaapi_glx="no"]
374 if test $USE_VAAPI_GLX -eq 0; then
375 AC_MSG_WARN([VA/GLX not found or disabled. Fallbacking to TFP+FBO])
376 LIBVA_GLX_PKGNAME="$LIBVA_X11_PKGNAME"
379 AC_SUBST(LIBVA_GLX_PKGNAME)
381 AC_SUBST(LIBVA_EXTRA_CFLAGS)
382 AC_SUBST(LIBVA_EXTRA_LIBS)
384 dnl Check for OpenGL support to vaapisink
385 if test "$enable_vaapisink_glx:$USE_GLX" = "yes:1"; then
393 if test "$enable_ffmpeg" = "yes"; then
394 PKG_CHECK_MODULES(LIBAVCODEC, [libavcodec],
395 [enable_ffmpeg="yes" USE_FFMPEG=1],
396 [enable_ffmpeg="no" USE_FFMPEG=0]
399 if test "$enable_ffmpeg" = "yes"; then
400 AC_CHECK_HEADERS([libavcodec/avcodec.h ffmpeg/avcodec.h])
401 AC_CHECK_HEADERS([libavcodec/vaapi.h ffmpeg/vaapi.h],
403 [enable_ffmpeg="no" USE_FFMPEG=0]
407 if test "$enable_ffmpeg:$enable_codecparsers" = "no:no"; then
408 AC_MSG_ERROR([Found neither suitable FFmpeg with VA-API support nor GStreamer bitstream parsers])
411 AC_DEFINE_UNQUOTED(USE_FFMPEG, $USE_FFMPEG,
412 [Defined to 1 if FFmpeg is used])
413 AM_CONDITIONAL(USE_FFMPEG, test $USE_FFMPEG -eq 1)
415 AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
416 [Defined to 1 if GLX is enabled])
417 AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
419 AC_DEFINE_UNQUOTED(USE_VAAPI_GLX, $USE_VAAPI_GLX,
420 [Defined to 1 if VA/GLX is enabled])
421 AM_CONDITIONAL(USE_VAAPI_GLX, test $USE_VAAPI_GLX -eq 1)
423 AC_DEFINE_UNQUOTED(USE_VAAPISINK_GLX, $USE_VAAPISINK_GLX,
424 [Defined to 1 to enable GLX support to vaapisink])
425 AM_CONDITIONAL(USE_VAAPISINK_GLX, test $USE_VAAPISINK_GLX -eq 1)
427 VA_VERSION=`$PKG_CONFIG --modversion libva`
428 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
429 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
430 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
431 VA_VERSION_STR="$VA_VERSION"
433 pkgconfigdir=${libdir}/pkgconfig
434 AC_SUBST(pkgconfigdir)
438 debian.upstream/Makefile
439 debian.upstream/changelog
440 debian.upstream/control
441 debian.upstream/gstreamer$GST_MAJORMINOR-vaapi.install:\
442 debian.upstream/gstreamer-vaapi.install.in
443 debian.upstream/gstreamer$GST_MAJORMINOR-vaapi-doc.install:\
444 debian.upstream/gstreamer-vaapi-doc.install.in
445 debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
446 debian.upstream/libgstvaapi.install.in
447 debian.upstream/libgstvaapi-dev.install
448 debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
449 debian.upstream/libgstvaapi-x11.install.in
450 debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:\
451 debian.upstream/libgstvaapi-glx.install.in
453 docs/reference/Makefile
454 docs/reference/libs/Makefile
455 docs/reference/libs/libs-docs.xml
456 docs/reference/plugins/Makefile
457 docs/reference/plugins/plugins-docs.xml
459 gst-libs/gst/Makefile
460 gst-libs/gst/gstutils_version.h
461 gst-libs/gst/vaapi/Makefile
463 pkgconfig/gstreamer-vaapi-$GST_MAJORMINOR.pc:\
464 pkgconfig/gstreamer-vaapi.pc.in
465 pkgconfig/gstreamer-vaapi-glx-$GST_MAJORMINOR.pc:\
466 pkgconfig/gstreamer-vaapi-glx.pc.in
467 pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\
468 pkgconfig/gstreamer-vaapi-x11.pc.in
476 test $1 -eq 1 && echo yes || echo no
480 echo $PACKAGE configuration summary:
482 echo VA-API version ................... : $VA_VERSION_STR
483 echo GLX support ...................... : $(yesno $USE_GLX)
484 echo VA/GLX support ................... : $(yesno $USE_VAAPI_GLX)
485 echo VaapiSink/GL ..................... : $(yesno $USE_VAAPISINK_GLX)
486 echo FFmpeg bitstream parsers ......... : $(yesno $USE_FFMPEG)
487 echo GStreamer bitstream parsers ...... : $(yesno $USE_CODEC_PARSERS)