[FFmpeg-devel] [PATCH v2 1/3] hwcontext_vaapi: do not link against libva-x11.so

Emil Velikov emil.l.velikov at gmail.com
Wed Jul 20 19:23:40 EEST 2022

On Wed, 20 Jul 2022 at 11:56, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> There is an internal ABI between libva.so the libva-XXX.so libraries.
> With a recent change, the internal va_fool API was removed breaking the
> ABI. So if libva.so and libva-x11.so are from different version, the
> whole stack will crash.
> Instead we can dlopen() the libva-x11 library and gracefully error out.
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> v2: add libdl dependency
> ---
>  configure                   |  3 ++-
>  libavutil/hwcontext_vaapi.c | 34 +++++++++++++++++++++++++++++++++-
>  2 files changed, 35 insertions(+), 2 deletions(-)
> diff --git a/configure b/configure
> index 18d9b61a99..605afd58a7 100755
> --- a/configure
> +++ b/configure
> @@ -3816,7 +3816,8 @@ swscale_suggest="libm stdatomic"
>  avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs"
>  avfilter_extralibs="pthreads_extralibs"
> -avutil_extralibs="d3d11va_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs"
> +avutil_deps="libdl"

Hmm, using _deps seems to be causing issues - "libdl at $avdevice_deps
is not at $LIBRARY_LIST".
In particular, due to the direct dependency between avutil and
avdevice, libdl gets propagated into avdevice_deps and libdl where not
part of $LIBRARY_LIST.

On the other hand, if we use avutil_deps_any libdl does not end up in
avdevice_deps (is this intentional), yet it looks incorrect. We're
providing a single entry in an "any" list, where we do need the
Be that explicitly from libdl.so or implicitly from the C runtime.

Looking at all the other deps - perhaps deps_select is the best option
to use here?

Aside: Kicking off `make` after configure is changed does not trigger
[config.mak] regeneration. Is that intentional? All the other projects
that I've used do so.

Thanks in advance,

More information about the ffmpeg-devel mailing list