Commit 2c233f96 authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI-X11: using XCB abstraction to Xlib

Use XCB abstraction to Xlib for communication to X11 server. The following
additional changes were needed:

- Split modules/video_output/xcb/xcb_vlc.c in 2
	xcb_vlc.h	 - SHM and PictureResourceAlloc/PictureResourceFree
	xcb_events_vlc.h - matches implementation of modules/video_output/xcb/events.c
parent 5a7f4600
...@@ -9,7 +9,7 @@ libavcodec_plugin_la_SOURCES = \ ...@@ -9,7 +9,7 @@ libavcodec_plugin_la_SOURCES = \
fourcc.c \ fourcc.c \
chroma.h \ chroma.h \
chroma.c \ chroma.c \
vaapi.h \ vaapi.h \
vaapi.c \ vaapi.c \
vaapi_x11.c \ vaapi_x11.c \
dxva2.c \ dxva2.c \
...@@ -17,6 +17,8 @@ libavcodec_plugin_la_SOURCES = \ ...@@ -17,6 +17,8 @@ libavcodec_plugin_la_SOURCES = \
copy.h \ copy.h \
va.c \ va.c \
va.h \ va.h \
../../video_output/xcb/events.c \
../../video_output/xcb/xcb_events_vlc.h \
$(NULL) $(NULL)
if ENABLE_SOUT if ENABLE_SOUT
libavcodec_plugin_la_SOURCES += \ libavcodec_plugin_la_SOURCES += \
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "avcodec.h" #include "avcodec.h"
#include "copy.h" #include "copy.h"
#include <xcb/xcb.h>
#include <X11/Xlib-xcb.h>
#include <vlc_xlib.h> #include <vlc_xlib.h>
#include <libavcodec/vaapi.h> #include <libavcodec/vaapi.h>
#include <va/va.h> #include <va/va.h>
...@@ -58,6 +60,8 @@ ...@@ -58,6 +60,8 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include "../../video_output/xcb/xcb_events_vlc.h"
/* define for extra debugging */ /* define for extra debugging */
#undef VAAPI_DEBUG #undef VAAPI_DEBUG
...@@ -90,17 +94,18 @@ struct vout_display_sys_t ...@@ -90,17 +94,18 @@ struct vout_display_sys_t
vlc_mutex_t cache_lock; vlc_mutex_t cache_lock;
vlc_array_t cache; /* array of subpicture_subpicture_cache_t */ vlc_array_t cache; /* array of subpicture_subpicture_cache_t */
xcb_cursor_t cursor; /* blank cursor */
xcb_window_t window; /* drawable X window */
unsigned int i_display_order; unsigned int i_display_order;
bool visible; /* whether to draw */ bool visible; /* whether to draw */
/* */
Window window;
}; };
static picture_pool_t *Pool (vout_display_t *, unsigned); static picture_pool_t *Pool (vout_display_t *, unsigned);
static void Render (vout_display_t *, picture_t *, subpicture_t *); static void Render (vout_display_t *, picture_t *, subpicture_t *);
static void DisplayPicture (vout_display_t *, picture_t *, subpicture_t *); static void DisplayPicture (vout_display_t *, picture_t *, subpicture_t *);
static int Control (vout_display_t *, int, va_list); static int Control (vout_display_t *, int, va_list);
static void Manage (vout_display_t *);
/* cache management */ /* cache management */
static unsigned int cache_counter = 0; static unsigned int cache_counter = 0;
...@@ -308,27 +313,16 @@ error: ...@@ -308,27 +313,16 @@ error:
return VLC_EGENERIC; return VLC_EGENERIC;
} }
static vout_window_t *MakeWindow (vout_display_t *vd) static vout_window_t *MakeWindow(vout_display_t *vd)
{ {
vout_display_sys_t *sys = (vout_display_sys_t *)vd->sys;
vout_window_cfg_t wnd_cfg; vout_window_cfg_t wnd_cfg;
sys->conn->lock();
/* FIXME: Correct vout_window_t display size
* looks like it assumes fullscreen for
* vout_display_PlacePicture() to work as expected. */
unsigned int width, height;
int screen = DefaultScreen(sys->conn->p_display_x11);
width = DisplayWidth(sys->conn->p_display_x11, screen);
height = DisplayHeight(sys->conn->p_display_x11, screen);
sys->conn->unlock();
memset (&wnd_cfg, 0, sizeof (wnd_cfg)); memset (&wnd_cfg, 0, sizeof (wnd_cfg));
wnd_cfg.type = VOUT_WINDOW_TYPE_XID; wnd_cfg.type = VOUT_WINDOW_TYPE_XID;
wnd_cfg.x = var_InheritInteger (vd, "video-x"); wnd_cfg.x = var_InheritInteger (vd, "video-x");
wnd_cfg.y = var_InheritInteger (vd, "video-y"); wnd_cfg.y = var_InheritInteger (vd, "video-y");
wnd_cfg.width = width; wnd_cfg.width = vd->cfg->display.width;
wnd_cfg.height = height; wnd_cfg.height = vd->cfg->display.height;
vout_window_t *wnd = vout_display_NewWindow (vd, &wnd_cfg); vout_window_t *wnd = vout_display_NewWindow (vd, &wnd_cfg);
if (wnd == NULL) if (wnd == NULL)
...@@ -336,29 +330,77 @@ static vout_window_t *MakeWindow (vout_display_t *vd) ...@@ -336,29 +330,77 @@ static vout_window_t *MakeWindow (vout_display_t *vd)
return wnd; return wnd;
} }
static int GetWindowSize(vout_display_t *vd, unsigned int *pi_width, unsigned int *pi_height) static const xcb_screen_t *FindWindow(vout_display_t *vd, xcb_connection_t *conn,
unsigned *restrict pnum, uint8_t *restrict pdepth,
uint16_t *restrict pwidth, uint16_t *restrict pheight)
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
Status status;
Window root_window;
int x, y; xcb_get_geometry_reply_t *geo =
unsigned int bw, depth; xcb_get_geometry_reply (conn,
xcb_get_geometry(conn, sys->embed->handle.xid), NULL);
if (geo == NULL)
{
msg_Err (vd, "parent window not valid");
return NULL;
}
sys->conn->lock(); xcb_window_t root = geo->root;
status = XGetGeometry(sys->conn->p_display_x11, *pdepth = geo->depth;
sys->embed->handle.xid, *pwidth = geo->width;
&root_window, *pheight = geo->height;
&x, &y, pi_width, pi_height, free (geo);
&bw, &depth);
sys->conn->unlock(); /* Find the selected screen */
const xcb_setup_t *setup = xcb_get_setup(conn);
const xcb_screen_t *screen = NULL;
unsigned num = 0;
if (status == 0) for (xcb_screen_iterator_t i = xcb_setup_roots_iterator(setup);
i.rem > 0;
xcb_screen_next (&i))
{ {
msg_Err(vd, "failed getting geometry"); if (i.data->root == root)
return VLC_EGENERIC; {
screen = i.data;
break;
}
num++;
}
if (screen == NULL)
{
msg_Err(vd, "parent window screen not found");
return NULL;
} }
msg_Dbg(vd, "using screen 0x%"PRIx32 " (number: %u)", root, num);
*pnum = num;
return screen;
}
static int CreateWindow (vout_display_t *vd, xcb_connection_t *conn,
uint_fast8_t depth, xcb_visualid_t vid,
uint_fast16_t width, uint_fast16_t height)
{
vout_display_sys_t *sys = vd->sys;
const uint32_t mask = XCB_CW_EVENT_MASK;
const uint32_t values[] = {
/* XCB_CW_EVENT_MASK */
XCB_EVENT_MASK_VISIBILITY_CHANGE,
};
xcb_void_cookie_t cc, cm;
cc = xcb_create_window_checked (conn, depth, sys->window,
sys->embed->handle.xid, 0, 0,
width, height, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT,
vid, mask, values);
cm = xcb_map_window_checked (conn, sys->window);
if (CheckError (vd, conn, "cannot create X11 window", cc)
|| CheckError (vd, conn, "cannot map X11 window", cm))
return VLC_EGENERIC;
msg_Dbg (vd, "using VAAPI X11 window %08"PRIx32, sys->window);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -388,21 +430,55 @@ int OpenVaapiX11 (vlc_object_t *obj) ...@@ -388,21 +430,55 @@ int OpenVaapiX11 (vlc_object_t *obj)
sys->render.i_cache = VA_INVALID_ID; sys->render.i_cache = VA_INVALID_ID;
sys->display.i_cache = VA_INVALID_ID; sys->display.i_cache = VA_INVALID_ID;
sys->visible = false; sys->embed = MakeWindow(vd);
if (unlikely(sys->embed == NULL))
goto error;
/* Create a VA display */ /* Create a VA display */
sys->conn = vlc_va_Initialize(NULL); sys->conn = vlc_va_Initialize(sys->embed->display.x11);
if (!sys->conn) if (!sys->conn)
goto error; goto error;
sys->embed = MakeWindow(vd); if (FindVAFourCC(vd) != VLC_SUCCESS)
if (unlikely(sys->embed == NULL))
goto error; goto error;
if (FindVAFourCC(vd) != VLC_SUCCESS) XSetEventQueueOwner(sys->conn->p_display_x11, XCBOwnsEventQueue);
xcb_connection_t *conn = XGetXCBConnection(sys->conn->p_display_x11);
assert(conn);
RegisterMouseEvents(obj, conn, sys->embed->handle.xid);
/* Find window parameters */
unsigned snum;
uint8_t depth;
uint16_t width, height;
const xcb_screen_t *scr = FindWindow(vd, conn, &snum, &depth,
&width, &height);
if (scr == NULL)
goto error; goto error;
msg_Dbg(vd, "using VAAPI X11 window (version %d.%d)", sys->window = xcb_generate_id (conn);
#if 0
xcb_get_window_attributes_reply_t *wa =
xcb_get_window_attributes_reply(conn,
xcb_get_window_attributes(conn, sys->embed->handle.xid), NULL);
if (wa == NULL)
goto error;
xcb_visualid_t visual = wa->visual;
free (wa);
#endif
if (!CreateWindow(vd, conn, depth, 0 /* ??? */, width, height))
{
msg_Err (vd, "cannot create VAAPI-X11 window");
goto error;
}
sys->cursor = CreateBlankCursor(conn, scr);
sys->visible = false;
msg_Dbg(vd, "using VAAPI X11 video output (libva version %d.%d)",
sys->conn->i_version_major, sys->conn->i_version_minor); sys->conn->i_version_major, sys->conn->i_version_minor);
/* */ /* */
...@@ -427,7 +503,7 @@ int OpenVaapiX11 (vlc_object_t *obj) ...@@ -427,7 +503,7 @@ int OpenVaapiX11 (vlc_object_t *obj)
vd->pool = Pool; vd->pool = Pool;
vd->display = DisplayPicture; vd->display = DisplayPicture;
vd->control = Control; vd->control = Control;
vd->manage = NULL; //Manage; vd->manage = Manage;
vd->info = info; vd->info = info;
/* */ /* */
...@@ -435,12 +511,7 @@ int OpenVaapiX11 (vlc_object_t *obj) ...@@ -435,12 +511,7 @@ int OpenVaapiX11 (vlc_object_t *obj)
if (is_fullscreen && vout_window_SetFullScreen (sys->embed, true)) if (is_fullscreen && vout_window_SetFullScreen (sys->embed, true))
is_fullscreen = false; is_fullscreen = false;
vout_display_SendEventFullscreen (vd, is_fullscreen); vout_display_SendEventFullscreen (vd, is_fullscreen);
unsigned int width, height; vout_display_SendEventDisplaySize (vd, width, height, is_fullscreen);
if (GetWindowSize(vd, &width, &height) == VLC_SUCCESS)
{
vout_window_SetSize (sys->embed, width, height);
vout_display_SendEventDisplaySize (vd, width, height, is_fullscreen);
}
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
...@@ -455,10 +526,11 @@ void CloseVaapiX11 (vlc_object_t *obj) ...@@ -455,10 +526,11 @@ void CloseVaapiX11 (vlc_object_t *obj)
if (sys->conn && sys->conn->p_display_x11) if (sys->conn && sys->conn->p_display_x11)
{ {
sys->conn->lock(); /* show the default cursor */
XFlush(sys->conn->p_display_x11); xcb_change_window_attributes(XGetXCBConnection(sys->conn->p_display_x11),
XSync(sys->conn->p_display_x11, False); sys->embed->handle.xid, XCB_CW_CURSOR,
sys->conn->unlock(); &(uint32_t) { XCB_CURSOR_NONE });
xcb_flush(XGetXCBConnection(sys->conn->p_display_x11));
} }
if (sys->embed) if (sys->embed)
...@@ -495,6 +567,14 @@ void CloseVaapiX11 (vlc_object_t *obj) ...@@ -495,6 +567,14 @@ void CloseVaapiX11 (vlc_object_t *obj)
free(vd->sys); free(vd->sys);
} }
static void Manage (vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
xcb_connection_t *conn = XGetXCBConnection(sys->conn->p_display_x11);
ManageEvent(vd, conn, &sys->visible);
}
static int Control (vout_display_t *vd, int query, va_list ap) static int Control (vout_display_t *vd, int query, va_list ap)
{ {
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
...@@ -503,14 +583,14 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -503,14 +583,14 @@ static int Control (vout_display_t *vd, int query, va_list ap)
{ {
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *); const vout_display_cfg_t *c = va_arg(ap, const vout_display_cfg_t *);
return vout_window_SetFullScreen (sys->embed, c->is_fullscreen); return vout_window_SetFullScreen(sys->embed, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{ {
unsigned state = va_arg (ap, unsigned); unsigned state = va_arg(ap, unsigned);
return vout_window_SetState (sys->embed, state); return vout_window_SetState(sys->embed, state);
} }
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
...@@ -519,6 +599,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -519,6 +599,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP: case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
{ {
xcb_connection_t *conn = XGetXCBConnection(sys->conn->p_display_x11);
const vout_display_cfg_t *cfg; const vout_display_cfg_t *cfg;
const video_format_t *source; const video_format_t *source;
bool is_forced = false; bool is_forced = false;
...@@ -526,15 +607,15 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -526,15 +607,15 @@ static int Control (vout_display_t *vd, int query, va_list ap)
if (query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT if (query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
|| query == VOUT_DISPLAY_CHANGE_SOURCE_CROP) || query == VOUT_DISPLAY_CHANGE_SOURCE_CROP)
{ {
source = (const video_format_t *)va_arg (ap, const video_format_t *); source = (const video_format_t *)va_arg(ap, const video_format_t *);
cfg = vd->cfg; cfg = vd->cfg;
} }
else else
{ {
source = &vd->source; source = &vd->source;
cfg = (const vout_display_cfg_t*)va_arg (ap, const vout_display_cfg_t *); cfg = (const vout_display_cfg_t*)va_arg(ap, const vout_display_cfg_t *);
if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE) if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
is_forced = (bool)va_arg (ap, int); is_forced = (bool)va_arg(ap, int);
} }
/* */ /* */
...@@ -542,8 +623,22 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -542,8 +623,22 @@ static int Control (vout_display_t *vd, int query, va_list ap)
&& is_forced && is_forced
&& (cfg->display.width != vd->cfg->display.width && (cfg->display.width != vd->cfg->display.width
||cfg->display.height != vd->cfg->display.height) ||cfg->display.height != vd->cfg->display.height)
&& vout_window_SetSize (sys->embed, && vout_window_SetSize(sys->embed,
cfg->display.width, cfg->display.height)) cfg->display.width, cfg->display.height))
return VLC_EGENERIC;
vout_display_place_t place;
vout_display_PlacePicture(&place, source, cfg, false);
/* Move the picture within the window */
const uint32_t values[] = { place.x, place.y,
place.width, place.height, };
xcb_void_cookie_t ck =
xcb_configure_window_checked(conn, sys->window,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
| XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
values);
if (CheckError(vd, conn, "cannot resize X11 window", ck))
return VLC_EGENERIC; return VLC_EGENERIC;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -557,11 +652,17 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -557,11 +652,17 @@ static int Control (vout_display_t *vd, int query, va_list ap)
/* Hide the mouse. It will be send when /* Hide the mouse. It will be send when
* vout_display_t::info.b_hide_mouse is false */ * vout_display_t::info.b_hide_mouse is false */
case VOUT_DISPLAY_HIDE_MOUSE: case VOUT_DISPLAY_HIDE_MOUSE:
/* FIXME */ {
xcb_connection_t *conn = XGetXCBConnection(sys->conn->p_display_x11);
xcb_change_window_attributes(conn, sys->embed->handle.xid,
XCB_CW_CURSOR, &(uint32_t){ sys->cursor });
xcb_flush(conn);
return VLC_SUCCESS; return VLC_SUCCESS;
}
default: default:
msg_Err (vd, "Unknown request in XCB vout display"); msg_Err (vd, "Unknown request in VAAPI-X11 vout display");
return VLC_EGENERIC; return VLC_EGENERIC;
} }
} }
...@@ -1168,7 +1269,7 @@ static void DisplayVASurface(vout_display_t *vd, VASurfaceID surface, picture_t ...@@ -1168,7 +1269,7 @@ static void DisplayVASurface(vout_display_t *vd, VASurfaceID surface, picture_t
sys->conn->lock(); sys->conn->lock();
VAStatus status; VAStatus status;
status = vaPutSurface(sys->conn->p_display, surface, sys->embed->handle.xid, status = vaPutSurface(sys->conn->p_display, surface, sys->window,
picture->format.i_x_offset, picture->format.i_y_offset, picture->format.i_x_offset, picture->format.i_y_offset,
picture->format.i_visible_width, picture->format.i_visible_height, picture->format.i_visible_width, picture->format.i_visible_height,
place.x, place.y, place.width, place.height, place.x, place.y, place.width, place.height,
......
...@@ -42,6 +42,7 @@ libvlc_LTLIBRARIES += \ ...@@ -42,6 +42,7 @@ libvlc_LTLIBRARIES += \
### XCB ### ### XCB ###
libxcb_x11_plugin_la_SOURCES = \ libxcb_x11_plugin_la_SOURCES = \
xcb/xcb_events_vlc.h \
xcb/xcb_vlc.h \ xcb/xcb_vlc.h \
xcb/x11.c \ xcb/x11.c \
xcb/common.c \ xcb/common.c \
...@@ -53,6 +54,7 @@ libxcb_x11_plugin_la_LIBADD = $(AM_LIBADD) \ ...@@ -53,6 +54,7 @@ libxcb_x11_plugin_la_LIBADD = $(AM_LIBADD) \
libxcb_x11_plugin_la_DEPENDENCIES = libxcb_x11_plugin_la_DEPENDENCIES =
libxcb_xv_plugin_la_SOURCES = \ libxcb_xv_plugin_la_SOURCES = \
xcb/xcb_events_vlc.h \
xcb/xcb_vlc.h \ xcb/xcb_vlc.h \
xcb/xvideo.c \ xcb/xvideo.c \
xcb/common.c \ xcb/common.c \
...@@ -64,6 +66,7 @@ libxcb_xv_plugin_la_LIBADD = $(AM_LIBADD) \ ...@@ -64,6 +66,7 @@ libxcb_xv_plugin_la_LIBADD = $(AM_LIBADD) \
libxcb_xv_plugin_la_DEPENDENCIES = libxcb_xv_plugin_la_DEPENDENCIES =
libxcb_glx_plugin_la_SOURCES = \ libxcb_glx_plugin_la_SOURCES = \
xcb/xcb_events_vlc.h \
xcb/xcb_vlc.h \ xcb/xcb_vlc.h \
xcb/glx.c \ xcb/glx.c \
opengl.h \ opengl.h \
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_vout_display.h> #include <vlc_vout_display.h>
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
/** /**
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_vout_display.h> #include <vlc_vout_display.h>
#include "xcb_vlc.h" #include "xcb_events_vlc.h"
/** /**
* Check for an error * Check for an error
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <vlc_opengl.h> #include <vlc_opengl.h>
#include "../opengl.h" #include "../opengl.h"
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <vlc_common.h> #include <vlc_common.h>
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
#ifdef HAVE_XCB_KEYSYMS #ifdef HAVE_XCB_KEYSYMS
......
...@@ -38,6 +38,7 @@ typedef xcb_atom_t Atom; ...@@ -38,6 +38,7 @@ typedef xcb_atom_t Atom;
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_vout_window.h> #include <vlc_vout_window.h>
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
#define DISPLAY_TEXT N_("X11 display") #define DISPLAY_TEXT N_("X11 display")
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <vlc_vout_display.h> #include <vlc_vout_display.h>
#include <vlc_picture_pool.h> #include <vlc_picture_pool.h>
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
......
/**
* @file xcb_events_vlc.h
* @brief X C Bindings VLC module common header
*/
/*****************************************************************************
* Copyright © 2009 Rémi Denis-Courmont
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
****************************************************************************/
#ifdef WORDS_BIGENDIAN
# define ORDER XCB_IMAGE_ORDER_MSB_FIRST
#else
# define ORDER XCB_IMAGE_ORDER_LSB_FIRST
#endif
#ifndef XCB_CURSOR_NONE
# define XCB_CURSOR_NONE ((xcb_cursor_t) 0U)
#endif
#include <vlc_picture.h>
#include <vlc_vout_display.h>
int ManageEvent (vout_display_t *vd, xcb_connection_t *conn, bool *);
/* keys.c */
typedef struct key_handler_t key_handler_t;
key_handler_t *CreateKeyHandler (vlc_object_t *, xcb_connection_t *);
void DestroyKeyHandler (key_handler_t *);
int ProcessKeyEvent (key_handler_t *, xcb_generic_event_t *);
/* common.c */
struct vout_window_t *GetWindow (vout_display_t *obj,
xcb_connection_t **restrict pconn,
const xcb_screen_t **restrict pscreen,
uint8_t *restrict pdepth);
int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
unsigned *restrict width, unsigned *restrict height);
bool CheckSHM (vlc_object_t *obj, xcb_connection_t *conn);
xcb_cursor_t CreateBlankCursor (xcb_connection_t *, const xcb_screen_t *);
void RegisterMouseEvents (vlc_object_t *, xcb_connection_t *, xcb_window_t);
int CheckError (vout_display_t *, xcb_connection_t *conn,
const char *str, xcb_void_cookie_t);
...@@ -20,43 +20,6 @@ ...@@ -20,43 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
****************************************************************************/ ****************************************************************************/
#ifdef WORDS_BIGENDIAN
# define ORDER XCB_IMAGE_ORDER_MSB_FIRST
#else
# define ORDER XCB_IMAGE_ORDER_LSB_FIRST
#endif
#ifndef XCB_CURSOR_NONE
# define XCB_CURSOR_NONE ((xcb_cursor_t) 0U)
#endif
#include <vlc_picture.h>
#include <vlc_vout_display.h>
int ManageEvent (vout_display_t *vd, xcb_connection_t *conn, bool *);
/* keys.c */
typedef struct key_handler_t key_handler_t;
key_handler_t *CreateKeyHandler (vlc_object_t *, xcb_connection_t *);
void DestroyKeyHandler (key_handler_t *);
int ProcessKeyEvent (key_handler_t *, xcb_generic_event_t *);
/* common.c */
struct vout_window_t *GetWindow (vout_display_t *obj,
xcb_connection_t **restrict pconn,
const xcb_screen_t **restrict pscreen,
uint8_t *restrict pdepth);
int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
unsigned *restrict width, unsigned *restrict height);
bool CheckSHM (vlc_object_t *obj, xcb_connection_t *conn);
xcb_cursor_t CreateBlankCursor (xcb_connection_t *, const xcb_screen_t *);
void RegisterMouseEvents (vlc_object_t *, xcb_connection_t *, xcb_window_t);
int CheckError (vout_display_t *, xcb_connection_t *conn,
const char *str, xcb_void_cookie_t);
/* FIXME
* maybe it would be better to split this header in 2 */
#include <xcb/shm.h> #include <xcb/shm.h>
struct picture_sys_t struct picture_sys_t
{ {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <vlc_picture_pool.h> #include <vlc_picture_pool.h>
#include <vlc_dialog.h> #include <vlc_dialog.h>
#include "xcb_events_vlc.h"
#include "xcb_vlc.h" #include "xcb_vlc.h"
#define ADAPTOR_TEXT N_("XVideo adaptor number") #define ADAPTOR_TEXT N_("XVideo adaptor number")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment