1 # gstreamer-vaapi package version number
2 m4_define([gst_vaapi_major_version], [0])
3 m4_define([gst_vaapi_minor_version], [5])
4 m4_define([gst_vaapi_micro_version], [11])
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([default_glapi], [any])
15 # gstreamer-vaapi library (libtool) version number
16 m4_define([gst_vaapi_lt_current], [7])
17 m4_define([gst2_vaapi_lt_current_bias], [4])
18 m4_define([gst4_vaapi_lt_current_bias], [5])
19 m4_define([gst6_vaapi_lt_current_bias], [6])
20 m4_define([gst_vaapi_lt_revision], [0])
21 m4_define([gst_vaapi_lt_age], [0])
24 m4_define([glib_version], [2.32])
26 # gstreamer version number
27 m4_define([gst_api_version], [autodetect])
28 m4_define([gst12_version], [1.1.90])
29 m4_define([gst12_plugins_base_version], [1.1.0])
30 m4_define([gst12_plugins_bad_version], [1.1.0])
31 m4_define([gst14_version], [1.2.90])
32 m4_define([gst14_plugins_base_version], [1.3.0])
33 m4_define([gst14_plugins_bad_version], [1.3.0])
34 m4_define([gst16_version], [1.5.0])
35 m4_define([gst16_plugins_base_version], [1.5.0])
36 m4_define([gst16_plugins_bad_version], [1.5.0])
38 # Wayland minimum version number
39 m4_define([wayland_api_version], [1.0.2])
41 # VA-API minimum version number
42 m4_define([va_api_version], [0.30.4])
43 m4_define([va_api_enc_version], [0.34.0])
44 m4_define([va_api_drm_version], [0.33.0])
45 m4_define([va_api_x11_version], [0.31.0])
46 m4_define([va_api_wld_version], [0.33.0])
48 # libva package version number
49 m4_define([libva_enc_package_version], [1.2.0])
50 m4_define([libva_drm_package_version], [1.1.0])
51 m4_define([libva_x11_package_version], [1.0.3])
52 m4_define([libva_wld_package_version], [1.1.0])
54 # gtk-doc version number
55 # XXX: introspection annotations require gtk-doc >= 1.12
56 m4_define([gtkdoc_version], [1.9])
59 AC_INIT([gst_vaapi], [gst_vaapi_version],
60 [gwenole.beauchesne@intel.com],
63 AC_CONFIG_HEADERS([config.h])
64 AC_CONFIG_SRCDIR([Makefile.am])
65 AC_CONFIG_MACRO_DIR([m4])
66 AC_CONFIG_AUX_DIR([build-aux])
70 AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-bzip2])
72 TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
75 LIBVA_PACKAGE_VERSION=libva_x11_package_version
76 AC_SUBST(LIBVA_PACKAGE_VERSION)
78 WAYLAND_API_VERSION=wayland_api_version
79 AC_SUBST(WAYLAND_API_VERSION)
81 dnl Use pretty build output with automake >= 1.11
82 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
83 AM_DEFAULT_VERBOSITY=1
84 AC_SUBST(AM_DEFAULT_VERBOSITY)
91 AC_ARG_VAR([GIT], [Path to git program, if any])
92 AC_PATH_PROG([GIT], [git])
93 AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"])
95 AC_ARG_VAR([YASM], [Path to yasm program, if any])
96 AC_PATH_PROG([YASM], [yasm])
97 if test -z "$YASM" -a "$enable_builtin_libvpx" = "yes"; then
98 AC_MSG_ERROR([yasm is needed to build libvpx sources])
101 dnl Initialize libtool
105 AC_ARG_ENABLE(builtin_videoparsers,
106 AS_HELP_STRING([--enable-builtin-videoparsers],
107 [enable built-in videoparsers @<:@default=yes@:>@]),
108 [], [enable_builtin_videoparsers="yes"])
110 AC_ARG_ENABLE(builtin_codecparsers,
111 AS_HELP_STRING([--enable-builtin-codecparsers],
112 [enable built-in codecparsers @<:@default=yes@:>@]),
113 [], [enable_builtin_codecparsers="yes"])
115 AC_ARG_ENABLE(builtin_libvpx,
116 AS_HELP_STRING([--enable-builtin-libvpx],
117 [enable built-in libvpx @<:@default=yes@:>@]),
118 [], [enable_builtin_libvpx="yes"])
120 AC_ARG_ENABLE([encoders],
121 AS_HELP_STRING([--enable-encoders],
122 [enable video encoders @<:@default=yes@:>@]),
123 [], [enable_encoders="yes"])
126 AS_HELP_STRING([--enable-drm],
127 [enable DRM backend @<:@default=yes@:>@]),
128 [], [enable_drm="yes"])
131 AS_HELP_STRING([--enable-x11],
132 [enable X11 output @<:@default=yes@:>@]),
133 [], [enable_x11="yes"])
136 AS_HELP_STRING([--enable-glx],
137 [enable OpenGL/X11 output @<:@default=yes@:>@]),
138 [], [enable_glx="yes"])
140 AC_ARG_ENABLE(wayland,
141 AC_HELP_STRING([--enable-wayland],
142 [enable Wayland output @<:@default=yes@:>@]),
143 [], [enable_wayland="yes"])
146 AS_HELP_STRING([--enable-egl],
147 [enable EGL output @<:@default=yes@:>@]),
148 [], [enable_egl="yes"])
151 AS_HELP_STRING([--with-glapi=APIs],
152 [build with the specified OpenGL APIs @<:@default=default_glapi@:>@]),
153 [GLAPI="$with_glapi"], [GLAPI=default_glapi])
155 dnl Check for basic libraries
158 dnl Check for Gtk doc
159 GTKDOC_VERSION=gtkdoc_version
160 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
161 m4_ifdef([GTK_DOC_CHECK], [
162 GTK_DOC_CHECK([$GTKDOC_VERSION], [--flavour no-tmpl])], [
163 AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
164 AC_SUBST(GTKDOC_VERSION)
167 GLIB_VERSION_REQUIRED=glib_version
168 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_VERSION_REQUIRED])
169 AC_SUBST(GLIB_VERSION_REQUIRED)
171 dnl Check to see if dlopen is in default libraries (like Solaris, which
172 dnl has it in libc), or if libdl is needed to get it.
173 AC_CHECK_FUNC([dlopen], [], [
174 AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
175 AC_SUBST([DLOPEN_LIBS])
177 dnl ---------------------------------------------------------------------------
179 dnl ---------------------------------------------------------------------------
180 AC_MSG_CHECKING([for GStreamer API version])
181 if $PKG_CONFIG --exists "gstreamer-1.0"; then
182 gst_version=`$PKG_CONFIG --modversion "gstreamer-1.0"`
183 gst_major_version=`echo "$gst_version" | cut -d'.' -f1`
184 gst_minor_version=`echo "$gst_version" | cut -d'.' -f2`
185 GST_API_VERSION="${gst_major_version}.${gst_minor_version}"
186 GST_PKG_VERSION="1.0"
188 if test -z "$GST_PKG_VERSION"; then
189 AC_MSG_ERROR([gstreamer-$GST_PKG_VERSION was not found])
191 AC_MSG_RESULT([$GST_API_VERSION])
193 AC_DEFINE_UNQUOTED([GST_API_VERSION_S], ["$GST_API_VERSION"],
194 [Defined to the string representation of GStreamer version])
196 dnl Versions for GStreamer and plugins-base
197 case $GST_API_VERSION in
199 GST_VERSION_REQUIRED=gst12_version
200 GST_PLUGINS_BASE_VERSION_REQUIRED=gst12_plugins_base_version
201 GST_PLUGINS_BAD_VERSION_REQUIRED=gst12_plugins_bad_version
204 GST_VERSION_REQUIRED=gst14_version
205 GST_PLUGINS_BASE_VERSION_REQUIRED=gst14_plugins_base_version
206 GST_PLUGINS_BAD_VERSION_REQUIRED=gst14_plugins_bad_version
209 GST_VERSION_REQUIRED=gst16_version
210 GST_PLUGINS_BASE_VERSION_REQUIRED=gst16_plugins_base_version
211 GST_PLUGINS_BAD_VERSION_REQUIRED=gst16_plugins_bad_version
214 AC_MSG_ERROR([unsupported GStreamer API version $GST_API_VERSION])
217 AC_SUBST(GST_API_VERSION)
218 AC_SUBST(GST_VERSION_REQUIRED)
219 AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED)
220 AC_SUBST(GST_PLUGINS_BAD_VERSION_REQUIRED)
222 USE_GST_API_1_2p="no"
223 USE_GST_API_1_4p="no"
224 AS_VERSION_COMPARE([$GST_API_VERSION], [1.2],
225 [], [USE_GST_API_1_2p="yes"], [USE_GST_API_1_2p="yes"])
226 AS_VERSION_COMPARE([$GST_API_VERSION], [1.4],
227 [], [USE_GST_API_1_4p="yes"], [USE_GST_API_1_4p="yes"])
228 AM_CONDITIONAL([USE_GST_API_1_2p], [test "$USE_GST_API_1_2p" = "yes"])
229 AM_CONDITIONAL([USE_GST_API_1_4p], [test "$USE_GST_API_1_4p" = "yes"])
231 AC_SUBST([GST_PKG_VERSION])
233 AC_DEFINE_UNQUOTED([GST_PKG_VERSION_S], ["$GST_PKG_VERSION"],
234 [Defined to the string representation of GStreamer API version])
237 PKG_CHECK_MODULES([GST],
238 [gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED])
239 PKG_CHECK_MODULES([GST_BASE],
240 [gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED])
242 dnl GStreamer -base plugins
243 PKG_CHECK_MODULES([GST_PLUGINS_BASE],
244 [gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
245 if test "$GST_API_VERSION" = "0.10"; then
246 PKG_CHECK_MODULES([GST_INTERFACES],
247 [gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
250 dnl ... gst_dmabuf_memory_get_fd (gstreamer-allocators)
251 PKG_CHECK_MODULES([GST_ALLOCATORS],
252 [gstreamer-allocators-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
254 dnl ... GstVideoOverlayComposition (gstreamer-video)
255 PKG_CHECK_MODULES([GST_VIDEO],
256 [gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
258 dnl GStreamer -bad plugins (deprecated in GStreamer v1.2)
259 if test "$USE_GST_API_1_2p" != "yes" && test "$USE_GST_API_1_4p" != "yes"; then
260 PKG_CHECK_MODULES([GST_BASEVIDEO],
261 [gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED])
264 dnl ... bitstream parsers
265 if test "$enable_builtin_codecparsers" = "yes"; then
266 ac_cv_have_gst_mpeg2_parser="no"
267 ac_cv_have_gst_h264_parser="no"
268 ac_cv_have_gst_jpeg_parser="no"
269 ac_cv_have_gst_vp8_parser="no"
270 ac_cv_have_gst_h265_parser="no"
272 PKG_CHECK_MODULES([GST_CODEC_PARSERS],
273 [gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED])
276 dnl ... MPEG-2 parser, with the required extensions
277 AC_CACHE_CHECK([for MPEG-2 parser],
278 ac_cv_have_gst_mpeg2_parser, [
279 saved_CPPFLAGS="$CPPFLAGS"
280 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
282 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
285 [[#include <gst/codecparsers/gstmpegvideoparser.h>]],
286 [[GstMpegVideoSequenceHdr seq_hdr;
287 GstMpegVideoSequenceExt seq_ext;
288 GstMpegVideoSequenceDisplayExt seq_dpy;
289 GstMpegVideoSliceHdr slice_hdr;
290 GstMpegVideoPacket packet;
291 gst_mpeg_video_packet_parse_slice_header(&packet, &slice_hdr,
293 gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr,
294 &seq_ext, &seq_dpy);]])],
295 [ac_cv_have_gst_mpeg2_parser="yes"],
296 [ac_cv_have_gst_mpeg2_parser="no"]
298 CPPFLAGS="$saved_CPPFLAGS"
301 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_MPEG2],
302 [test "$ac_cv_have_gst_mpeg2_parser" != "yes"])
304 dnl ... H.264 parser, with the required extensions
305 AC_CACHE_CHECK([for H.264 parser],
306 ac_cv_have_gst_h264_parser, [
307 saved_CPPFLAGS="$CPPFLAGS"
308 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
310 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
313 [[#include <gst/codecparsers/gsth264parser.h>]],
314 [[GstH264SliceHdr slice_hdr;
315 GstH264VUIParams vui_params;
316 GstH264Profile profile = GST_H264_PROFILE_HIGH;
317 slice_hdr.n_emulation_prevention_bytes = 0;
318 vui_params.par_n = 0;
319 vui_params.par_d = 0;]])],
320 [ac_cv_have_gst_h264_parser="yes"],
321 [ac_cv_have_gst_h264_parser="no"]
323 CPPFLAGS="$saved_CPPFLAGS"
326 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H264],
327 [test "$ac_cv_have_gst_h264_parser" != "yes"])
329 dnl ... JPEG parser, not upstream yet
330 AC_CACHE_CHECK([for JPEG parser],
331 ac_cv_have_gst_jpeg_parser, [
332 saved_CPPFLAGS="$CPPFLAGS"
333 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
335 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
338 [[#include <gst/codecparsers/gstjpegparser.h>]],
339 [[GstJpegImage jpeg_image;]])],
340 [ac_cv_have_gst_jpeg_parser="yes"],
341 [ac_cv_have_gst_jpeg_parser="no"]
343 CPPFLAGS="$saved_CPPFLAGS"
346 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_JPEG],
347 [test "$ac_cv_have_gst_jpeg_parser" != "yes"])
349 dnl ... VP8 parser, not upstream yet
350 if test "$enable_builtin_libvpx" = "yes"; then
351 ac_cv_have_gst_vp8_parser="no"
353 AC_CACHE_CHECK([for VP8 parser],
354 ac_cv_have_gst_vp8_parser, [
355 saved_CPPFLAGS="$CPPFLAGS"
356 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
358 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
361 [[#include <gst/codecparsers/gstvp8parser.h>]],
362 [[GstVp8FrameHdr frame_hdr;]])],
363 [ac_cv_have_gst_vp8_parser="yes"],
364 [ac_cv_have_gst_vp8_parser="no"]
366 CPPFLAGS="$saved_CPPFLAGS"
369 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP8],
370 [test "$ac_cv_have_gst_vp8_parser" != "yes"])
371 AM_CONDITIONAL([USE_BUILTIN_LIBVPX], [test "$enable_builtin_libvpx" = "yes"])
373 dnl ... H.265 parser, with the required extensions
374 AC_CACHE_CHECK([for H.265 parser],
375 ac_cv_have_gst_h265_parser, [
376 saved_CPPFLAGS="$CPPFLAGS"
377 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
379 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
382 [[#include <gst/codecparsers/gsth265parser.h>]],
383 [[GstH265SliceHdr slice_hdr;
384 GstH265VUIParams vui_params;
385 GstH265Profile profile = GST_H265_PROFILE_MAIN_STILL_PICTURE;
386 slice_hdr.n_emulation_prevention_bytes = 0;
387 vui_params.par_n = 0;
388 vui_params.par_d = 0;]])],
389 [ac_cv_have_gst_h265_parser="yes"],
390 [ac_cv_have_gst_h265_parser="no"]
392 CPPFLAGS="$saved_CPPFLAGS"
395 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H265],
396 [test "$ac_cv_have_gst_h265_parser" != "yes"])
398 dnl ... video parsers
399 AM_CONDITIONAL([USE_LOCAL_VIDEO_PARSERS],
400 [test "$enable_builtin_videoparsers" = "yes"])
402 dnl ... opengl helper libraries
404 if test "$enable_glx" = "yes" -o "$enable_egl" = "yes"; then
405 PKG_CHECK_MODULES([GST_GL],
406 [gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED],
407 [HAVE_GSTGL=1], [HAVE_GSTGL=0])
410 if test $HAVE_GSTGL -eq 1; then
411 AC_CACHE_CHECK([for GStreamer OpenGL helper libraries],
412 [ac_cv_have_gst_gl_helpers], [
413 saved_CPPFLAGS="$CPPFLAGS"
414 CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS"
417 AC_CHECK_HEADERS([gst/gl/gl.h], [:], [HAVE_GSTGL=0])
420 [[#include <gst/gl/gl.h>]],
421 [[GstGLContext gl_context;]])],
422 [ac_cv_have_gst_gl_helpers="yes"],
423 [ac_cv_have_gst_gl_helpers="no" HAVE_GSTGL=0]
425 CPPFLAGS="$saved_CPPFLAGS"
429 AM_CONDITIONAL([USE_GST_GL_HELPERS], [test $HAVE_GSTGL -eq 1])
431 AC_DEFINE_UNQUOTED([USE_GST_GL_HELPERS], [$HAVE_GSTGL],
432 [Defined to 1 if GStreamer OpenGL helper libraries are available])
434 if test "$enable_egl" = "yes" -a $HAVE_GSTGL -ne 1; then
435 AC_MSG_WARN([GStreamer/GL helper libraries not found, disabling EGL support])
439 case $GST_API_VERSION in
440 1.2) lt_bias=gst2_vaapi_lt_current_bias;;
441 1.4) lt_bias=gst4_vaapi_lt_current_bias;;
442 1.[[5-6]]) lt_bias=gst6_vaapi_lt_current_bias;;
444 GST_VAAPI_MAJOR_VERSION=`expr gst_vaapi_lt_current - "$lt_bias"`
445 AC_SUBST(GST_VAAPI_MAJOR_VERSION)
447 AC_DEFINE_UNQUOTED([GST_VAAPI_MAJOR_VERSION_S], ["$GST_VAAPI_MAJOR_VERSION"],
448 [Defined to the string representation of gstreamer-vaapi major version])
450 dnl GST_VAAPI_LT_LDFLAGS:
451 GST_VAAPI_LT_CURRENT="$GST_VAAPI_MAJOR_VERSION"
452 GST_VAAPI_LT_REV=gst_vaapi_lt_revision
453 GST_VAAPI_LT_AGE=gst_vaapi_lt_age
454 GST_VAAPI_LT_VERSION="$GST_VAAPI_LT_CURRENT:$GST_VAAPI_LT_REV:$GST_VAAPI_LT_AGE"
455 GST_VAAPI_LT_LDFLAGS="-version-info $GST_VAAPI_LT_VERSION"
456 AC_SUBST(GST_VAAPI_LT_VERSION)
457 AC_SUBST(GST_VAAPI_LT_LDFLAGS)
460 dnl LDFLAGS really should only contain flags, not libs - they get added before
461 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
462 GST_ALL_LDFLAGS="-no-undefined"
463 AC_SUBST(GST_ALL_LDFLAGS)
465 dnl GST_PLUGIN_LDFLAGS:
466 dnl this really should only contain flags, not libs - they get added before
467 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
468 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS"
469 AC_SUBST(GST_PLUGIN_LDFLAGS)
471 dnl Check for the GStreamer plugins directory
472 AC_ARG_VAR([GST_PLUGIN_PATH_1_0], [installation path for gstreamer-vaapi plugin elements for GStreamer 1.0])
473 AC_MSG_CHECKING([for GStreamer plugins directory])
474 if test -d "$GST_PLUGIN_PATH_1_0"; then
475 GST_PLUGINS_DIR="$GST_PLUGIN_PATH_1_0"
477 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_PKG_VERSION --variable pluginsdir`
478 if test -z "$GST_PLUGINS_DIR"; then
479 GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_PKG_VERSION"
482 AC_MSG_RESULT([$GST_PLUGINS_DIR])
483 plugindir="$GST_PLUGINS_DIR"
486 dnl ---------------------------------------------------------------------------
488 dnl ---------------------------------------------------------------------------
490 dnl Check for DRM/libudev
492 if test "$enable_drm" = "yes"; then
493 PKG_CHECK_MODULES(DRM, [libdrm], [USE_DRM=1], [USE_DRM=0])
494 PKG_CHECK_MODULES(UDEV, [libudev], [:], [USE_DRM=0])
496 if test $USE_DRM -eq 1; then
497 saved_CPPFLAGS="$CPPFLAGS"
498 CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
499 AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM=0])
500 CPPFLAGS="$saved_CPPFLAGS"
506 if test "$enable_x11" = "yes"; then
507 PKG_CHECK_MODULES(X11, [x11], [USE_X11=1], [USE_X11=0])
508 if test $USE_X11 -eq 1; then
509 saved_CPPFLAGS="$CPPFLAGS"
510 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
511 AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/Xatom.h], [:], [USE_X11=0])
512 CPPFLAGS="$saved_CPPFLAGS"
516 dnl Check for XKB library
518 if test $USE_X11 -eq 1; then
519 AC_CHECK_HEADERS([X11/XKBlib.h], [HAVE_XKBLIB=1], [:])
521 if test $HAVE_XKBLIB -eq 1; then
522 AC_DEFINE_UNQUOTED([HAVE_XKBLIB], 1,
523 [Defined to 1 if the XKB extension exists.])
528 if test $USE_X11 -eq 1; then
530 PKG_CHECK_MODULES([XRANDR], [xrandr], [:], [HAVE_XRANDR=0])
531 if test $HAVE_XRANDR -eq 1; then
532 saved_CPPFLAGS="$CPPFLAGS"
533 CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS"
534 AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [:], [HAVE_XRANDR=0])
535 CPPFLAGS="$saved_CPPFLAGS"
538 if test $HAVE_XRANDR -eq 1; then
539 AC_DEFINE_UNQUOTED(HAVE_XRANDR, 1,
540 [Defined to 1 if the XRandR extension exists.])
543 dnl Check for XRender
545 if test $USE_X11 -eq 1; then
547 PKG_CHECK_MODULES([XRENDER], [xrender], [:], [HAVE_XRENDER=0])
548 if test $HAVE_XRENDER -eq 1; then
549 saved_CPPFLAGS="$CPPFLAGS"
550 CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS"
551 AC_CHECK_HEADERS([X11/extensions/Xrender.h], [:], [HAVE_XRENDER=0])
552 CPPFLAGS="$saved_CPPFLAGS"
555 if test $HAVE_XRENDER -eq 1; then
556 AC_DEFINE_UNQUOTED([HAVE_XRENDER], [1],
557 [Defined to 1 if the XRender extension exists.])
562 if test "$enable_glx" = "yes"; then
565 if test "$enable_egl" = "yes"; then
571 if test "$enable_opengl" = "yes"; then
575 PKG_CHECK_MODULES([GL], [gl], [:], [HAVE_GL=0])
576 saved_CPPFLAGS="$CPPFLAGS"
577 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
578 AC_CHECK_HEADERS([GL/gl.h GL/glext.h], [:], [HAVE_GL=0], [
583 CPPFLAGS="$saved_CPPFLAGS"
587 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1`
591 if test "$enable_opengl" = "yes"; then
595 PKG_CHECK_MODULES([GLES2], [glesv2], [:], [HAVE_GLESv2=0])
596 saved_CPPFLAGS="$CPPFLAGS"
597 CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS"
598 AC_CHECK_HEADERS([GLES2/gl2.h GLES2/gl2ext.h], [:],
600 #ifdef HAVE_GLES2_GL2_H
601 # include <GLES2/gl2.h>
604 CPPFLAGS="$saved_CPPFLAGS"
608 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4`
612 if test "$enable_opengl" = "yes"; then
616 PKG_CHECK_MODULES([GLES3], [glesv2], [:], [HAVE_GLESv3=0])
617 saved_CPPFLAGS="$CPPFLAGS"
618 CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS"
619 AC_CHECK_HEADERS([GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h], [:],
621 #ifdef HAVE_GLES3_GL3_H
622 # include <GLES3/gl3.h>
625 CPPFLAGS="$saved_CPPFLAGS"
629 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8`
633 if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then
635 saved_CPPFLAGS="$CPPFLAGS"
637 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
638 LIBS="$LIBS $GL_LIBS"
639 AC_CHECK_HEADERS([GL/glx.h], [:], [USE_GLX=0], [
644 AC_CHECK_LIB([GL], [glXCreateContext], [:], [USE_GLX=0])
645 CPPFLAGS="$saved_CPPFLAGS"
651 if test "$enable_egl" = "yes" -a $GLES_VERSION_MASK -ne 0; then
653 PKG_CHECK_MODULES([EGL], [egl], [:], [USE_EGL=0])
654 saved_CPPFLAGS="$CPPFLAGS"
656 AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL=0])
657 AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL=0])
658 CPPFLAGS="$saved_CPPFLAGS"
662 dnl Check for Wayland
664 if test "$enable_wayland" = "yes"; then
665 PKG_CHECK_MODULES(WAYLAND, [wayland-client >= wayland_api_version],
666 [USE_WAYLAND=1], [USE_WAYLAND=0])
668 if test $USE_WAYLAND -eq 1; then
669 saved_CPPFLAGS="$CPPFLAGS"
670 CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS"
671 AC_CHECK_HEADERS([wayland-client.h], [:], [USE_WAYLAND=0])
672 CPPFLAGS="$saved_CPPFLAGS"
676 dnl ---------------------------------------------------------------------------
678 dnl ---------------------------------------------------------------------------
681 LIBVA_PKGNAME="libva"
682 PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME >= va_api_version])
683 AC_SUBST(LIBVA_PKGNAME)
685 VA_VERSION=`$PKG_CONFIG --modversion libva`
686 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
687 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
688 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
689 VA_VERSION_STR="$VA_VERSION"
693 if test $USE_DRM -eq 1; then
694 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= va_api_drm_version],
695 [HAVE_VA_DRM=1], [USE_DRM=0])
697 if test $HAVE_VA_DRM -eq 1; then
698 saved_CPPFLAGS="$CPPFLAGS"
699 CPPFLAGS="$LIBVA_DRM_CFLAGS"
700 AC_CHECK_HEADERS([va/va_drm.h], [:], [HAVE_VA_DRM=0 USE_DRM=0])
701 CPPFLAGS="$saved_CPPFLAGS"
707 LIBVA_X11_PKGNAME="libva-x11"
708 if test $USE_X11 -eq 1; then
709 PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME >= va_api_x11_version],
710 [HAVE_VA_X11=1], [USE_X11=0])
712 AC_SUBST(LIBVA_X11_PKGNAME)
714 dnl Check for va_dec_jpeg.h header
715 saved_CPPFLAGS="$CPPFLAGS"
716 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
717 AC_CHECK_HEADERS([va/va_dec_jpeg.h], [], [], [#include <va/va.h>])
718 CPPFLAGS="$saved_CPPFLAGS"
720 dnl Check for JPEG decoding API (0.32.1+)
722 AC_CACHE_CHECK([for JPEG decoding API],
723 ac_cv_have_jpeg_decoding_api, [
724 saved_CPPFLAGS="$CPPFLAGS"
725 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
727 LIBS="$LIBS $LIBVA_LIBS"
731 #ifdef HAVE_VA_VA_DEC_JPEG_H
732 #include <va/va_dec_jpeg.h>
735 [[VAPictureParameterBufferJPEGBaseline pic_param;
736 VASliceParameterBufferJPEGBaseline slice_param;
737 VAHuffmanTableBufferJPEGBaseline huffman_table;
738 VAIQMatrixBufferJPEGBaseline iq_matrix;]])],
739 [ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=1],
740 [ac_cv_have_jpeg_decoding_api="no"]
742 CPPFLAGS="$saved_CPPFLAGS"
746 dnl Check for va_dec_vp8.h header
747 saved_CPPFLAGS="$CPPFLAGS"
748 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
749 AC_CHECK_HEADERS([va/va_dec_vp8.h], [], [], [#include <va/va.h>])
750 CPPFLAGS="$saved_CPPFLAGS"
752 dnl Check for VP8 decoding API (0.34+)
754 AC_CACHE_CHECK([for VP8 decoding API],
755 ac_cv_have_vp8_decoding_api, [
756 saved_CPPFLAGS="$CPPFLAGS"
757 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
759 LIBS="$LIBS $LIBVA_LIBS"
763 #ifdef HAVE_VA_VA_DEC_VP8_H
764 #include <va/va_dec_vp8.h>
767 [[VAPictureParameterBufferVP8 pic_param;
768 VASliceParameterBufferVP8 slice_param;
769 VAProbabilityDataBufferVP8 prob_data;
770 VAIQMatrixBufferVP8 iq_matrix;
771 slice_param.slice_data_offset = 0;
772 slice_param.slice_data_flag = 0;]])],
773 [ac_cv_have_vp8_decoding_api="yes" USE_VP8_DECODER=1],
774 [ac_cv_have_vp8_decoding_api="no"]
776 CPPFLAGS="$saved_CPPFLAGS"
780 dnl Check for va_dec_hevc.h header
781 saved_CPPFLAGS="$CPPFLAGS"
782 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
783 AC_CHECK_HEADERS([va/va_dec_hevc.h], [], [], [#include <va/va.h>])
784 CPPFLAGS="$saved_CPPFLAGS"
786 dnl Check for HEVC decoding API (0.38+)
788 AC_CACHE_CHECK([for HEVC decoding API],
789 ac_cv_have_hevc_decoding_api, [
790 saved_CPPFLAGS="$CPPFLAGS"
791 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
793 LIBS="$LIBS $LIBVA_LIBS"
797 #ifdef HAVE_VA_VA_DEC_HEVC_H
798 #include <va/va_dec_hevc.h>
801 [[VAPictureParameterBufferHEVC pic_param;
802 VASliceParameterBufferHEVC slice_param;
803 VAIQMatrixBufferHEVC iq_matrix;
804 slice_param.slice_data_offset = 0;
805 slice_param.slice_data_flag = 0;]])],
806 [ac_cv_have_hevc_decoding_api="yes" USE_HEVC_DECODER=1],
807 [ac_cv_have_hevc_decoding_api="no"]
809 CPPFLAGS="$saved_CPPFLAGS"
813 dnl Check for vpp (video post-processing) support
815 AC_CACHE_CHECK([for video post-postprocessing API],
816 ac_cv_have_va_vpp_api, [
817 saved_CPPFLAGS="$CPPFLAGS"
818 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
820 LIBS="$LIBS $LIBVA_LIBS"
824 #include <va/va_vpp.h>]],
827 VAProcFilterType filters[VAProcFilterCount];
828 unsigned int num_filters = VAProcFilterCount;
829 vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters);
831 [ac_cv_have_va_vpp_api="yes" USE_VA_VPP=1],
832 [ac_cv_have_va_vpp_api="no"]
834 CPPFLAGS="$saved_CPPFLAGS"
838 dnl Check for encoding support
843 if test "$enable_encoders" = "yes"; then
844 PKG_CHECK_MODULES([LIBVA], [libva >= va_api_enc_version],
845 [HAVE_VA_ENC=1], [HAVE_VA_ENC=0])
847 if test $HAVE_VA_ENC -eq 1; then
848 saved_CPPFLAGS="$CPPFLAGS"
849 CPPFLAGS="$LIBVA_CFLAGS"
850 AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h],
851 [USE_ENCODERS=1], [HAVE_VA_ENC=0 USE_ENCODERS=0],
855 dnl Check for JPEG Encoding API (0.37.0+)
856 AC_CHECK_HEADERS([va/va_enc_jpeg.h],
857 [USE_JPEG_ENCODER=1], [],
860 AC_CACHE_CHECK([for JPEG encoding API],
861 ac_cv_have_jpeg_encoding_api, [
862 saved_CPPFLAGS="$CPPFLAGS"
863 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
865 LIBS="$LIBS $LIBVA_LIBS"
869 #ifdef HAVE_VA_VA_ENC_JPEG_H
870 #include <va/va_enc_jpeg.h>
873 [[VAEncPictureParameterBufferJPEG pic_param;
874 VAEncSliceParameterBufferJPEG slice_param;
875 VAQMatrixBufferJPEG q_matrix;]])],
876 [ac_cv_have_jpeg_encoding_api="yes" USE_JPEG_ENCODER=1],
877 [ac_cv_have_jpeg_encoding_api="no"]
879 CPPFLAGS="$saved_CPPFLAGS"
883 dnl Check for VP8 Encoding API
884 AC_CHECK_HEADERS([va/va_enc_vp8.h],
885 [USE_VP8_ENCODER=1], [],
888 AC_CACHE_CHECK([for VP8 encoding API],
889 ac_cv_have_vp8_encoding_api, [
890 saved_CPPFLAGS="$CPPFLAGS"
891 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
893 LIBS="$LIBS $LIBVA_LIBS"
897 #ifdef HAVE_VA_VA_ENC_VP8_H
898 #include <va/va_enc_vp8.h>
901 [[VAEncSequenceParameterBufferVP8 seq_param;
902 VAEncPictureParameterBufferVP8 pic_param;
903 VAQMatrixBufferVP8 q_matrix;]])],
904 [ac_cv_have_vp8_encoding_api="yes" USE_VP8_ENCODER=1],
905 [ac_cv_have_vp8_encoding_api="no" USE_VP8_ENCODER=0]
907 CPPFLAGS="$saved_CPPFLAGS"
910 CPPFLAGS="$saved_CPPFLAGS"
912 dnl Check for H265/HEVC Encoding API
913 AC_CHECK_HEADERS([va/va_enc_hevc.h],
914 [USE_H265_ENCODER=1], [],
917 AC_CACHE_CHECK([for HEVC encoding API],
918 ac_cv_have_hevc_encoding_api, [
919 saved_CPPFLAGS="$CPPFLAGS"
920 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
922 LIBS="$LIBS $LIBVA_LIBS"
926 #ifdef HAVE_VA_VA_ENC_HEVC_H
927 #include <va/va_enc_hevc.h>
930 [[VAEncSequenceParameterBufferHEVC seq_param;
931 VAEncPictureParameterBufferHEVC pic_param;
932 VAEncSliceParameterBufferHEVC;
933 VAQMatrixBufferHEVC q_matrix;]])],
934 [ac_cv_have_hevc_encoding_api="yes" USE_H265_ENCODER=1],
935 [ac_cv_have_hevc_encoding_api="no" USE_H265_ENCODER=0]
937 CPPFLAGS="$saved_CPPFLAGS"
940 CPPFLAGS="$saved_CPPFLAGS"
945 if test "$enable_wayland" = "yes"; then
946 PKG_CHECK_MODULES([LIBVA_WAYLAND], [libva-wayland >= va_api_wld_version],
947 [:], [USE_WAYLAND=0])
950 dnl ---------------------------------------------------------------------------
951 dnl -- Generate files and summary --
952 dnl ---------------------------------------------------------------------------
954 case ":$USE_X11:$USE_GLX:$USE_WAYLAND:$USE_DRM:" in
958 AC_MSG_ERROR([No renderer is enabled])
962 AC_DEFINE_UNQUOTED([USE_ENCODERS], $USE_ENCODERS,
963 [Defined to 1 if video encoders are used])
964 AM_CONDITIONAL([USE_ENCODERS], [test $USE_ENCODERS -eq 1])
966 AC_DEFINE_UNQUOTED(USE_JPEG_ENCODER, $USE_JPEG_ENCODER,
967 [Defined to 1 if JPEG encoder is used])
968 AM_CONDITIONAL(USE_JPEG_ENCODER, test $USE_JPEG_ENCODER -eq 1)
970 AC_DEFINE_UNQUOTED(USE_VP8_ENCODER, $USE_VP8_ENCODER,
971 [Defined to 1 if VP8 encoder is used])
972 AM_CONDITIONAL(USE_VP8_ENCODER, test $USE_VP8_ENCODER -eq 1)
974 AC_DEFINE_UNQUOTED(USE_H265_ENCODER, $USE_H265_ENCODER,
975 [Defined to 1 if H265 encoder is used])
976 AM_CONDITIONAL(USE_H265_ENCODER, test $USE_H265_ENCODER -eq 1)
978 AC_DEFINE_UNQUOTED(USE_VA_VPP, $USE_VA_VPP,
979 [Defined to 1 if video post-processing is used])
980 AM_CONDITIONAL(USE_VA_VPP, test $USE_VA_VPP -eq 1)
982 AC_DEFINE_UNQUOTED(USE_JPEG_DECODER, $USE_JPEG_DECODER,
983 [Defined to 1 if JPEG decoder is used])
984 AM_CONDITIONAL(USE_JPEG_DECODER, test $USE_JPEG_DECODER -eq 1)
986 AC_DEFINE_UNQUOTED(USE_VP8_DECODER, $USE_VP8_DECODER,
987 [Defined to 1 if VP8 decoder is used])
988 AM_CONDITIONAL(USE_VP8_DECODER, test $USE_VP8_DECODER -eq 1)
990 AC_DEFINE_UNQUOTED(USE_HEVC_DECODER, $USE_HEVC_DECODER,
991 [Defined to 1 if HEVC decoder is used])
992 AM_CONDITIONAL(USE_HEVC_DECODER, test $USE_HEVC_DECODER -eq 1)
994 AC_DEFINE_UNQUOTED(USE_DRM, $USE_DRM,
995 [Defined to 1 if DRM is enabled])
996 AM_CONDITIONAL(USE_DRM, test $USE_DRM -eq 1)
998 AC_DEFINE_UNQUOTED(USE_X11, $USE_X11,
999 [Defined to 1 if X11 is enabled])
1000 AM_CONDITIONAL(USE_X11, test $USE_X11 -eq 1)
1002 AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
1003 [Defined to 1 if GLX is enabled])
1004 AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
1006 AC_DEFINE_UNQUOTED([USE_EGL], [$USE_EGL],
1007 [Defined to 1 if EGL is enabled])
1008 AM_CONDITIONAL([USE_EGL], [test $USE_EGL -eq 1])
1010 AC_DEFINE_UNQUOTED([USE_GLES_VERSION_MASK], [$GLES_VERSION_MASK],
1011 [Defined to the set of enabled OpenGL ES APIs])
1013 AC_DEFINE_UNQUOTED(USE_WAYLAND, $USE_WAYLAND,
1014 [Defined to 1 if WAYLAND is enabled])
1015 AM_CONDITIONAL(USE_WAYLAND, test $USE_WAYLAND -eq 1)
1017 pkgconfigdir=${libdir}/pkgconfig
1018 AC_SUBST(pkgconfigdir)
1022 debian.upstream/Makefile
1023 debian.upstream/changelog
1024 debian.upstream/control
1025 debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install:\
1026 debian.upstream/gstreamer-vaapi-doc.install.in
1027 debian.upstream/gstreamer$GST_API_VERSION-vaapi.install:\
1028 debian.upstream/gstreamer-vaapi.install.in
1029 debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install:\
1030 debian.upstream/libgstvaapi-dev.install.in
1031 debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
1032 debian.upstream/libgstvaapi.install.in
1033 debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install:\
1034 debian.upstream/libgstvaapi-drm.install.in
1035 debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:\
1036 debian.upstream/libgstvaapi-glx.install.in
1037 debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install:\
1038 debian.upstream/libgstvaapi-wayland.install.in
1039 debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
1040 debian.upstream/libgstvaapi-x11.install.in
1042 docs/reference/Makefile
1043 docs/reference/libs/Makefile
1044 docs/reference/libs/libs-docs.xml
1045 docs/reference/plugins/Makefile
1046 docs/reference/plugins/plugins-docs.xml
1050 gst-libs/gst/Makefile
1051 gst-libs/gst/base/Makefile
1052 gst-libs/gst/codecparsers/Makefile
1053 gst-libs/gst/vaapi/Makefile
1057 patches/videoparsers/Makefile
1059 pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc:\
1060 pkgconfig/gstreamer-vaapi.pc.in
1061 pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc:\
1062 pkgconfig/gstreamer-vaapi-drm.pc.in
1063 pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc:\
1064 pkgconfig/gstreamer-vaapi-glx.pc.in
1065 pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc:\
1066 pkgconfig/gstreamer-vaapi-wayland.pc.in
1067 pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc:\
1068 pkgconfig/gstreamer-vaapi-x11.pc.in
1075 test $1 -eq 1 && echo yes || echo no
1079 AS_IF([test $USE_DRM -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS drm"])
1080 AS_IF([test $USE_X11 -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS x11"])
1081 AS_IF([test $USE_GLX -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS glx"])
1082 AS_IF([test $USE_EGL -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS egl"])
1083 AS_IF([test $USE_WAYLAND -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS wayland"])
1086 echo $PACKAGE configuration summary:
1088 echo Installation Prefix .............. : ${prefix}
1089 echo GStreamer API version ............ : $GST_API_VERSION
1090 echo VA-API version ................... : $VA_VERSION_STR
1091 echo Video encoding ................... : $(yesno $USE_ENCODERS)
1092 echo Video outputs .................... : $VIDEO_OUTPUTS