[vlc-commits] avcodec: remove vaapi_x11
Thomas Guillem
git at videolan.org
Sat Sep 2 14:13:25 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Sep 2 14:13:08 2017 +0200| [c7b1c2b30e9d9d54a3b9214e2546cdf6943f2450] | committer: Thomas Guillem
avcodec: remove vaapi_x11
Replaced by VAAPI GL interop (via X11)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c7b1c2b30e9d9d54a3b9214e2546cdf6943f2450
---
modules/codec/Makefile.am | 10 ----------
modules/codec/avcodec/vaapi.c | 42 ++++--------------------------------------
2 files changed, 4 insertions(+), 48 deletions(-)
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 91c6e257cc..89453f6204 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -380,13 +380,6 @@ libvaapi_drm_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DVLC_VA_BACKEND_DRM
libvaapi_drm_plugin_la_CFLAGS = $(AM_CFLAGS) \
$(LIBVA_DRM_CFLAGS) $(AVCODEC_CFLAGS)
libvaapi_drm_plugin_la_LIBADD = $(LIBVA_DRM_LIBS)
-libvaapi_x11_plugin_la_SOURCES = \
- codec/avcodec/vaapi.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h
-libvaapi_x11_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DVLC_VA_BACKEND_XLIB
-libvaapi_x11_plugin_la_CFLAGS = $(AM_CFLAGS) \
- $(LIBVA_X11_CFLAGS) $(X_CFLAGS) $(AVCODEC_CFLAGS)
-libvaapi_x11_plugin_la_LIBADD = $(LIBVA_X11_LIBS) $(X_LIBS) $(X_PRE_LIBS) \
- -lX11
libvaapi_dr_plugin_la_SOURCES = \
codec/avcodec/vaapi.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h
libvaapi_dr_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -DVLC_VA_BACKEND_DR
@@ -396,9 +389,6 @@ if HAVE_AVCODEC_VAAPI
if HAVE_VAAPI_DRM
codec_LTLIBRARIES += libvaapi_drm_plugin.la
endif
-if HAVE_VAAPI_X11
-codec_LTLIBRARIES += libvaapi_x11_plugin.la
-endif
codec_LTLIBRARIES += libvaapi_dr_plugin.la
endif
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 61d9c7ce47..04711ad3d4 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -34,10 +34,6 @@
#include <vlc_picture.h>
#include <vlc_picture_pool.h>
-#ifdef VLC_VA_BACKEND_XLIB
-# include <vlc_xlib.h>
-# include <va/va_x11.h>
-#endif
#ifdef VLC_VA_BACKEND_DRM
# include <sys/types.h>
# include <sys/stat.h>
@@ -57,7 +53,7 @@ struct vlc_va_sys_t
struct vlc_vaapi_instance *va_inst;
struct vaapi_context hw_ctx;
-#ifndef VLC_VA_BACKEND_DR /* XLIB or DRM */
+#ifdef VLC_VA_BACKEND_DRM
picture_pool_t *pool;
#endif
};
@@ -221,7 +217,7 @@ error:
return ret;
}
-#else /* XLIB or DRM */
+#else /* DRM */
static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
{
@@ -254,12 +250,6 @@ static void Delete(vlc_va_t *va, void **hwctx)
free(sys);
}
-#ifdef VLC_VA_BACKEND_XLIB
-static void X11NativeDestroy(VANativeDisplay native)
-{
- XCloseDisplay(native);
-}
-#endif
#ifdef VLC_VA_BACKEND_DRM
static void DRMNativeDestroy(VANativeDisplay native)
{
@@ -277,14 +267,6 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
(void) p_sys;
vlc_object_t *o = VLC_OBJECT(va);
-#ifdef VLC_VA_BACKEND_XLIB
- if (!vlc_xlib_init(o))
- {
- msg_Warn(va, "Ignoring VA-X11 API");
- return VLC_EGENERIC;
- }
-#endif
-
VAProfile i_profile;
unsigned count;
if (GetVaProfile(ctx, fmt, &i_profile, &count) != VLC_SUCCESS)
@@ -307,19 +289,7 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
/* Create a VA display */
VANativeDisplay native = NULL;
vlc_vaapi_native_destroy_cb native_destroy_cb = NULL;
-#ifdef VLC_VA_BACKEND_XLIB
- Display *p_display_x11 = XOpenDisplay(NULL);
- if (!p_display_x11)
- {
- msg_Err(va, "Could not connect to X server");
- goto error;
- }
- native = p_display_x11;
- native_destroy_cb = X11NativeDestroy;
- sys->hw_ctx.display = vaGetDisplay(p_display_x11);
-#endif
-#ifdef VLC_VA_BACKEND_DRM
int drm_fd = -1;
static const char drm_device_paths[][20] = {
"/dev/dri/renderD128",
@@ -343,7 +313,7 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
vlc_close(drm_fd);
drm_fd = -1;
}
-#endif
+
if (sys->hw_ctx.display == NULL)
{
msg_Err(va, "Could not get a VAAPI device");
@@ -404,11 +374,7 @@ error:
#endif
vlc_module_begin ()
-#if defined (VLC_VA_BACKEND_XLIB)
- set_description( N_("VA-API video decoder via X11") )
- set_capability( "hw decoder", 0 )
- set_callbacks( Create, Delete )
-#elif defined (VLC_VA_BACKEND_DRM)
+#if defined (VLC_VA_BACKEND_DRM)
set_description( N_("VA-API video decoder via DRM") )
set_capability( "hw decoder", 0 )
set_callbacks( Create, Delete )
More information about the vlc-commits
mailing list