forked from marfrit/libva-v4l2-request-fourier
Remove X11 support with vaPutSurface
Using VAAPI as a video output (through vaPutSurface) is deprecated and definitely not recommended for any use case. Since we're starting to support non-X11 pipelines, remove X11 support altogether. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
@@ -62,7 +62,6 @@ AC_SUBST(LIBDRM_VERSION)
|
|||||||
|
|
||||||
dnl Check for VA-API
|
dnl Check for VA-API
|
||||||
PKG_CHECK_MODULES(LIBVA_DEPS, [libva >= va_api_version])
|
PKG_CHECK_MODULES(LIBVA_DEPS, [libva >= va_api_version])
|
||||||
PKG_CHECK_MODULES(X11_DEPS, [x11])
|
|
||||||
|
|
||||||
dnl Check for VA/DRM API
|
dnl Check for VA/DRM API
|
||||||
PKG_CHECK_MODULES(LIBVA_DRM_DEPS, [libva-drm],
|
PKG_CHECK_MODULES(LIBVA_DRM_DEPS, [libva-drm],
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
AM_CPPFLAGS = -DPTHREADS $(X11_DEPS_CFLAGS) $(DRM_CFLAGS) $(LIBVA_DEPS_CFLAGS)
|
AM_CPPFLAGS = -DPTHREADS $(DRM_CFLAGS) $(LIBVA_DEPS_CFLAGS)
|
||||||
|
|
||||||
backend_cflags = -Wall -fvisibility=hidden
|
backend_cflags = -Wall -fvisibility=hidden
|
||||||
backend_ldflags = -module -avoid-version -no-undefined -Wl,--no-undefined
|
backend_ldflags = -module -avoid-version -no-undefined -Wl,--no-undefined
|
||||||
backend_libs = -lpthread -ldl $(DRM_LIBS) $(X11_DEPS_LIBS) $(LIBVA_DEPS_LIBS)
|
backend_libs = -lpthread -ldl $(DRM_LIBS) $(LIBVA_DEPS_LIBS)
|
||||||
|
|
||||||
backend_c = sunxi_cedrus.c object_heap.c config.c surface.c context.c buffer.c \
|
backend_c = sunxi_cedrus.c object_heap.c config.c surface.c context.c buffer.c \
|
||||||
mpeg2.c picture.c subpicture.c image.c v4l2.c media.c utils.c
|
mpeg2.c picture.c subpicture.c image.c v4l2.c media.c utils.c
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP context)
|
|||||||
vtable->vaEndPicture = SunxiCedrusEndPicture;
|
vtable->vaEndPicture = SunxiCedrusEndPicture;
|
||||||
vtable->vaSyncSurface = SunxiCedrusSyncSurface;
|
vtable->vaSyncSurface = SunxiCedrusSyncSurface;
|
||||||
vtable->vaQuerySurfaceStatus = SunxiCedrusQuerySurfaceStatus;
|
vtable->vaQuerySurfaceStatus = SunxiCedrusQuerySurfaceStatus;
|
||||||
vtable->vaPutSurface = SunxiCedrusPutSurface;
|
|
||||||
vtable->vaQueryImageFormats = SunxiCedrusQueryImageFormats;
|
vtable->vaQueryImageFormats = SunxiCedrusQueryImageFormats;
|
||||||
vtable->vaCreateImage = SunxiCedrusCreateImage;
|
vtable->vaCreateImage = SunxiCedrusCreateImage;
|
||||||
vtable->vaDeriveImage = SunxiCedrusDeriveImage;
|
vtable->vaDeriveImage = SunxiCedrusDeriveImage;
|
||||||
|
|||||||
@@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
|
|
||||||
#include "v4l2.h"
|
#include "v4l2.h"
|
||||||
#include "media.h"
|
#include "media.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@@ -225,58 +223,6 @@ VAStatus SunxiCedrusQuerySurfaceStatus(VADriverContextP context,
|
|||||||
return VA_STATUS_SUCCESS;
|
return VA_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VAStatus SunxiCedrusPutSurface(VADriverContextP context, VASurfaceID surface_id,
|
|
||||||
void *draw, short src_x, short src_y, unsigned short src_width,
|
|
||||||
unsigned short src_height, short dst_x, short dst_y,
|
|
||||||
unsigned short dst_width, unsigned short dst_height,
|
|
||||||
VARectangle *cliprects, unsigned int cliprects_count,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
struct sunxi_cedrus_driver_data *driver_data =
|
|
||||||
(struct sunxi_cedrus_driver_data *) context->pDriverData;
|
|
||||||
GC gc;
|
|
||||||
Display *display;
|
|
||||||
const XID xid = (XID)(uintptr_t)draw;
|
|
||||||
XColor xcolor;
|
|
||||||
int screen;
|
|
||||||
Colormap cm;
|
|
||||||
int colorratio = 65535 / 255;
|
|
||||||
int x, y;
|
|
||||||
struct object_surface *surface_object;
|
|
||||||
|
|
||||||
/* WARNING: This is for development purpose only!!! */
|
|
||||||
|
|
||||||
surface_object = SURFACE(surface_id);
|
|
||||||
|
|
||||||
display = XOpenDisplay(getenv("DISPLAY"));
|
|
||||||
if (display == NULL) {
|
|
||||||
sunxi_cedrus_log("Cannot connect to X server\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
sunxi_cedrus_log("warning: using vaPutSurface with sunxi-cedrus is not recommended\n");
|
|
||||||
screen = DefaultScreen(display);
|
|
||||||
gc = XCreateGC(display, RootWindow(display, screen), 0, NULL);
|
|
||||||
XSync(display, False);
|
|
||||||
|
|
||||||
cm = DefaultColormap(display, screen);
|
|
||||||
xcolor.flags = DoRed | DoGreen | DoBlue;
|
|
||||||
|
|
||||||
for(x=dst_x; x < dst_x+dst_width; x++) {
|
|
||||||
for(y=dst_y; y < dst_y+dst_height; y++) {
|
|
||||||
char lum = ((char *) surface_object->destination_data[0])[x+src_width*y];
|
|
||||||
xcolor.red = xcolor.green = xcolor.blue = lum*colorratio;
|
|
||||||
XAllocColor(display, cm, &xcolor);
|
|
||||||
XSetForeground(display, gc, xcolor.pixel);
|
|
||||||
XDrawPoint(display, xid, gc, x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
XFlush(display);
|
|
||||||
XCloseDisplay(display);
|
|
||||||
return VA_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
VAStatus SunxiCedrusLockSurface(VADriverContextP context,
|
VAStatus SunxiCedrusLockSurface(VADriverContextP context,
|
||||||
VASurfaceID surface_id, unsigned int *fourcc, unsigned int *luma_stride,
|
VASurfaceID surface_id, unsigned int *fourcc, unsigned int *luma_stride,
|
||||||
unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
|
unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
|
||||||
|
|||||||
@@ -62,12 +62,6 @@ VAStatus SunxiCedrusSyncSurface(VADriverContextP context,
|
|||||||
VASurfaceID surface_id);
|
VASurfaceID surface_id);
|
||||||
VAStatus SunxiCedrusQuerySurfaceStatus(VADriverContextP context,
|
VAStatus SunxiCedrusQuerySurfaceStatus(VADriverContextP context,
|
||||||
VASurfaceID surface_id, VASurfaceStatus *status);
|
VASurfaceID surface_id, VASurfaceStatus *status);
|
||||||
VAStatus SunxiCedrusPutSurface(VADriverContextP context, VASurfaceID surface_id,
|
|
||||||
void *draw, short src_x, short src_y, unsigned short src_width,
|
|
||||||
unsigned short src_height, short dst_x, short dst_y,
|
|
||||||
unsigned short dst_width, unsigned short dst_height,
|
|
||||||
VARectangle *cliprects, unsigned int cliprects_count,
|
|
||||||
unsigned int flags);
|
|
||||||
VAStatus SunxiCedrusLockSurface(VADriverContextP context,
|
VAStatus SunxiCedrusLockSurface(VADriverContextP context,
|
||||||
VASurfaceID surface_id, unsigned int *fourcc, unsigned int *luma_stride,
|
VASurfaceID surface_id, unsigned int *fourcc, unsigned int *luma_stride,
|
||||||
unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
|
unsigned int *chroma_u_stride, unsigned int *chroma_v_stride,
|
||||||
|
|||||||
Reference in New Issue
Block a user