[vlc-commits] XCB: split picture (X11/XV) and events (all) header

Rémi Denis-Courmont git at videolan.org
Thu Jun 13 20:41:16 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 13 21:35:53 2013 +0300| [4c19f003225869c7e5ad831e4431550d6666e6b5] | committer: Rémi Denis-Courmont

XCB: split picture (X11/XV) and events (all) header

This fixes namespace pollution of picture_sys_t.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c19f003225869c7e5ad831e4431550d6666e6b5
---

 modules/video_output/Modules.am                  |   22 +++++-------
 modules/video_output/xcb/events.c                |    2 +-
 modules/video_output/xcb/{xcb_vlc.h => events.h} |   23 +-----------
 modules/video_output/xcb/glx.c                   |    2 +-
 modules/video_output/xcb/keys.c                  |    2 +-
 modules/video_output/xcb/pictures.c              |    3 +-
 modules/video_output/xcb/pictures.h              |   41 ++++++++++++++++++++++
 modules/video_output/xcb/window.c                |    2 +-
 modules/video_output/xcb/x11.c                   |    3 +-
 modules/video_output/xcb/xvideo.c                |    3 +-
 10 files changed, 61 insertions(+), 42 deletions(-)

diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am
index 7407e62..7efe10a 100644
--- a/modules/video_output/Modules.am
+++ b/modules/video_output/Modules.am
@@ -42,31 +42,27 @@ libvlc_LTLIBRARIES += \
 
 ### XCB ###
 libxcb_x11_plugin_la_SOURCES = \
-	xcb/xcb_vlc.h \
-	xcb/x11.c \
-	xcb/pictures.c \
-	xcb/events.c
+	xcb/pictures.c xcb/pictures.h \
+	xcb/events.c xcb/events.h \
+	xcb/x11.c
 libxcb_x11_plugin_la_CFLAGS = $(AM_CFLAGS) \
 	$(XCB_CFLAGS) $(XCB_SHM_CFLAGS)
 libxcb_x11_plugin_la_LIBADD = $(AM_LIBADD) \
 	$(XCB_LIBS) $(XCB_SHM_LIBS)
 
 libxcb_xv_plugin_la_SOURCES = \
-	xcb/xcb_vlc.h \
-	xcb/xvideo.c \
-	xcb/pictures.c \
-	xcb/events.c
+	xcb/pictures.c xcb/pictures.h \
+	xcb/events.c xcb/events.h \
+	xcb/xvideo.c
 libxcb_xv_plugin_la_CFLAGS = $(AM_CFLAGS) \
 	$(XCB_CFLAGS) $(XCB_SHM_CFLAGS) $(XCB_XV_CFLAGS)
 libxcb_xv_plugin_la_LIBADD = $(AM_LIBADD) \
 	$(XCB_LIBS) $(XCB_SHM_LIBS) $(XCB_XV_LIBS)
 
 libxcb_glx_plugin_la_SOURCES = \
-	xcb/xcb_vlc.h \
-	xcb/glx.c \
-	opengl.h \
-	opengl.c \
-	xcb/events.c
+	opengl.c opengl.h \
+	xcb/events.c xcb/events.h \
+	xcb/glx.c
 libxcb_glx_plugin_la_CFLAGS = $(AM_CFLAGS) \
 	$(XCB_CFLAGS) $(GL_CFLAGS)
 libxcb_glx_plugin_la_LIBADD = $(AM_LIBADD) \
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 998d13d..efb3adb 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -32,7 +32,7 @@
 #include <vlc_common.h>
 #include <vlc_vout_display.h>
 
-#include "xcb_vlc.h"
+#include "events.h"
 
 /**
  * Check for an error
diff --git a/modules/video_output/xcb/xcb_vlc.h b/modules/video_output/xcb/events.h
similarity index 76%
rename from modules/video_output/xcb/xcb_vlc.h
rename to modules/video_output/xcb/events.h
index 81931e9..c50cd03 100644
--- a/modules/video_output/xcb/xcb_vlc.h
+++ b/modules/video_output/xcb/events.h
@@ -1,5 +1,5 @@
 /**
- * @file xcb_vlc.h
+ * @file events.h
  * @brief X C Bindings VLC module common header
  */
 /*****************************************************************************
@@ -20,17 +20,10 @@
  * Inc., 51 Franklin Street, 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>
 
 /* keys.c */
