@@ -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"
+#endif
+
#if CONFIG_VAAPI_1
# define VA_ABI ".2"
#else
@@ -68,8 +72,10 @@ typedef struct VAAPIDevicePriv {
Display *x11_display;
#endif
+#if HAVE_VAAPI_DRM
void *libva_drm;
int drm_fd;
+#endif
} VAAPIDevicePriv;
typedef struct VAAPISurfaceFormat {
@@ -1583,10 +1589,12 @@ static void vaapi_device_free(AVHWDeviceContext *ctx)
XCloseDisplay(priv->x11_display);
#endif
+#if HAVE_VAAPI_DRM
if (priv->drm_fd >= 0)
close(priv->drm_fd);
if (priv->libva_drm)
dlclose(priv->libva_drm);
+#endif
av_freep(&priv);
}
@@ -1645,7 +1653,9 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
if (!priv)
return AVERROR(ENOMEM);
+#if HAVE_VAAPI_DRM
priv->drm_fd = -1;
+#endif
ctx->user_opaque = priv;
ctx->free = vaapi_device_free;