1 # gstreamer-vaapi package version number
2 m4_define([gst_vaapi_major_version], [0])
3 m4_define([gst_vaapi_minor_version], [7])
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([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([gst8_vaapi_lt_current_bias], [7])
21 m4_define([gst_vaapi_lt_revision], [0])
22 m4_define([gst_vaapi_lt_age], [0])
25 m4_define([glib_version], [2.32])
27 # gmodule version number
28 m4_define([gmodule_version], [2.32])
30 # gstreamer version number
31 m4_define([gst_api_version], [autodetect])
32 m4_define([gst12_version], [1.1.90])
33 m4_define([gst12_plugins_base_version], [1.1.0])
34 m4_define([gst12_plugins_bad_version], [1.1.0])
35 m4_define([gst14_version], [1.2.90])
36 m4_define([gst14_plugins_base_version], [1.3.0])
37 m4_define([gst14_plugins_bad_version], [1.3.0])
38 m4_define([gst16_version], [1.5.0])
39 m4_define([gst16_plugins_base_version], [1.5.0])
40 m4_define([gst16_plugins_bad_version], [1.5.0])
41 m4_define([gst18_version], [1.7.0])
42 m4_define([gst18_plugins_base_version], [1.7.0])
43 m4_define([gst18_plugins_bad_version], [1.7.0])
45 # Wayland minimum version number
46 m4_define([wayland_api_version], [1.0.2])
48 # VA-API minimum version number
49 m4_define([va_api_version], [0.30.4])
50 m4_define([va_api_enc_version], [0.34.0])
51 m4_define([va_api_drm_version], [0.33.0])
52 m4_define([va_api_x11_version], [0.31.0])
53 m4_define([va_api_wld_version], [0.33.0])
55 # libva package version number
56 m4_define([libva_enc_package_version], [1.2.0])
57 m4_define([libva_drm_package_version], [1.1.0])
58 m4_define([libva_x11_package_version], [1.0.3])
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, sreerenj.balachandran@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 dnl Initialize libtool
106 AC_ARG_ENABLE(builtin_videoparsers,
107 AS_HELP_STRING([--enable-builtin-videoparsers],
108 [enable built-in videoparsers @<:@default=yes@:>@]),
109 [], [enable_builtin_videoparsers="yes"])
111 AC_ARG_ENABLE([encoders],
112 AS_HELP_STRING([--enable-encoders],
113 [enable video encoders @<:@default=yes@:>@]),
114 [], [enable_encoders="yes"])
117 AS_HELP_STRING([--enable-drm],
118 [enable DRM backend @<:@default=yes@:>@]),
119 [], [enable_drm="yes"])
122 AS_HELP_STRING([--enable-x11],
123 [enable X11 output @<:@default=yes@:>@]),
124 [], [enable_x11="yes"])
127 AS_HELP_STRING([--enable-glx],
128 [enable OpenGL/X11 output @<:@default=yes@:>@]),
129 [], [enable_glx="yes"])
131 AC_ARG_ENABLE(wayland,
132 AC_HELP_STRING([--enable-wayland],
133 [enable Wayland output @<:@default=yes@:>@]),
134 [], [enable_wayland="yes"])
137 AS_HELP_STRING([--enable-egl],
138 [enable EGL output @<:@default=yes@:>@]),
139 [], [enable_egl="yes"])
142 AS_HELP_STRING([--with-glapi=APIs],
143 [build with the specified OpenGL APIs @<:@default=default_glapi@:>@]),
144 [GLAPI="$with_glapi"], [GLAPI=default_glapi])
146 dnl Check for basic libraries
149 dnl Check for Gtk doc
150 GTKDOC_VERSION=gtkdoc_version
151 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
152 m4_ifdef([GTK_DOC_CHECK], [
153 GTK_DOC_CHECK([$GTKDOC_VERSION], [--flavour no-tmpl])], [
154 AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
155 AC_SUBST(GTKDOC_VERSION)
158 GLIB_VERSION_REQUIRED=glib_version
159 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $GLIB_VERSION_REQUIRED])
160 AC_SUBST(GLIB_VERSION_REQUIRED)
162 dnl Check to see if dlopen is in default libraries (like Solaris, which
163 dnl has it in libc), or if libdl is needed to get it.
164 AC_CHECK_FUNC([dlopen], [], [
165 AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
166 AC_SUBST([DLOPEN_LIBS])
168 dnl ---------------------------------------------------------------------------
170 dnl ---------------------------------------------------------------------------
171 AC_MSG_CHECKING([for GStreamer API version])
172 if $PKG_CONFIG --exists "gstreamer-1.0"; then
173 gst_version=`$PKG_CONFIG --modversion "gstreamer-1.0"`
174 gst_major_version=`echo "$gst_version" | cut -d'.' -f1`
175 gst_minor_version=`echo "$gst_version" | cut -d'.' -f2`
176 GST_API_VERSION="${gst_major_version}.${gst_minor_version}"
177 GST_PKG_VERSION="1.0"
179 if test -z "$GST_PKG_VERSION"; then
180 AC_MSG_ERROR([gstreamer-1.0 was not found])
182 AC_MSG_RESULT([$GST_API_VERSION])
184 AC_DEFINE_UNQUOTED([GST_API_VERSION_S], ["$GST_API_VERSION"],
185 [Defined to the string representation of GStreamer version])
187 dnl Versions for GStreamer and plugins-base
188 case $GST_API_VERSION in
190 GST_VERSION_REQUIRED=gst12_version
191 GST_PLUGINS_BASE_VERSION_REQUIRED=gst12_plugins_base_version
192 GST_PLUGINS_BAD_VERSION_REQUIRED=gst12_plugins_bad_version
195 GST_VERSION_REQUIRED=gst14_version
196 GST_PLUGINS_BASE_VERSION_REQUIRED=gst14_plugins_base_version
197 GST_PLUGINS_BAD_VERSION_REQUIRED=gst14_plugins_bad_version
200 GST_VERSION_REQUIRED=gst16_version
201 GST_PLUGINS_BASE_VERSION_REQUIRED=gst16_plugins_base_version
202 GST_PLUGINS_BAD_VERSION_REQUIRED=gst16_plugins_bad_version
205 GST_VERSION_REQUIRED=gst18_version
206 GST_PLUGINS_BASE_VERSION_REQUIRED=gst18_plugins_base_version
207 GST_PLUGINS_BAD_VERSION_REQUIRED=gst18_plugins_bad_version
210 AC_MSG_ERROR([unsupported GStreamer API version $GST_API_VERSION])
213 AC_SUBST(GST_API_VERSION)
214 AC_SUBST(GST_VERSION_REQUIRED)
215 AC_SUBST(GST_PLUGINS_BASE_VERSION_REQUIRED)
216 AC_SUBST(GST_PLUGINS_BAD_VERSION_REQUIRED)
218 USE_GST_API_1_2p="no"
219 USE_GST_API_1_4p="no"
220 AS_VERSION_COMPARE([$GST_API_VERSION], [1.2],
221 [], [USE_GST_API_1_2p="yes"], [USE_GST_API_1_2p="yes"])
222 AS_VERSION_COMPARE([$GST_API_VERSION], [1.4],
223 [], [USE_GST_API_1_4p="yes"], [USE_GST_API_1_4p="yes"])
224 AM_CONDITIONAL([USE_GST_API_1_2p], [test "$USE_GST_API_1_2p" = "yes"])
225 AM_CONDITIONAL([USE_GST_API_1_4p], [test "$USE_GST_API_1_4p" = "yes"])
227 AC_SUBST([GST_PKG_VERSION])
229 AC_DEFINE_UNQUOTED([GST_PKG_VERSION_S], ["$GST_PKG_VERSION"],
230 [Defined to the string representation of GStreamer API version])
232 if test "$GST_API_VERSION" = "1.2"; then
233 AC_MSG_WARN([support for GStreamer 1.2 is obsolete, and will be removed])
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 PKG_CHECK_MODULES([GST_CODEC_PARSERS],
266 [gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED])
268 dnl ... MPEG-2 parser, with the required extensions
269 HAVE_GST_MPEG2_PARSER=0
270 AC_CACHE_CHECK([for MPEG-2 parser],
271 ac_cv_have_gst_mpeg2_parser, [
272 saved_CPPFLAGS="$CPPFLAGS"
273 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
275 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
278 [[#include <gst/codecparsers/gstmpegvideoparser.h>]],
279 [[GstMpegVideoSequenceHdr seq_hdr;
280 GstMpegVideoSequenceExt seq_ext;
281 GstMpegVideoSequenceDisplayExt seq_dpy;
282 GstMpegVideoSliceHdr slice_hdr;
283 GstMpegVideoPacket packet;
284 gst_mpeg_video_packet_parse_slice_header(&packet, &slice_hdr,
286 gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr,
287 &seq_ext, &seq_dpy);]])],
288 [ac_cv_have_gst_mpeg2_parser="yes" HAVE_GST_MPEG2_PARSER=1],
289 [ac_cv_have_gst_mpeg2_parser="no"]
291 CPPFLAGS="$saved_CPPFLAGS"
295 dnl ... H.264 parser, with the required extensions
296 HAVE_GST_H264_PARSER=0
297 AC_CACHE_CHECK([for H.264 parser],
298 ac_cv_have_gst_h264_parser, [
299 saved_CPPFLAGS="$CPPFLAGS"
300 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
302 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
305 [[#include <gst/codecparsers/gsth264parser.h>]],
306 [[GstH264SliceHdr slice_hdr;
307 GstH264VUIParams vui_params;
308 GstH264Profile profile = GST_H264_PROFILE_HIGH;
309 slice_hdr.n_emulation_prevention_bytes = 0;
310 vui_params.par_n = 0;
311 vui_params.par_d = 0;
313 sps.extension.mvc.num_views_minus1 = 1;
315 nalu.extension_type = GST_H264_NAL_EXTENSION_MVC;]])],
316 [ac_cv_have_gst_h264_parser="yes" HAVE_GST_H264_PARSER=1],
317 [ac_cv_have_gst_h264_parser="no"]
319 CPPFLAGS="$saved_CPPFLAGS"
324 HAVE_GST_JPEG_PARSER=0
325 AC_CACHE_CHECK([for JPEG parser],
326 ac_cv_have_gst_jpeg_parser, [
327 saved_CPPFLAGS="$CPPFLAGS"
328 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
330 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
333 [[#include <gst/codecparsers/gstjpegparser.h>]],
334 [[GstJpegFrameHdr frame_hdr;]])],
335 [ac_cv_have_gst_jpeg_parser="yes" HAVE_GST_JPEG_PARSER=1],
336 [ac_cv_have_gst_jpeg_parser="no"]
338 CPPFLAGS="$saved_CPPFLAGS"
343 HAVE_GST_VP8_PARSER=0
344 AC_CACHE_CHECK([for VP8 parser],
345 ac_cv_have_gst_vp8_parser, [
346 saved_CPPFLAGS="$CPPFLAGS"
347 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
349 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
352 [[#include <gst/codecparsers/gstvp8parser.h>]],
353 [[GstVp8FrameHdr frame_hdr;]])],
354 [ac_cv_have_gst_vp8_parser="yes" HAVE_GST_VP8_PARSER=1],
355 [ac_cv_have_gst_vp8_parser="no"]
357 CPPFLAGS="$saved_CPPFLAGS"
361 dnl ... VP9 parser, with required extensions
362 HAVE_GST_VP9_PARSER=0
363 AC_CACHE_CHECK([for VP9 parser],
364 ac_cv_have_gst_vp9_parser, [
365 saved_CPPFLAGS="$CPPFLAGS"
366 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
368 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
371 [[#include <gst/codecparsers/gstvp9parser.h>]],
372 [[GstVp9FrameHdr frame_hdr;]])],
373 [ac_cv_have_gst_vp9_parser="yes" HAVE_GST_VP9_PARSER=1],
374 [ac_cv_have_gst_vp9_parser="no"]
376 CPPFLAGS="$saved_CPPFLAGS"
380 dnl ... H.265 parser, with the required extensions
381 HAVE_GST_H265_PARSER=0
382 AC_CACHE_CHECK([for H.265 parser],
383 ac_cv_have_gst_h265_parser, [
384 saved_CPPFLAGS="$CPPFLAGS"
385 CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
387 LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
390 [[#include <gst/codecparsers/gsth265parser.h>]],
391 [[GstH265SliceHdr slice_hdr;
392 GstH265VUIParams vui_params;
393 GstH265Profile profile = GST_H265_PROFILE_MAIN_STILL_PICTURE;
394 slice_hdr.n_emulation_prevention_bytes = 0;
395 vui_params.par_n = 0;
396 vui_params.par_d = 0;
399 sps.crop_rect_width = 0;]])],
400 [ac_cv_have_gst_h265_parser="yes" HAVE_GST_H265_PARSER=1],
401 [ac_cv_have_gst_h265_parser="no"]
403 CPPFLAGS="$saved_CPPFLAGS"
407 dnl ... opengl helper libraries
409 if test "$enable_glx" = "yes" -o "$enable_egl" = "yes"; then
410 PKG_CHECK_MODULES([GST_GL],
411 [gstreamer-gl-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED],
412 [HAVE_GSTGL=1], [HAVE_GSTGL=0])
415 if test $HAVE_GSTGL -eq 1; then
416 AC_CACHE_CHECK([for GStreamer OpenGL helper libraries],
417 [ac_cv_have_gst_gl_helpers], [
418 saved_CPPFLAGS="$CPPFLAGS"
419 CPPFLAGS="$CPPFLAGS $GST_GL_CFLAGS $GST_VIDEO_CFLAGS"
422 AC_CHECK_HEADERS([gst/gl/gl.h], [:], [HAVE_GSTGL=0])
425 [[#include <gst/gl/gl.h>]],
426 [[GstGLContext gl_context;]])],
427 [ac_cv_have_gst_gl_helpers="yes"],
428 [ac_cv_have_gst_gl_helpers="no" HAVE_GSTGL=0]
430 CPPFLAGS="$saved_CPPFLAGS"
434 AM_CONDITIONAL([USE_GST_GL_HELPERS], [test $HAVE_GSTGL -eq 1])
436 AC_DEFINE_UNQUOTED([USE_GST_GL_HELPERS], [$HAVE_GSTGL],
437 [Defined to 1 if GStreamer OpenGL helper libraries are available])
439 if test "$enable_egl" = "yes" -a $HAVE_GSTGL -ne 1; then
440 AC_MSG_WARN([GStreamer/GL helper libraries not found, disabling EGL support])
444 case $GST_API_VERSION in
445 1.2) lt_bias=gst2_vaapi_lt_current_bias;;
446 1.4) lt_bias=gst4_vaapi_lt_current_bias;;
447 1.[[5-6]]) lt_bias=gst6_vaapi_lt_current_bias;;
448 1.[[7-8]]) lt_bias=gst8_vaapi_lt_current_bias;;
450 GST_VAAPI_MAJOR_VERSION=`expr gst_vaapi_lt_current - "$lt_bias"`
451 AC_SUBST(GST_VAAPI_MAJOR_VERSION)
453 AC_DEFINE_UNQUOTED([GST_VAAPI_MAJOR_VERSION_S], ["$GST_VAAPI_MAJOR_VERSION"],
454 [Defined to the string representation of gstreamer-vaapi major version])
456 dnl GST_VAAPI_LT_LDFLAGS:
457 GST_VAAPI_LT_CURRENT="$GST_VAAPI_MAJOR_VERSION"
458 GST_VAAPI_LT_REV=gst_vaapi_lt_revision
459 GST_VAAPI_LT_AGE=gst_vaapi_lt_age
460 GST_VAAPI_LT_VERSION="$GST_VAAPI_LT_CURRENT:$GST_VAAPI_LT_REV:$GST_VAAPI_LT_AGE"
461 GST_VAAPI_LT_LDFLAGS="-version-info $GST_VAAPI_LT_VERSION"
462 AC_SUBST(GST_VAAPI_LT_VERSION)
463 AC_SUBST(GST_VAAPI_LT_LDFLAGS)
466 dnl LDFLAGS 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_ALL_LDFLAGS="-no-undefined"
469 AC_SUBST(GST_ALL_LDFLAGS)
471 dnl GST_PLUGIN_LDFLAGS:
472 dnl this really should only contain flags, not libs - they get added before
473 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
474 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plugin_desc|gst_.*_get_type)\$\$' $GST_ALL_LDFLAGS"
475 AC_SUBST(GST_PLUGIN_LDFLAGS)
477 dnl Check for the GStreamer plugins directory
478 AC_ARG_VAR([GST_PLUGIN_PATH_1_0], [installation path for gstreamer-vaapi plugin elements for GStreamer 1.0])
479 AC_MSG_CHECKING([for GStreamer plugins directory])
480 if test -n "$GST_PLUGIN_PATH_1_0"; then
481 GST_PLUGINS_DIR="$GST_PLUGIN_PATH_1_0"
483 GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_PKG_VERSION --variable pluginsdir`
484 if test -z "$GST_PLUGINS_DIR"; then
485 GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_PKG_VERSION"
488 AC_MSG_RESULT([$GST_PLUGINS_DIR])
489 plugindir="$GST_PLUGINS_DIR"
492 dnl ---------------------------------------------------------------------------
494 dnl ---------------------------------------------------------------------------
496 dnl Check for DRM/libudev
498 if test "$enable_drm" = "yes"; then
499 PKG_CHECK_MODULES(DRM, [libdrm], [USE_DRM=1], [USE_DRM=0])
500 PKG_CHECK_MODULES(UDEV, [libudev], [:], [USE_DRM=0])
502 if test $USE_DRM -eq 1; then
503 saved_CPPFLAGS="$CPPFLAGS"
504 CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
505 AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM=0])
506 CPPFLAGS="$saved_CPPFLAGS"
512 if test "$enable_x11" = "yes"; then
513 PKG_CHECK_MODULES(X11, [x11], [USE_X11=1], [USE_X11=0])
514 if test $USE_X11 -eq 1; then
515 saved_CPPFLAGS="$CPPFLAGS"
516 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
517 AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/Xatom.h], [:], [USE_X11=0])
518 CPPFLAGS="$saved_CPPFLAGS"
522 dnl Check for XKB library
524 if test $USE_X11 -eq 1; then
525 AC_CHECK_HEADERS([X11/XKBlib.h], [HAVE_XKBLIB=1], [:])
527 if test $HAVE_XKBLIB -eq 1; then
528 AC_DEFINE_UNQUOTED([HAVE_XKBLIB], 1,
529 [Defined to 1 if the XKB extension exists.])
534 if test $USE_X11 -eq 1; then
536 PKG_CHECK_MODULES([XRANDR], [xrandr], [:], [HAVE_XRANDR=0])
537 if test $HAVE_XRANDR -eq 1; then
538 saved_CPPFLAGS="$CPPFLAGS"
539 CPPFLAGS="$CPPFLAGS $XRANDR_CFLAGS"
540 AC_CHECK_HEADERS([X11/extensions/Xrandr.h], [:], [HAVE_XRANDR=0])
541 CPPFLAGS="$saved_CPPFLAGS"
544 if test $HAVE_XRANDR -eq 1; then
545 AC_DEFINE_UNQUOTED(HAVE_XRANDR, 1,
546 [Defined to 1 if the XRandR extension exists.])
549 dnl Check for XRender
551 if test $USE_X11 -eq 1; then
553 PKG_CHECK_MODULES([XRENDER], [xrender], [:], [HAVE_XRENDER=0])
554 if test $HAVE_XRENDER -eq 1; then
555 saved_CPPFLAGS="$CPPFLAGS"
556 CPPFLAGS="$CPPFLAGS $XRENDER_CFLAGS"
557 AC_CHECK_HEADERS([X11/extensions/Xrender.h], [:], [HAVE_XRENDER=0])
558 CPPFLAGS="$saved_CPPFLAGS"
561 if test $HAVE_XRENDER -eq 1; then
562 AC_DEFINE_UNQUOTED([HAVE_XRENDER], [1],
563 [Defined to 1 if the XRender extension exists.])
568 if test "$enable_glx" = "yes"; then
571 if test "$enable_egl" = "yes"; then
577 if test "$enable_opengl" = "yes"; then
581 PKG_CHECK_MODULES([GL], [gl], [:], [HAVE_GL=0])
582 saved_CPPFLAGS="$CPPFLAGS"
583 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
584 AC_CHECK_HEADERS([GL/gl.h GL/glext.h], [:], [HAVE_GL=0], [
589 CPPFLAGS="$saved_CPPFLAGS"
593 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GL "*" 1`
597 if test "$enable_opengl" = "yes"; then
601 PKG_CHECK_MODULES([GLES2], [glesv2], [:], [HAVE_GLESv2=0])
602 saved_CPPFLAGS="$CPPFLAGS"
603 CPPFLAGS="$CPPFLAGS $GLES2_CFLAGS"
604 AC_CHECK_HEADERS([GLES2/gl2.h GLES2/gl2ext.h], [:],
606 #ifdef HAVE_GLES2_GL2_H
607 # include <GLES2/gl2.h>
610 CPPFLAGS="$saved_CPPFLAGS"
614 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv2 "*" 4`
618 if test "$enable_opengl" = "yes"; then
622 PKG_CHECK_MODULES([GLES3], [glesv2], [:], [HAVE_GLESv3=0])
623 saved_CPPFLAGS="$CPPFLAGS"
624 CPPFLAGS="$CPPFLAGS $GLES3_CFLAGS"
625 AC_CHECK_HEADERS([GLES3/gl3.h GLES3/gl3ext.h GLES2/gl2ext.h], [:],
627 #ifdef HAVE_GLES3_GL3_H
628 # include <GLES3/gl3.h>
631 CPPFLAGS="$saved_CPPFLAGS"
635 GLES_VERSION_MASK=`expr $GLES_VERSION_MASK "+" $HAVE_GLESv3 "*" 8`
639 if test "$enable_glx" = "yes" -a $HAVE_GL -eq 1 -a $USE_X11 -eq 1; then
641 saved_CPPFLAGS="$CPPFLAGS"
643 CPPFLAGS="$CPPFLAGS $GL_CFLAGS"
644 LIBS="$LIBS $GL_LIBS"
645 AC_CHECK_HEADERS([GL/glx.h], [:], [USE_GLX=0], [
650 AC_CHECK_LIB([GL], [glXCreateContext], [:], [USE_GLX=0])
651 CPPFLAGS="$saved_CPPFLAGS"
657 if test "$enable_egl" = "yes" -a $GLES_VERSION_MASK -ne 0; then
659 PKG_CHECK_MODULES([EGL], [egl], [:], [USE_EGL=0])
660 saved_CPPFLAGS="$CPPFLAGS"
662 AC_CHECK_HEADERS([EGL/egl.h], [:], [USE_EGL=0])
663 AC_CHECK_LIB([EGL], [eglGetDisplay], [:], [USE_EGL=0])
664 CPPFLAGS="$saved_CPPFLAGS"
667 dnl Check for GMODULE
668 GMODULE_VERSION_REQUIRED=gmodule_version
669 PKG_CHECK_MODULES([GMODULE], [gmodule-2.0 >= $GMODULE_VERSION_REQUIRED])
670 AC_SUBST(GMODULE_VERSION_REQUIRED)
673 dnl Check for Wayland
675 if test "$enable_wayland" = "yes"; then
676 PKG_CHECK_MODULES(WAYLAND, [wayland-client >= wayland_api_version],
677 [USE_WAYLAND=1], [USE_WAYLAND=0])
679 if test $USE_WAYLAND -eq 1; then
680 saved_CPPFLAGS="$CPPFLAGS"
681 CPPFLAGS="$CPPFLAGS $WAYLAND_CFLAGS"
682 AC_CHECK_HEADERS([wayland-client.h], [:], [USE_WAYLAND=0])
683 CPPFLAGS="$saved_CPPFLAGS"
687 dnl ---------------------------------------------------------------------------
689 dnl ---------------------------------------------------------------------------
692 LIBVA_PKGNAME="libva"
693 PKG_CHECK_MODULES(LIBVA, [$LIBVA_PKGNAME >= va_api_version])
694 AC_SUBST(LIBVA_PKGNAME)
696 VA_VERSION=`$PKG_CONFIG --modversion libva`
697 VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
698 VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
699 VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
700 VA_VERSION_STR="$VA_VERSION"
704 if test $USE_DRM -eq 1; then
705 PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= va_api_drm_version],
706 [HAVE_VA_DRM=1], [USE_DRM=0])
708 if test $HAVE_VA_DRM -eq 1; then
709 saved_CPPFLAGS="$CPPFLAGS"
710 CPPFLAGS="$LIBVA_DRM_CFLAGS"
711 AC_CHECK_HEADERS([va/va_drm.h], [:], [HAVE_VA_DRM=0 USE_DRM=0])
712 CPPFLAGS="$saved_CPPFLAGS"
718 LIBVA_X11_PKGNAME="libva-x11"
719 if test $USE_X11 -eq 1; then
720 PKG_CHECK_MODULES(LIBVA_X11, [$LIBVA_X11_PKGNAME >= va_api_x11_version],
721 [HAVE_VA_X11=1], [USE_X11=0])
723 AC_SUBST(LIBVA_X11_PKGNAME)
725 dnl Check for va_dec_jpeg.h header
726 saved_CPPFLAGS="$CPPFLAGS"
727 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
728 AC_CHECK_HEADERS([va/va_dec_jpeg.h], [], [], [#include <va/va.h>])
729 CPPFLAGS="$saved_CPPFLAGS"
731 dnl Check for JPEG decoding API (0.32.1+)
733 AC_CACHE_CHECK([for JPEG decoding API],
734 ac_cv_have_jpeg_decoding_api, [
735 saved_CPPFLAGS="$CPPFLAGS"
736 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
738 LIBS="$LIBS $LIBVA_LIBS"
742 #ifdef HAVE_VA_VA_DEC_JPEG_H
743 #include <va/va_dec_jpeg.h>
746 [[VAPictureParameterBufferJPEGBaseline pic_param;
747 VASliceParameterBufferJPEGBaseline slice_param;
748 VAHuffmanTableBufferJPEGBaseline huffman_table;
749 VAIQMatrixBufferJPEGBaseline iq_matrix;]])],
750 [ac_cv_have_jpeg_decoding_api="yes" USE_JPEG_DECODER=$HAVE_GST_JPEG_PARSER],
751 [ac_cv_have_jpeg_decoding_api="no"]
753 CPPFLAGS="$saved_CPPFLAGS"
757 dnl Check for va_dec_vp8.h header
758 saved_CPPFLAGS="$CPPFLAGS"
759 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
760 AC_CHECK_HEADERS([va/va_dec_vp8.h], [], [], [#include <va/va.h>])
761 CPPFLAGS="$saved_CPPFLAGS"
763 dnl Check for VP8 decoding API (0.34+)
765 AC_CACHE_CHECK([for VP8 decoding API],
766 ac_cv_have_vp8_decoding_api, [
767 saved_CPPFLAGS="$CPPFLAGS"
768 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
770 LIBS="$LIBS $LIBVA_LIBS"
774 #ifdef HAVE_VA_VA_DEC_VP8_H
775 #include <va/va_dec_vp8.h>
778 [[VAPictureParameterBufferVP8 pic_param;
779 VASliceParameterBufferVP8 slice_param;
780 VAProbabilityDataBufferVP8 prob_data;
781 VAIQMatrixBufferVP8 iq_matrix;
782 slice_param.slice_data_offset = 0;
783 slice_param.slice_data_flag = 0;]])],
784 [ac_cv_have_vp8_decoding_api="yes" USE_VP8_DECODER=$HAVE_GST_VP8_PARSER],
785 [ac_cv_have_vp8_decoding_api="no"]
787 CPPFLAGS="$saved_CPPFLAGS"
791 dnl Check for va_dec_vp9.h header
792 saved_CPPFLAGS="$CPPFLAGS"
793 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
794 AC_CHECK_HEADERS([va/va_dec_vp9.h], [], [], [#include <va/va.h>])
795 CPPFLAGS="$saved_CPPFLAGS"
797 dnl Check for VP9 decoding API (0.37+)
799 AC_CACHE_CHECK([for VP9 decoding API],
800 ac_cv_have_vp9_decoding_api, [
801 saved_CPPFLAGS="$CPPFLAGS"
802 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
804 LIBS="$LIBS $LIBVA_LIBS"
808 #ifdef HAVE_VA_VA_DEC_VP9_H
809 #include <va/va_dec_vp9.h>
812 [[VADecPictureParameterBufferVP9 pic_param;
813 VASliceParameterBufferVP9 slice_param;
814 VASegmentParameterVP9 seg_param;
815 slice_param.slice_data_offset = 0;
816 slice_param.slice_data_flag = 0;]])],
817 [ac_cv_have_vp9_decoding_api="yes" USE_VP9_DECODER=$HAVE_GST_VP9_PARSER],
818 [ac_cv_have_vp9_decoding_api="no"]
820 CPPFLAGS="$saved_CPPFLAGS"
824 dnl Check for va_dec_hevc.h header
825 saved_CPPFLAGS="$CPPFLAGS"
826 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
827 AC_CHECK_HEADERS([va/va_dec_hevc.h], [], [], [#include <va/va.h>])
828 CPPFLAGS="$saved_CPPFLAGS"
830 dnl Check for HEVC decoding API (0.38+)
832 AC_CACHE_CHECK([for HEVC decoding API],
833 ac_cv_have_hevc_decoding_api, [
834 saved_CPPFLAGS="$CPPFLAGS"
835 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
837 LIBS="$LIBS $LIBVA_LIBS"
841 #ifdef HAVE_VA_VA_DEC_HEVC_H
842 #include <va/va_dec_hevc.h>
845 [[VAPictureParameterBufferHEVC pic_param;
846 VASliceParameterBufferHEVC slice_param;
847 VAIQMatrixBufferHEVC iq_matrix;
848 slice_param.slice_data_offset = 0;
849 slice_param.slice_data_flag = 0;]])],
850 [ac_cv_have_hevc_decoding_api="yes" USE_HEVC_DECODER=$HAVE_GST_H265_PARSER],
851 [ac_cv_have_hevc_decoding_api="no"]
853 CPPFLAGS="$saved_CPPFLAGS"
857 dnl Check for vpp (video post-processing) support
859 AC_CACHE_CHECK([for video post-postprocessing API],
860 ac_cv_have_va_vpp_api, [
861 saved_CPPFLAGS="$CPPFLAGS"
862 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
864 LIBS="$LIBS $LIBVA_LIBS"
868 #include <va/va_vpp.h>]],
871 VAProcFilterType filters[VAProcFilterCount];
872 unsigned int num_filters = VAProcFilterCount;
873 vaQueryVideoProcFilters(va_dpy, vpp_ctx, filters, &num_filters);
875 [ac_cv_have_va_vpp_api="yes" USE_VA_VPP=1],
876 [ac_cv_have_va_vpp_api="no"]
878 CPPFLAGS="$saved_CPPFLAGS"
882 dnl Check for encoding support
887 if test "$enable_encoders" = "yes"; then
888 PKG_CHECK_MODULES([LIBVA], [libva >= va_api_enc_version],
889 [HAVE_VA_ENC=1], [HAVE_VA_ENC=0])
891 if test $HAVE_VA_ENC -eq 1; then
892 saved_CPPFLAGS="$CPPFLAGS"
893 CPPFLAGS="$LIBVA_CFLAGS"
894 AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h],
895 [USE_ENCODERS=1], [HAVE_VA_ENC=0 USE_ENCODERS=0],
899 dnl Check for JPEG Encoding API (0.37.0+)
900 AC_CHECK_HEADERS([va/va_enc_jpeg.h],
901 [USE_JPEG_ENCODER=1], [],
904 AC_CACHE_CHECK([for JPEG encoding API],
905 ac_cv_have_jpeg_encoding_api, [
906 saved_CPPFLAGS="$CPPFLAGS"
907 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
909 LIBS="$LIBS $LIBVA_LIBS"
913 #ifdef HAVE_VA_VA_ENC_JPEG_H
914 #include <va/va_enc_jpeg.h>
917 [[VAEncPictureParameterBufferJPEG pic_param;
918 VAEncSliceParameterBufferJPEG slice_param;
919 VAQMatrixBufferJPEG q_matrix;]])],
920 [ac_cv_have_jpeg_encoding_api="yes" USE_JPEG_ENCODER=1],
921 [ac_cv_have_jpeg_encoding_api="no"]
923 CPPFLAGS="$saved_CPPFLAGS"
927 dnl Check for VP8 Encoding API
928 AC_CHECK_HEADERS([va/va_enc_vp8.h],
929 [USE_VP8_ENCODER=1], [],
932 AC_CACHE_CHECK([for VP8 encoding API],
933 ac_cv_have_vp8_encoding_api, [
934 saved_CPPFLAGS="$CPPFLAGS"
935 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
937 LIBS="$LIBS $LIBVA_LIBS"
941 #ifdef HAVE_VA_VA_ENC_VP8_H
942 #include <va/va_enc_vp8.h>
945 [[VAEncSequenceParameterBufferVP8 seq_param;
946 VAEncPictureParameterBufferVP8 pic_param;
947 VAQMatrixBufferVP8 q_matrix;]])],
948 [ac_cv_have_vp8_encoding_api="yes" USE_VP8_ENCODER=1],
949 [ac_cv_have_vp8_encoding_api="no" USE_VP8_ENCODER=0]
951 CPPFLAGS="$saved_CPPFLAGS"
954 CPPFLAGS="$saved_CPPFLAGS"
956 dnl Check for H265/HEVC Encoding API
957 AC_CHECK_HEADERS([va/va_enc_hevc.h],
958 [USE_H265_ENCODER=1], [],
961 AC_CACHE_CHECK([for HEVC encoding API],
962 ac_cv_have_hevc_encoding_api, [
963 saved_CPPFLAGS="$CPPFLAGS"
964 CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
966 LIBS="$LIBS $LIBVA_LIBS"
970 #ifdef HAVE_VA_VA_ENC_HEVC_H
971 #include <va/va_enc_hevc.h>
974 [[VAEncSequenceParameterBufferHEVC seq_param;
975 VAEncPictureParameterBufferHEVC pic_param;
976 VAEncSliceParameterBufferHEVC;
977 VAQMatrixBufferHEVC q_matrix;]])],
978 [ac_cv_have_hevc_encoding_api="yes" USE_H265_ENCODER=1],
979 [ac_cv_have_hevc_encoding_api="no" USE_H265_ENCODER=0]
981 CPPFLAGS="$saved_CPPFLAGS"
984 CPPFLAGS="$saved_CPPFLAGS"
989 if test "$enable_wayland" = "yes"; then
990 PKG_CHECK_MODULES([LIBVA_WAYLAND], [libva-wayland >= va_api_wld_version],
991 [:], [USE_WAYLAND=0])
994 dnl ---------------------------------------------------------------------------
995 dnl -- Generate files and summary --
996 dnl ---------------------------------------------------------------------------
998 case ":$USE_X11:$USE_GLX:$USE_EGL:$USE_WAYLAND:$USE_DRM:" in
1002 AC_MSG_ERROR([No renderer is enabled])
1006 AC_DEFINE_UNQUOTED([USE_ENCODERS], $USE_ENCODERS,
1007 [Defined to 1 if video encoders are used])
1008 AM_CONDITIONAL([USE_ENCODERS], [test $USE_ENCODERS -eq 1])
1010 AC_DEFINE_UNQUOTED(USE_JPEG_ENCODER, $USE_JPEG_ENCODER,
1011 [Defined to 1 if JPEG encoder is used])
1012 AM_CONDITIONAL(USE_JPEG_ENCODER, test $USE_JPEG_ENCODER -eq 1)
1014 AC_DEFINE_UNQUOTED(USE_VP8_ENCODER, $USE_VP8_ENCODER,
1015 [Defined to 1 if VP8 encoder is used])
1016 AM_CONDITIONAL(USE_VP8_ENCODER, test $USE_VP8_ENCODER -eq 1)
1018 AC_DEFINE_UNQUOTED(USE_H265_ENCODER, $USE_H265_ENCODER,
1019 [Defined to 1 if H265 encoder is used])
1020 AM_CONDITIONAL(USE_H265_ENCODER, test $USE_H265_ENCODER -eq 1)
1022 AC_DEFINE_UNQUOTED(USE_VA_VPP, $USE_VA_VPP,
1023 [Defined to 1 if video post-processing is used])
1024 AM_CONDITIONAL(USE_VA_VPP, test $USE_VA_VPP -eq 1)
1026 AC_DEFINE_UNQUOTED(USE_JPEG_DECODER, $USE_JPEG_DECODER,
1027 [Defined to 1 if JPEG decoder is used])
1028 AM_CONDITIONAL(USE_JPEG_DECODER, test $USE_JPEG_DECODER -eq 1)
1030 AC_DEFINE_UNQUOTED(USE_VP8_DECODER, $USE_VP8_DECODER,
1031 [Defined to 1 if VP8 decoder is used])
1032 AM_CONDITIONAL(USE_VP8_DECODER, test $USE_VP8_DECODER -eq 1)
1034 AC_DEFINE_UNQUOTED(USE_VP9_DECODER, $USE_VP9_DECODER,
1035 [Defined to 1 if VP9 decoder is used])
1036 AM_CONDITIONAL(USE_VP9_DECODER, test $USE_VP9_DECODER -eq 1)
1038 AC_DEFINE_UNQUOTED(USE_HEVC_DECODER, $USE_HEVC_DECODER,
1039 [Defined to 1 if HEVC decoder is used])
1040 AM_CONDITIONAL(USE_HEVC_DECODER, test $USE_HEVC_DECODER -eq 1)
1042 AC_DEFINE_UNQUOTED(USE_DRM, $USE_DRM,
1043 [Defined to 1 if DRM is enabled])
1044 AM_CONDITIONAL(USE_DRM, test $USE_DRM -eq 1)
1046 AC_DEFINE_UNQUOTED(USE_X11, $USE_X11,
1047 [Defined to 1 if X11 is enabled])
1048 AM_CONDITIONAL(USE_X11, test $USE_X11 -eq 1)
1050 AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
1051 [Defined to 1 if GLX is enabled])
1052 AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
1054 AC_DEFINE_UNQUOTED([USE_EGL], [$USE_EGL],
1055 [Defined to 1 if EGL is enabled])
1056 AM_CONDITIONAL([USE_EGL], [test $USE_EGL -eq 1])
1058 AC_DEFINE_UNQUOTED([USE_GLES_VERSION_MASK], [$GLES_VERSION_MASK],
1059 [Defined to the set of enabled OpenGL ES APIs])
1061 AC_DEFINE_UNQUOTED(USE_WAYLAND, $USE_WAYLAND,
1062 [Defined to 1 if WAYLAND is enabled])
1063 AM_CONDITIONAL(USE_WAYLAND, test $USE_WAYLAND -eq 1)
1065 pkgconfigdir=${libdir}/pkgconfig
1066 AC_SUBST(pkgconfigdir)
1071 docs/reference/Makefile
1072 docs/reference/libs/Makefile
1073 docs/reference/libs/libs-docs.xml
1074 docs/reference/plugins/Makefile
1075 docs/reference/plugins/plugins-docs.xml
1077 gst-libs/gst/Makefile
1078 gst-libs/gst/base/Makefile
1079 gst-libs/gst/vaapi/Makefile
1088 test $1 -eq 1 && echo yes || echo no
1092 AS_IF([test $USE_DRM -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS drm"])
1093 AS_IF([test $USE_X11 -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS x11"])
1094 AS_IF([test $USE_GLX -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS glx"])
1095 AS_IF([test $USE_EGL -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS egl"])
1096 AS_IF([test $USE_WAYLAND -eq 1], [VIDEO_OUTPUTS="$VIDEO_OUTPUTS wayland"])
1099 echo $PACKAGE configuration summary:
1101 echo Installation Prefix .............. : ${prefix}
1102 echo GStreamer API version ............ : $GST_API_VERSION
1103 echo VA-API version ................... : $VA_VERSION_STR
1104 echo Video encoding ................... : $(yesno $USE_ENCODERS)
1105 echo Video outputs .................... : $VIDEO_OUTPUTS