diff options
| author | Anton <anton@picapica.im> | 2026-08-14 01:29:59 +0400 |
|---|---|---|
| committer | Anton <anton@picapica.im> | 2026-08-14 01:29:59 +0400 |
| commit | ad95ec8759777c4b8df0dcd66fd8200d24e912b1 (patch) | |
| tree | c5da156d51d1839abaa3ae0804ae588ea64a8cf7 /configure.ac | |
| parent | 6ef469ba767574384c0373daa5363efb95102ed9 (diff) | |
| download | pica-pica-ad95ec8759777c4b8df0dcd66fd8200d24e912b1.tar.gz pica-pica-ad95ec8759777c4b8df0dcd66fd8200d24e912b1.zip | |
pica-client: VAAPI hardware acceleration
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 70a914d..b8bcc02 100644 --- a/configure.ac +++ b/configure.ac @@ -82,8 +82,18 @@ AS_IF([test "x$enable_client" != "xno"], [ PICA_CLIENT_ENABLED=yes ]) +#checking if VAAPI hardware acceleration is wanted +#unspecified means autodetect: use it when the libraries are there, do without +#them when they are not. --enable-vaapi makes their absence a hard error, +#--disable-vaapi skips looking for them at all. +AC_ARG_ENABLE([vaapi], + AS_HELP_STRING([--enable-vaapi], + [Enable VAAPI accelerated video encoding, decoding and rendering (default: autodetect)]) + AS_HELP_STRING([--disable-vaapi], + [Disable VAAPI accelerated video encoding, decoding and rendering])) + #at least one program must be enabled -AS_IF([test "x$PICA_NODE_ENABLED" != "xyes" && test "x$PICA_CLIENT_ENABLED" != "xyes" ], +AS_IF([test "x$PICA_NODE_ENABLED" != "xyes" && test "x$PICA_CLIENT_ENABLED" != "xyes" ], AC_MSG_ERROR(["Either pica-node or pica-client must be enabled"]) ) @@ -131,7 +141,27 @@ AS_IF([test "x$OPENSSL_TOOL" != xyes],[AC_MSG_WARN(["openssl command line tool n PKG_CHECK_MODULES([FFMPEG],["libavcodec libavdevice libavformat libavutil libswresample libswscale"]) AC_SUBST([FFMPEG_CFLAGS]) AC_SUBST([FFMPEG_LIBS]) + +#check for VAAPI libraries, unless explicitly disabled +#libva is the accelerator itself, libva-drm opens it through a DRM render node, +#and EGL is what lets a decoded surface be handed to OpenGL without a copy. +AS_IF([test "x$enable_vaapi" != "xno"], [ + PKG_CHECK_MODULES([VAAPI], [libva libva-drm egl], + [ + PICA_VAAPI_ENABLED=yes + AC_DEFINE([HAVE_VAAPI], [1], [Define to 1 if VAAPI accelerated video is available]) + AC_SUBST([VAAPI_CFLAGS]) + AC_SUBST([VAAPI_LIBS]) + ], + [ + AS_IF([test "x$enable_vaapi" = "xyes"], + [AC_MSG_ERROR(["VAAPI support was requested but libva, libva-drm or EGL was not found"])], + [AC_MSG_WARN(["libva, libva-drm or EGL not found - building without VAAPI acceleration"])]) + ]) ]) +]) + +AM_CONDITIONAL([PICA_VAAPI], [test "x$PICA_VAAPI_ENABLED" = "xyes"]) AC_SUBST([PLATFORM_DEPS_CFLAGS]) AC_SUBST([PLATFORM_DEPS_LIBS]) |
