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 += \
......
This diff is collapsed.
...@@ -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