@@ -50,17 +43,3 @@ struct vout_window_t *XCB_parent_Create (vout_display_t *obj,
 xcb_cursor_t XCB_cursor_Create (xcb_connection_t *, const xcb_screen_t *);
 
 int XCB_Manage (vout_display_t *vd, xcb_connection_t *conn, bool *);
-
-/* common.c */
-bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn);
-
-/* FIXME
- * maybe it would be better to split this header in 2 */
-#include <xcb/shm.h>
-struct picture_sys_t
-{
-    xcb_shm_seg_t segment;
-};
-int XCB_pictures_Alloc (vout_display_t *, picture_resource_t *, size_t size,
-                        xcb_connection_t *, bool attach);
-void XCB_pictures_Free (picture_resource_t *, xcb_connection_t *);
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 05683a4..e5661a4 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -39,7 +39,7 @@
 #include <vlc_opengl.h>
 #include "../opengl.h"
 
-#include "xcb_vlc.h"
+#include "events.h"
 
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
diff --git a/modules/video_output/xcb/keys.c b/modules/video_output/xcb/keys.c
index f7c1c49..baac6ca 100644
--- a/modules/video_output/xcb/keys.c
+++ b/modules/video_output/xcb/keys.c
@@ -30,7 +30,7 @@
 
 #include <xcb/xcb.h>
 #include <vlc_common.h>
-#include "xcb_vlc.h"
+#include "events.h"
 
 #ifdef HAVE_XCB_KEYSYMS
 #include <xcb/xcb_keysyms.h>
diff --git a/modules/video_output/xcb/pictures.c b/modules/video_output/xcb/pictures.c
index 3bce8ce..8efc5bb 100644
--- a/modules/video_output/xcb/pictures.c
+++ b/modules/video_output/xcb/pictures.c
@@ -39,7 +39,8 @@
 #include <vlc_common.h>
 #include <vlc_vout_display.h>
 
-#include "xcb_vlc.h"
+#include "pictures.h"
+#include "events.h"
 
 /** Check MIT-SHM shared memory support */
 bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn)
diff --git a/modules/video_output/xcb/pictures.h b/modules/video_output/xcb/pictures.h
new file mode 100644
index 0000000..9ee54c7
--- /dev/null
+++ b/modules/video_output/xcb/pictures.h
@@ -0,0 +1,41 @@
+/**
+ * @file pictures.h
+ * @brief XCB pictures allocation header
+ */
+/*****************************************************************************
+ * Copyright © 2009 Rémi Denis-Courmont
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, 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
+
+#include <vlc_picture.h>
+#include <vlc_vout_display.h>
+#include <xcb/shm.h>
+
+bool XCB_shm_Check (vlc_object_t *obj, xcb_connection_t *conn);
+
+struct picture_sys_t
+{
+    xcb_shm_seg_t segment;
+};
+int XCB_pictures_Alloc (vout_display_t *, picture_resource_t *, size_t size,
+                        xcb_connection_t *, bool attach);
+void XCB_pictures_Free (picture_resource_t *, xcb_connection_t *);
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 247f06e..07cd030 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -38,7 +38,7 @@ typedef xcb_atom_t Atom;
 #include <vlc_plugin.h>
 #include <vlc_vout_window.h>
 
-#include "xcb_vlc.h"
+#include "events.h"
 
 #define DISPLAY_TEXT N_("X11 display")
 #define DISPLAY_LONGTEXT N_( \
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 88752c0..1a6864f 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -35,7 +35,8 @@
 #include <vlc_vout_display.h>
 #include <vlc_picture_pool.h>
 
-#include "xcb_vlc.h"
+#include "pictures.h"
+#include "events.h"
 
 static int  Open (vlc_object_t *);
 static void Close (vlc_object_t *);
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index b62cb26..5121747 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -38,7 +38,8 @@
 #include <vlc_picture_pool.h>
 #include <vlc_dialog.h>
 
-#include "xcb_vlc.h"
+#include "pictures.h"
+#include "events.h"
 
 #define ADAPTOR_TEXT N_("XVideo adaptor number")
 #define ADAPTOR_LONGTEXT N_( \



More information about the vlc-commits mailing list