[FFmpeg-devel] [PATCH v2 3/3] hwcontext_vaapi: #if guard VAAPI_DRM specifics

Mark Thompson sw at jkqxz.net
Fri Jul 22 00:05:05 EEST 2022


On 20/07/2022 11:56, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Similar to the VAAPI_X11 bits, guard all the VAAPI_DRM parts behind a
> compiler guard.
> 
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>   libavutil/hwcontext_vaapi.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 7734a50fc0..7aea3e7b96 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -18,6 +18,10 @@
>   
>   #include "config.h"
>   
> +#if !HAVE_VAAPI_X11 && !HAVE_VAAPI_DRM
> +#error "At least one VAAPI winsys is required X11 or DRM"

No it isn't.

Originally there wasn't a possibility to link with any winsys here - libavcodec users had to get the device themselves and pass it in.

The winsys link was added to the ffmpeg utility initially for command-line use and then moved to libavutil when it was clear that it would be useful to other library users; there isn't any requirement to use it, though.  (E.g. disable it and note that programs handling the winsys themselves like mpv and vlc still work perfectly well.)

- Mark


More information about the ffmpeg-devel mailing list