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], [10])
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])
12 # gstreamer-vaapi library (libtool) version number
13 m4_define([gst_vaapi_lt_current], [5])
14 m4_define([gst0_vaapi_lt_current_bias], [0])
15 m4_define([gst1_vaapi_lt_current_bias], [2])
16 m4_define([gst2_vaapi_lt_current_bias], [4])
17 m4_define([gst4_vaapi_lt_current_bias], [5])
18 m4_define([gst6_vaapi_lt_current_bias], [5])
19 m4_define([gst_vaapi_lt_revision], [0])
20 m4_define([gst_vaapi_lt_age], [0])
23 m4_define([glib_version], [2.28])
25 # gstreamer version number
26 m4_define([gst_api_version], [autodetect])
27 m4_define([gst0_version], [0.10.36])
28 m4_define([gst0_plugins_base_version], [0.10.31])
29 m4_define([gst0_plugins_bad_version], [0.10.22])
30 m4_define([gst1_version], [1.0.0])
31 m4_define([gst1_plugins_base_version], [1.0.0])
32 m4_define([gst1_plugins_bad_version], [1.0.0])
33 m4_define([gst12_version], [1.1.90])
34 m4_define([gst12_plugins_base_version], [1.1.0])
35 m4_define([gst12_plugins_bad_version], [1.1.0])
36 m4_define([gst14_version], [1.2.90])
37 m4_define([gst14_plugins_base_version], [1.3.0])
38 m4_define([gst14_plugins_bad_version], [1.3.0])
39 m4_define([gst16_version], [1.5.0])
40 m4_define([gst16_plugins_base_version], [1.5.0])
41 m4_define([gst16_plugins_bad_version], [1.5.0])
43 # Wayland minimum version number
44 m4_define([wayland_api_version], [1.0.0])
46 # VA-API minimum version number
47 m4_define([va_api_version], [0.30.4])
48 m4_define([va_api_enc_version], [0.34.0])
49 m4_define([va_api_drm_version], [0.33.0])
50 m4_define([va_api_x11_version], [0.31.0])
51 m4_define([va_api_glx_version], [0.32.0])
52 m4_define([va_api_wld_version], [0.33.0])
54 # libva package version number
55 m4_define([libva_enc_package_version], [1.2.0])
56 m4_define([libva_drm_package_version], [1.1.0])
57 m4_define([libva_x11_package_version], [1.0.3])
58 m4_define([libva_glx_package_version], [1.0.9])
59 m4_define([libva_wld_package_version], [1.1.0])
61 # gtk-doc version number
62 # XXX: introspection annotations require gtk-doc >= 1.12
63 m4_define([gtkdoc_version], [1.9])
66 AC_INIT([gst_vaapi], [gst_vaapi_version],
67 [gwenole.beauchesne@intel.com],
70 AC_CONFIG_HEADERS([config.h])
71 AC_CONFIG_SRCDIR([Makefile.am])
72 AC_CONFIG_MACRO_DIR([m4])
73 AC_CONFIG_AUX_DIR([build-aux])
77 AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-bzip2])
79 TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
82 LIBVA_PACKAGE_VERSION=libva_x11_package_version
83 AC_SUBST(LIBVA_PACKAGE_VERSION)
85 WAYLAND_API_VERSION=wayland_api_version
86 AC_SUBST(WAYLAND_API_VERSION)
88 dnl Use pretty build output with automake >= 1.11
89 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
90 AM_DEFAULT_VERBOSITY=1
91 AC_SUBST(AM_DEFAULT_VERBOSITY)
98 AC_ARG_VAR([GIT], [Path to git program, if any])
99 AC_PATH_PROG([GIT], [git])
100 AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"])
102 AC_ARG_VAR([YASM], [Path to yasm program, if any])
103 AC_PATH_PROG([YASM], [yasm])
104 if test -z "$YASM" -a "$enable_builtin_libvpx" = "yes"; then
105 AC_MSG_ERROR([yasm is needed to build libvpx sources])
108 dnl Initialize libtool
112 AC_ARG_ENABLE(builtin_videoparsers,
113 AS_HELP_STRING([--enable-builtin-videoparsers],
114 [enable built-in videoparsers @<:@default=yes@:>@]),
115 [], [enable_builtin_videoparsers="yes"])
117 AC_ARG_ENABLE(builtin_codecparsers,
118 AS_HELP_STRING([--enable-builtin-codecparsers],
119 [enable built-in codecparsers @<:@default=yes@:>@]),
120 [], [enable_builtin_codecparsers="yes"])
122 AC_ARG_ENABLE(builtin_libvpx,
123 AS_HELP_STRING([--enable-builtin-libvpx],
124 [enable built-in libvpx @<:@default=yes@:>@]),
125 [], [enable_builtin_libvpx="yes"])
127 AC_ARG_ENABLE([encoders],
128 AS_HELP_STRING([--enable-encoders],
129 [enable video encoders @<:@default=yes@:>@]),
130 [], [enable_encoders="yes"])
133 AS_HELP_STRING([--enable-drm],
134 [enable DRM backend @<:@default=yes@:>@]),
135 [], [enable_drm="yes"])
138 AS_HELP_STRING([--enable-x11],
139 [enable X11 output @<:@default=yes@:>@]),
140 [], [enable_x11="yes"])
143 AS_HELP_STRING([--enable-glx],
144 [enable OpenGL/X11 output @<:@default=yes@:>@]),
145 [], [enable_glx="yes"])
147 AC_ARG_ENABLE(wayland,
148 AC_HELP_STRING([--enable-wayland],
149 [enable Wayland output @<:@default=yes@:>@]),
150 [], [enable_wayland="yes"])
152 AC_ARG_WITH([gstreamer-api],
153 AC_HELP_STRING([--with-gstreamer-api=VERSION],
154 [build against the specified GStreamer API version
155 @<:@default=gst_api_version@:>@]),
156 [GST_API_VERSION="$with_gstreamer_api"], [GST_API_VERSION=gst_api_version])
158 dnl Check for basic libraries
161 dnl Check for Gtk doc
162 GTKDOC_VERSION=gtkdoc_version
163 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
164 m4_ifdef([GTK_DOC_CHECK], [
165 GTK_DOC_CHECK([$GTKDOC_VERSION], [--flavour no-tmpl])], [
166 AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
167 AC_SUBST(GTKDOC_VERSION)
170 GLIB_VERSION_REQUIRED=glib_version
171 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_VERSION_REQUIRED])
172 AC_SUBST(GLIB_VERSION_REQUIRED)
174 dnl Check to see if dlopen is in default libraries (like Solaris, which
175 dnl has it in libc), or if libdl is needed to get it.
176 AC_CHECK_FUNC([dlopen], [], [
177 AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
178 AC_SUBST([DLOPEN_LIBS])
180 dnl ---------------------------------------------------------------------------
182 dnl ---------------------------------------------------------------------------
184 dnl If GStreamer API version is to be autodetected, then always try
185 dnl with the latest version first
186 AC_MSG_CHECKING([for GStreamer API version])
187 if test "$GST_API_VERSION" = "autodetect"; then
188 gst_pkg_versions="1.0 0.10"
190 AS_VERSION_COMPARE([$GST_API_VERSION], [1.0],
191 [gst_pkg_versions="0.10"], [gst_pkg_versions="1.0"],
192 dnl GStreamer 1.2.x APIs don't have their own namespace
193 [gst_pkg_versions="1.0"])
195 for gst_pkg_version in ${gst_pkg_versions}; do
196 if $PKG_CONFIG --exists "gstreamer-$gst_pkg_version"; then
197 gst_version=`$PKG_CONFIG --modversion "gstreamer-$gst_pkg_version"`
198 gst_major_version=`echo "$gst_version" | cut -d'.' -f1`
199 gst_minor_version=`echo "$gst_version" | cut -d'.' -f2`
200 GST_API_VERSION="${gst_major_version}.${gst_minor_version}"
201 GST_PKG_VERSION="$gst_pkg_version"
205 if test -z "$GST_PKG_VERSION"; then
206 AC_MSG_ERROR([version $GST_API_VERSION not found])
208 AC_MSG_RESULT([$GST_API_VERSION])
210 dnl Versions for GStreamer and plugins-base
211 case $GST_API_VERSION in
213 GST_VERSION_REQUIRED=gst0_version
214 GST_PLUGINS_BASE_VERSION_REQUIRED=gst0_plugins_base_version
215 GST_PLUGINS_BAD_VERSION_REQUIRED=gst0_plugins_bad_version
218 GST_VERSION_REQUIRED=gst1_version
219 GST_PLUGINS_BASE_VERSION_REQUIRED=gst1_plugins_base_version
220 GST_PLUGINS_BAD_VERSION_REQUIRED=gst1_plugins_bad_version
223 GST_VERSION_REQUIRED=gst12_version
224 GST_PLUGINS_BASE_VERSION_REQUIRED=gst12_plugins_base_version
225 GST_PLUGINS_BAD_VERSION_REQUIRED=gst12_plugins_bad_version
228 GST_VERSION_REQUIRED=gst14_version
229 GST_PLUGINS_BASE_VERSION_REQUIRED=gst14_plugins_base_version
230 GST_PLUGINS_BAD_VERSION_REQUIRED=gst14_plugins_bad_version
233 GST_VERSION_REQUIRED=gst16_version
234 GST_PLUGINS_BASE_VERSION_REQUIRED=gst16_plugins_base_version
235 GST_PLUGINS_BAD_VERSION_REQUIRED=gst16_plugins_bad_version
238 AC_MSG_ERROR([unsupported GStreamer API version $GST_API_VERSION])
241 AC_SUBST(GST_API_VERSION)
242 AC_SUBST(GST_VERSION_REQUIRED)
243 AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED)
244 AC_SUBST(GST_PLUGINS_BAD_VERSION_REQUIRED)
246 USE_GST_API_0_10="no"
247 USE_GST_API_1_0p="no"
248 USE_GST_API_1_2p="no"
249 AS_VERSION_COMPARE([$GST_API_VERSION], [0.10],
250 [], [USE_GST_API_0_10="yes"], [])
251 AS_VERSION_COMPARE([$GST_API_VERSION], [1.0],
252 [], [USE_GST_API_1_0p="yes"], [USE_GST_API_1_0p="yes"])
253 AS_VERSION_COMPARE([$GST_API_VERSION], [1.2],
254 [], [USE_GST_API_1_2p="yes"], [USE_GST_API_1_2p="yes"])
255 AM_CONDITIONAL([USE_GST_API_0_10], [test "$USE_GST_API_0_10" = "yes"])
256 AM_CONDITIONAL([USE_GST_API_1_0p], [test "$USE_GST_API_1_0p" = "yes"])
257 AM_CONDITIONAL([USE_GST_API_1_2p], [test "$USE_GST_API_1_2p" = "yes"])
259 dnl GStreamer 1.2.x APIs don't have their own namespace
260 GST_PKG_VERSION="$GST_API_VERSION"
261 if test "$USE_GST_API_1_2p" = "yes"; then
262 GST_PKG_VERSION="1.0"
264 AC_SUBST([GST_PKG_VERSION])
266 dnl Validate certain features
267 if test "$USE_GST_API_0_10" = "yes"; then
268 AC_MSG_WARN([support for GStreamer 0.10 is obsolete, and will be removed])
269 if test "$enable_builtin_videoparsers" = "yes"; then
270 AC_MSG_WARN([disabled built-in videoparsers (unsupported)])
271 enable_builtin_videoparsers="no"
273 elif test "$USE_GST_API_1_2p" != "yes"; then
274 AC_MSG_WARN([support for GStreamer < 1.2 is deprecated, please upgrade])
278 PKG_CHECK_MODULES([GST],
279 [gstreamer-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED])
280 PKG_CHECK_MODULES([GST_BASE],
281 [gstreamer-base-$GST_PKG_VERSION >= $GST_VERSION_REQUIRED])
283 AC_CACHE_CHECK([for GstBaseSink::query hook], ac_cv_have_gst_base_sink_query, [
284 saved_CPPFLAGS="$CPPFLAGS"
285 CPPFLAGS="$CPPFLAGS $GST_BASE_CFLAGS"
287 LIBS="$LIBS $GST_BASE_LIBS"
290 [[#include <gst/base/gstbasesink.h>]],
291 [[GstBaseSinkClass klass; klass.query = NULL;]])],
292 [ac_cv_have_gst_base_sink_query="yes"],
293 [ac_cv_have_gst_base_sink_query="no"]
295 CPPFLAGS="$saved_CPPFLAGS"
298 if test "$ac_cv_have_gst_base_sink_query" != "yes"; then
299 AC_MSG_ERROR([GstBaseSink does not contain the 'query' vfunc])
302 dnl GStreamer -base plugins
303 PKG_CHECK_MODULES([GST_PLUGINS_BASE],
304 [gstreamer-plugins-base-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
305 if test "$GST_API_VERSION" = "0.10"; then
306 PKG_CHECK_MODULES([GST_INTERFACES],
307 [gstreamer-interfaces-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
310 dnl ... GstVideoOverlayComposition (gstreamer-video)
311 PKG_CHECK_MODULES([GST_VIDEO],
312 [gstreamer-video-$GST_PKG_VERSION >= $GST_PLUGINS_BASE_VERSION_REQUIRED])
314 AC_CACHE_CHECK([for GstVideoOverlayComposition],
315 ac_cv_have_gst_video_overlay_composition, [
316 saved_CPPFLAGS="$CPPFLAGS"
317 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_VIDEO_CFLAGS"
319 LIBS="$LIBS $GST_LIBS $GST_VIDEO_LIBS"
322 [[#include <gst/video/video-overlay-composition.h>]],
323 [[GstVideoOverlayComposition *c;
324 c = gst_video_overlay_composition_new(0);]])],
325 [ac_cv_have_gst_video_overlay_composition="yes"],
326 [ac_cv_have_gst_video_overlay_composition="no"]
328 CPPFLAGS="$saved_CPPFLAGS"
331 if test "$ac_cv_have_gst_video_overlay_composition" != "yes"; then
332 AC_MSG_ERROR([GstVideoOverlayComposition is not available])
335 AC_CACHE_CHECK([... with advanced format flags],
336 ac_cv_have_gst_video_overlay_hwcaps, [
337 saved_CPPFLAGS="$CPPFLAGS"
338 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_VIDEO_CFLAGS"
340 LIBS="$LIBS $GST_LIBS $GST_VIDEO_LIBS"
343 [[#include <gst/video/video-overlay-composition.h>]],
344 [[GstVideoOverlayRectangle *rect;
345 const guint w = 64, h = 64;
347 GST_VIDEO_OVERLAY_FORMAT_FLAG_PREMULTIPLIED_ALPHA|
348 GST_VIDEO_OVERLAY_FORMAT_FLAG_GLOBAL_ALPHA);
349 rect = gst_video_overlay_rectangle_new_argb(NULL, w, h, w * 4,
351 gst_video_overlay_rectangle_set_global_alpha(rect, 0.5f);]])],
352 [ac_cv_have_gst_video_overlay_hwcaps="yes"],
353 [ac_cv_have_gst_video_overlay_hwcaps="no"]
355 CPPFLAGS="$saved_CPPFLAGS"
358 if test "$ac_cv_have_gst_video_overlay_hwcaps" = "yes"; then
359 AC_DEFINE_UNQUOTED([HAVE_GST_VIDEO_OVERLAY_HWCAPS], 1,
360 [Defined to 1 if GstVideoOverlayComposition API supports HW hints.])
363 dnl GStreamer -bad plugins (deprecated in GStreamer v1.2)
364 if test "$USE_GST_API_1_2p" != "yes"; then
365 PKG_CHECK_MODULES([GST_BASEVIDEO],
366 [gstreamer-basevideo-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED])
369 dnl ... bitstream parsers
370 if test "$enable_builtin_codecparsers" = "yes"; then
371 ac_cv_have_gst_mpeg2_parser="no"
372 ac_cv_have_gst_h264_parser="no"
373 ac_cv_have_gst_jpeg_parser="no"
374 ac_cv_have_gst_vp8_parser="no"
376 PKG_CHECK_MODULES([GST_CODEC_PARSERS],
377 [gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED])
380 dnl ... MPEG-2 parser, with the required extensions
381 AC_CACHE_CHECK([for MPEG-2 parser],
382 ac_cv_have_gst_mpeg2_parser, [
383 saved_CPPFLAGS="$CPPFLAGS"
384 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
386 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
389 [[#include <gst/codecparsers/gstmpegvideoparser.h>]],
390 [[GstMpegVideoSequenceHdr seq_hdr;
391 GstMpegVideoSequenceExt seq_ext;
392 GstMpegVideoSequenceDisplayExt seq_dpy;
393 GstMpegVideoSliceHdr slice_hdr;
394 GstMpegVideoPacket packet;
395 gst_mpeg_video_packet_parse_slice_header(&packet, &slice_hdr,
397 gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr,
398 &seq_ext, &seq_dpy);]])],
399 [ac_cv_have_gst_mpeg2_parser="yes"],
400 [ac_cv_have_gst_mpeg2_parser="no"]
402 CPPFLAGS="$saved_CPPFLAGS"
405 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_MPEG2],
406 [test "$ac_cv_have_gst_mpeg2_parser" != "yes"])
408 dnl ... H.264 parser, with the required extensions
409 AC_CACHE_CHECK([for H.264 parser],
410 ac_cv_have_gst_h264_parser, [
411 saved_CPPFLAGS="$CPPFLAGS"
412 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
414 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
417 [[#include <gst/codecparsers/gsth264parser.h>]],
418 [[GstH264SliceHdr slice_hdr;
419 GstH264VUIParams vui_params;
420 GstH264Profile profile = GST_H264_PROFILE_HIGH;
421 slice_hdr.n_emulation_prevention_bytes = 0;
422 vui_params.par_n = 0;
423 vui_params.par_d = 0;]])],
424 [ac_cv_have_gst_h264_parser="yes"],
425 [ac_cv_have_gst_h264_parser="no"]
427 CPPFLAGS="$saved_CPPFLAGS"
430 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H264],
431 [test "$ac_cv_have_gst_h264_parser" != "yes"])
433 dnl ... JPEG parser, not upstream yet
434 AC_CACHE_CHECK([for JPEG parser],
435 ac_cv_have_gst_jpeg_parser, [
436 saved_CPPFLAGS="$CPPFLAGS"
437 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
439 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
442 [[#include <gst/codecparsers/gstjpegparser.h>]],
443 [[GstJpegImage jpeg_image;]])],
444 [ac_cv_have_gst_jpeg_parser="yes"],
445 [ac_cv_have_gst_jpeg_parser="no"]
447 CPPFLAGS="$saved_CPPFLAGS"
450 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_JPEG],
451 [test "$ac_cv_have_gst_jpeg_parser" != "yes"])
453 dnl ... VP8 parser, not upstream yet
454 if test "$enable_builtin_libvpx" = "yes"; then
455 ac_cv_have_gst_vp8_parser="no"
457 AC_CACHE_CHECK([for VP8 parser],
458 ac_cv_have_gst_vp8_parser, [
459 saved_CPPFLAGS="$CPPFLAGS"
460 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
462 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
465 [[#include <gst/codecparsers/gstvp8parser.h>]],
466 [[GstVp8FrameHdr frame_hdr;]])],
467 [ac_cv_have_gst_vp8_parser="yes"],
468 [ac_cv_have_gst_vp8_parser="no"]
470 CPPFLAGS="$saved_CPPFLAGS"
473 AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP8],
474 [test "$ac_cv_have_gst_vp8_parser" != "yes"])
475 AM_CONDITIONAL([USE_BUILTIN_LIBVPX], [test "$enable_builtin_libvpx" = "yes"])
477 dnl ... video parsers
478 AM_CONDITIONAL([USE_LOCAL_VIDEO_PARSERS],
479 [test "$enable_builtin_videoparsers" = "yes"])
481 case $GST_API_VERSION in
482 0.10) lt_bias=gst0_vaapi_lt_current_bias;;
483 1.0) lt_bias=gst1_vaapi_lt_current_bias;;
484 1.2) lt_bias=gst2_vaapi_lt_current_bias;;
485 1.[[3-4]]) lt_bias=gst4_vaapi_lt_current_bias;;
486 1.5) lt_bias=gst6_vaapi_lt_current_bias;;
488 GST_VAAPI_MAJOR_VERSION=`expr gst_vaapi_lt_current - "$lt_bias"`
489 AC_SUBST(GST_VAAPI_MAJOR_VERSION)
491 dnl GST_VAAPI_LT_LDFLAGS:
492 GST_VAAPI_LT_CURRENT="$GST_VAAPI_MAJOR_VERSION"
493 GST_VAAPI_LT_REV=gst_vaapi_lt_revision
494 GST_VAAPI_LT_AGE=gst_vaapi_lt_age
495 GST_VAAPI_LT_VERSION="$GST_VAAPI_LT_CURRENT:$GST_VAAPI_LT_REV:$GST_VAAPI_LT_AGE"
496 GST_VAAPI_LT_LDFLAGS="-version-info $GST_VAAPI_LT_VERSION"
497 AC_SUBST(GST_VAAPI_LT_VERSION)
498 AC_SUBST(GST_VAAPI_LT_LDFLAGS)
501 dnl LDFLAGS really should only contain flags, not libs - they get added before
502 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
503 GST_ALL_LDFLAGS="-no-undefined"
504 AC_SUBST(GST_ALL_LDFLAGS)
506 dnl GST_PLUGIN_LDFLAGS:
507 dnl this really should only contain flags, not libs - they get added before
508 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
509 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS"
510 AC_SUBST(GST_PLUGIN_LDFLAGS)
512 dnl Check for the GStreamer plugins directory
513 AC_ARG_VAR([GST_PLUGIN_PATH], [installation path for gstreamer-vaapi plugin elements for GStreamer 0.10])
514 AC_ARG_VAR([GST_PLUGIN_PATH_1_0], [installation path for gstreamer-vaapi plugin elements for GStreamer 1.0])
515 AC_MSG_CHECKING([for GStreamer plugins directory])
516 case $GST_PKG_VERSION in
517 0.10) _gst_plugin_path="$GST_PLUGIN_PATH";;
518 1.0) _gst_plugin_path="$GST_PLUGIN_PATH_1_0";;
520 if test -d "$_gst_plugin_path"; then
521 GST_PLUGINS_DIR="$_gst_plugin_path"
523 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_PKG_VERSION --variable pluginsdir`
524 if test -z "$GST_PLUGINS_DIR"; then
525 GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_PKG_VERSION"
528 AC_MSG_RESULT([$GST_PLUGINS_DIR])
529 plugindir="$GST_PLUGINS_DIR"
532 dnl ---------------------------------------------------------------------------
534 dnl ---------------------------------------------------------------------------
536 dnl Check for DRM/libudev
538 if test "$enable_drm" = "yes"; then
539 PKG_CHECK_MODULES(DRM, [libdrm], [USE_DRM=1], [USE_DRM=0])
540 PKG_CHECK_MODULES(UDEV, [libudev], [:], [USE_DRM=0])
542 if test $USE_DRM -eq 1; then
543 saved_CPPFLAGS="$CPPFLAGS"
544 CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
545 AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM=0])
546 CPPFLAGS="$saved_CPPFLAGS"
552 if test "$enable_x11" = "yes"; then
553 PKG_CHECK_MODULES(X11, [x11], [USE_X11=1], [USE_X11=0])
554 if test $USE_X11 -eq 1; then
555 saved_CPPFLAGS="$CPPFLAGS"
556 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
557 AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/Xatom.h], [:], [USE_X11=0])
558 CPPFLAGS="$saved_CPPFLAGS"
562 dnl Check for XKB library
564 if test $USE_X11 -eq 1; then
565 AC_CHECK_HEADERS([X11/XKBlib.h], [HAVE_XKBLIB=1], [:])
567 if test $HAVE_XKBLIB -eq 1; then
568 AC_DEFINE_UNQUOTED([HAVE_XKBLIB], 1,
569 [Defined to 1 if the XKB extension exists.])
574 if test $USE_X11 -eq 1; then
576 PKG_CHECK_MODULES([XRANDR], [xrandr], [:], [HAVE_XRANDR=0])
577 if test $HAVE_XRANDR -eq 1; then
578 saved_CPPFLAGS="$CPPFLAGS"
579 CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS"
580 AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [:], [HAVE_XRANDR=0])
581 CPPFLAGS="$saved_CPPFLAGS"
584 if test $HAVE_XRANDR -eq 1; then
585 AC_DEFINE_UNQUOTED(HAVE_XRANDR, 1,
586 [Defined to 1 if the XRandR extension exists.])
589 dnl Check for XRender
591 if test $USE_X11 -eq 1; then
593 PKG_CHECK_MODULES([XRENDER], [xrender], [:], [HAVE_XRENDER=0])
594 if test $HAVE_XRENDER -eq 1; then
595 saved_CPPFLAGS="$CPPFLAGS"
596 CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS"
597 AC_CHECK_HEADERS([X11/extensions/Xrender.h], [:], [HAVE_XRENDER=0])
598 CPPFLAGS="$saved_CPPFLAGS"
601 if test $HAVE_XRENDER -eq 1; then
602 AC_DEFINE_UNQUOTED([HAVE_XRENDER], [1],
603 [Defined to 1 if the XRender extension exists.])
608 if test "$enable_glx" = "yes"; then
613 if test "$enable_opengl" = "yes"; then
615 PKG_CHECK_MODULES([GL], [gl], [:], [HAVE_GL=0])
616 saved_CPPFLAGS="$CPPFLAGS"
617 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
618 AC_CHECK_HEADERS([GL/gl.h GL/glext.h], [:], [HAVE_GL=0], [
623 CPPFLAGS="$saved_CPPFLAGS"
628 if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then
630 saved_CPPFLAGS="$CPPFLAGS"
632 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
633 LIBS="$LIBS $GL_LIBS"
634 AC_CHECK_HEADERS([GL/glx.h], [:], [USE_GLX=0], [
639 AC_CHECK_LIB([GL], [glXCreateContext], [:], [USE_GLX=0])
640 CPPFLAGS="$saved_CPPFLAGS"
644 dnl Check for Wayland
646 if test "$enable_wayland" = "yes"; then
647 PKG_CHECK_MODULES(WAYLAND, [wayland-client >= wayland_api_version],
648 [USE_WAYLAND=1], [USE_WAYLAND=0])
650 if test $USE_WAYLAND -eq 1; then
651 saved_CPPFLAGS="$CPPFLAGS"
652 CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS"
653 AC_CHECK_HEADERS([wayland-client.h], [:], [USE_WAYLAND=0])
654 CPPFLAGS="$saved_CPPFLAGS"
658 dnl ---------------------------------------------------------------------------
660 dnl ---------------------------------------------------------------------------
663 LIBVA_PKGNAME="libva"
664 PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME >= va_api_version])
665 AC_SUBST(LIBVA_PKGNAME)
667 VA_VERSION=`$PKG_CONFIG --modversion libva`
668 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
669 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
670 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
671 VA_VERSION_STR="$VA_VERSION"
675 if test $USE_DRM -eq 1; then
676 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= va_api_drm_version],
677 [HAVE_VA_DRM=1], [USE_DRM=0])
679 if test $HAVE_VA_DRM -eq 1; then
680 saved_CPPFLAGS="$CPPFLAGS"
681 CPPFLAGS="$LIBVA_DRM_CFLAGS"
682 AC_CHECK_HEADERS([va/va_drm.h], [:], [HAVE_VA_DRM=0 USE_DRM=0])
683 CPPFLAGS="$saved_CPPFLAGS"
689 LIBVA_X11_PKGNAME="libva-x11"
690 if test $USE_X11 -eq 1; then
691 PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME >= va_api_x11_version],
692 [HAVE_VA_X11=1], [USE_X11=0])
694 AC_SUBST(LIBVA_X11_PKGNAME)
698 LIBVA_GLX_PKGNAME="libva-glx"
699 if test $USE_GLX -eq 1; then
700 PKG_CHECK_MODULES(LIBVA_GLX, [$LIBVA_GLX_PKGNAME >= va_api_glx_version],
701 [HAVE_VA_GLX=1], [LIBVA_GLX_PKGNAME="$LIBVA_X11_PKGNAME"])
703 if test $HAVE_VA_GLX -eq 1; then
704 saved_CPPFLAGS="$CPPFLAGS"
705 CPPFLAGS="$LIBVA_GLX_CFLAGS"
706 AC_CHECK_HEADERS([va/va_glx.h], [:], [HAVE_VA_GLX=0])
707 CPPFLAGS="$saved_CPPFLAGS"
710 AC_SUBST(LIBVA_GLX_PKGNAME)
712 dnl Check for va_dec_jpeg.h header
713 saved_CPPFLAGS="$CPPFLAGS"
714 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
715 AC_CHECK_HEADERS([va/va_dec_jpeg.h], [], [], [#include <va/va.h>])
716 CPPFLAGS="$saved_CPPFLAGS"
718 dnl Check for JPEG decoding API (0.32.1+)
720 AC_CACHE_CHECK([for JPEG decoding API],
721 ac_cv_have_jpeg_decoding_api, [
722 saved_CPPFLAGS="$CPPFLAGS"
723 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
725 LIBS="$LIBS $LIBVA_LIBS"
729 #ifdef HAVE_VA_VA_DEC_JPEG_H
730 #include <va/va_dec_jpeg.h>
733 [[VAPictureParameterBufferJPEGBaseline pic_param;
734 VASliceParameterBufferJPEGBaseline slice_param;
735 VAHuffmanTableBufferJPEGBaseline huffman_table;
736 VAIQMatrixBufferJPEGBaseline iq_matrix;]])],
737 [ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=1],
738 [ac_cv_have_jpeg_decoding_api="no"]
740 CPPFLAGS="$saved_CPPFLAGS"
744 dnl Check for va_dec_vp8.h header
745 saved_CPPFLAGS="$CPPFLAGS"
746 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
747 AC_CHECK_HEADERS([va/va_dec_vp8.h], [], [], [#include <va/va.h>])
748 CPPFLAGS="$saved_CPPFLAGS"
750 dnl Check for VP8 decoding API (0.34+)
752 AC_CACHE_CHECK([for VP8 decoding API],
753 ac_cv_have_vp8_decoding_api, [
754 saved_CPPFLAGS="$CPPFLAGS"
755 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
757 LIBS="$LIBS $LIBVA_LIBS"
761 #ifdef HAVE_VA_VA_DEC_VP8_H
762 #include <va/va_dec_vp8.h>
765 [[VAPictureParameterBufferVP8 pic_param;
766 VASliceParameterBufferVP8 slice_param;
767 VAProbabilityDataBufferVP8 prob_data;
768 VAIQMatrixBufferVP8 iq_matrix;
769 slice_param.slice_data_offset = 0;
770 slice_param.slice_data_flag = 0;]])],
771 [ac_cv_have_vp8_decoding_api="yes" USE_VP8_DECODER=1],
772 [ac_cv_have_vp8_decoding_api="no"]
774 CPPFLAGS="$saved_CPPFLAGS"
779 dnl Check for vpp (video post-processing) support
781 AC_CACHE_CHECK([for video post-postprocessing API],
782 ac_cv_have_va_vpp_api, [
783 saved_CPPFLAGS="$CPPFLAGS"
784 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
786 LIBS="$LIBS $LIBVA_LIBS"
790 #include <va/va_vpp.h>]],
793 VAProcFilterType filters[VAProcFilterCount];
794 unsigned int num_filters = VAProcFilterCount;
795 vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters);
797 [ac_cv_have_va_vpp_api="yes" USE_VA_VPP=1],
798 [ac_cv_have_va_vpp_api="no"]
800 CPPFLAGS="$saved_CPPFLAGS"
804 dnl Check for encoding support
806 if test "$enable_encoders" = "yes"; then
807 PKG_CHECK_MODULES([LIBVA], [libva >= va_api_enc_version],
808 [HAVE_VA_ENC=1], [HAVE_VA_ENC=0])
810 if test $HAVE_VA_ENC -eq 1; then
811 saved_CPPFLAGS="$CPPFLAGS"
812 CPPFLAGS="$LIBVA_CFLAGS"
813 AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h],
814 [USE_ENCODERS=1], [HAVE_VA_ENC=0 USE_ENCODERS=0],
817 CPPFLAGS="$saved_CPPFLAGS"
822 if test "$enable_wayland" = "yes"; then
823 PKG_CHECK_MODULES([LIBVA_WAYLAND], [libva-wayland >= va_api_wld_version],
824 [:], [USE_WAYLAND=0])
827 dnl ---------------------------------------------------------------------------
828 dnl -- Generate files and summary --
829 dnl ---------------------------------------------------------------------------
831 case ":$USE_X11:$USE_GLX:$USE_WAYLAND:$USE_DRM:" in
835 AC_MSG_ERROR([No renderer is enabled])
839 AC_DEFINE_UNQUOTED([USE_ENCODERS], $USE_ENCODERS,
840 [Defined to 1 if video encoders are used])
841 AM_CONDITIONAL([USE_ENCODERS], [test $USE_ENCODERS -eq 1])
843 AC_DEFINE_UNQUOTED(USE_VA_VPP, $USE_VA_VPP,
844 [Defined to 1 if video post-processing is used])
845 AM_CONDITIONAL(USE_VA_VPP, test $USE_VA_VPP -eq 1)
847 AC_DEFINE_UNQUOTED(USE_JPEG_DECODER, $USE_JPEG_DECODER,
848 [Defined to 1 if JPEG decoder is used])
849 AM_CONDITIONAL(USE_JPEG_DECODER, test $USE_JPEG_DECODER -eq 1)
851 AC_DEFINE_UNQUOTED(USE_VP8_DECODER, $USE_VP8_DECODER,
852 [Defined to 1 if VP8 decoder is used])
853 AM_CONDITIONAL(USE_VP8_DECODER, test $USE_VP8_DECODER -eq 1)
855 AC_DEFINE_UNQUOTED(USE_DRM, $USE_DRM,
856 [Defined to 1 if DRM is enabled])
857 AM_CONDITIONAL(USE_DRM, test $USE_DRM -eq 1)
859 AC_DEFINE_UNQUOTED(USE_X11, $USE_X11,
860 [Defined to 1 if X11 is enabled])
861 AM_CONDITIONAL(USE_X11, test $USE_X11 -eq 1)
863 AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
864 [Defined to 1 if GLX is enabled])
865 AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
867 AC_DEFINE_UNQUOTED(USE_WAYLAND, $USE_WAYLAND,
868 [Defined to 1 if WAYLAND is enabled])
869 AM_CONDITIONAL(USE_WAYLAND, test $USE_WAYLAND -eq 1)
871 pkgconfigdir=${libdir}/pkgconfig
872 AC_SUBST(pkgconfigdir)
876 debian.upstream/Makefile
877 debian.upstream/changelog
878 debian.upstream/control
879 debian.upstream/gstreamer$GST_API_VERSION-vaapi-doc.install:\
880 debian.upstream/gstreamer-vaapi-doc.install.in
881 debian.upstream/gstreamer$GST_API_VERSION-vaapi.install:\
882 debian.upstream/gstreamer-vaapi.install.in
883 debian.upstream/libgstvaapi$GST_PKG_VERSION-dev.install:\
884 debian.upstream/libgstvaapi-dev.install.in
885 debian.upstream/libgstvaapi$GST_VAAPI_MAJOR_VERSION.install:\
886 debian.upstream/libgstvaapi.install.in
887 debian.upstream/libgstvaapi-drm-$GST_VAAPI_MAJOR_VERSION.install:\
888 debian.upstream/libgstvaapi-drm.install.in
889 debian.upstream/libgstvaapi-glx-$GST_VAAPI_MAJOR_VERSION.install:\
890 debian.upstream/libgstvaapi-glx.install.in
891 debian.upstream/libgstvaapi-wayland-$GST_VAAPI_MAJOR_VERSION.install:\
892 debian.upstream/libgstvaapi-wayland.install.in
893 debian.upstream/libgstvaapi-x11-$GST_VAAPI_MAJOR_VERSION.install:\
894 debian.upstream/libgstvaapi-x11.install.in
896 docs/reference/Makefile
897 docs/reference/libs/Makefile
898 docs/reference/libs/libs-docs.xml
899 docs/reference/plugins/Makefile
900 docs/reference/plugins/plugins-docs.xml
904 gst-libs/gst/Makefile
905 gst-libs/gst/base/Makefile
906 gst-libs/gst/codecparsers/Makefile
907 gst-libs/gst/vaapi/Makefile
908 gst-libs/gst/video/Makefile
912 patches/videoparsers/Makefile
914 pkgconfig/gstreamer-vaapi-$GST_PKG_VERSION.pc:\
915 pkgconfig/gstreamer-vaapi.pc.in
916 pkgconfig/gstreamer-vaapi-drm-$GST_PKG_VERSION.pc:\
917 pkgconfig/gstreamer-vaapi-drm.pc.in
918 pkgconfig/gstreamer-vaapi-glx-$GST_PKG_VERSION.pc:\
919 pkgconfig/gstreamer-vaapi-glx.pc.in
920 pkgconfig/gstreamer-vaapi-wayland-$GST_PKG_VERSION.pc:\
921 pkgconfig/gstreamer-vaapi-wayland.pc.in
922 pkgconfig/gstreamer-vaapi-x11-$GST_PKG_VERSION.pc:\
923 pkgconfig/gstreamer-vaapi-x11.pc.in
930 test $1 -eq 1 && echo yes || echo no
934 AS_IF([test $USE_DRM -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS drm"])
935 AS_IF([test $USE_X11 -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS x11"])
936 AS_IF([test $USE_GLX -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS glx"])
937 AS_IF([test $USE_WAYLAND -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS wayland"])
940 echo $PACKAGE configuration summary:
942 echo Installation Prefix .............. : ${prefix}
943 echo GStreamer API version ............ : $GST_API_VERSION
944 echo VA-API version ................... : $VA_VERSION_STR
945 echo Video encoding ................... : $(yesno $USE_ENCODERS)
946 echo Video outputs .................... : $VIDEO_OUTPUTS