[vlc-devel] commit: XCB: move GLX-relevant helper to non-SHM-dependent file ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Dec 12 13:14:35 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec 12 13:15:02 2009 +0200| [76da073c1711444eca280cb08a2b822345060618] | committer: Rémi Denis-Courmont 

XCB: move GLX-relevant helper to non-SHM-dependent file

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

 modules/video_output/xcb/common.c |   54 -------------------------------------
 modules/video_output/xcb/events.c |   54 +++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/modules/video_output/xcb/common.c b/modules/video_output/xcb/common.c
index c4ab50d..5787f5f 100644
--- a/modules/video_output/xcb/common.c
+++ b/modules/video_output/xcb/common.c
@@ -39,24 +39,6 @@
 #include "xcb_vlc.h"
 
 /**
- * Check for an error
- */
-int CheckError (vout_display_t *vd, xcb_connection_t *conn,
-                const char *str, xcb_void_cookie_t ck)
-{
-    xcb_generic_error_t *err;
-
-    err = xcb_request_check (conn, ck);
-    if (err)
-    {
-        msg_Err (vd, "%s: X11 error %d", str, err->error_code);
-        free (err);
-        return VLC_EGENERIC;
-    }
-    return VLC_SUCCESS;
-}
-
-/**
  * Connect to the X server.
  */
 static xcb_connection_t *Connect (vlc_object_t *obj, const char *display)
@@ -174,24 +156,6 @@ error:
     return NULL;
 }
 
-/**
- * Gets the size of an X window.
- */
-int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
-                   unsigned *restrict width, unsigned *restrict height)
-{
-    xcb_get_geometry_cookie_t ck = xcb_get_geometry (conn, wnd->xid);
-    xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply (conn, ck, NULL);
-
-    if (!geo)
-        return -1;
-
-    *width = geo->width;
-    *height = geo->height;
-    free (geo);
-    return 0;
-}
-
 /** Check MIT-SHM shared memory support */
 void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm)
 {
@@ -215,24 +179,6 @@ void CheckSHM (vlc_object_t *obj, xcb_connection_t *conn, bool *restrict pshm)
 }
 
 /**
- * Create a blank cursor.
- * Note that the pixmaps are leaked (until the X disconnection). Hence, this
- * function should be called no more than once per X connection.
- * @param conn XCB connection
- * @param scr target XCB screen
- */
-xcb_cursor_t CreateBlankCursor (xcb_connection_t *conn,
-                                const xcb_screen_t *scr)
-{
-    xcb_cursor_t cur = xcb_generate_id (conn);
-    xcb_pixmap_t pix = xcb_generate_id (conn);
-
-    xcb_create_pixmap (conn, 1, pix, scr->root, 1, 1);
-    xcb_create_cursor (conn, cur, pix, pix, 0, 0, 0, 1, 1, 1, 0, 0);
-    return cur;
-}
-
-/**
  * Initialize a picture buffer as shared memory, according to the video output
  * format. If a attach is true, the segment is attached to
  * the X server (MIT-SHM extension).
diff --git a/modules/video_output/xcb/events.c b/modules/video_output/xcb/events.c
index 6da22fb..4ad765f 100644
--- a/modules/video_output/xcb/events.c
+++ b/modules/video_output/xcb/events.c
@@ -37,6 +37,60 @@
 
 #include "xcb_vlc.h"
 
+/**
+ * Check for an error
+ */
+int CheckError (vout_display_t *vd, xcb_connection_t *conn,
+                const char *str, xcb_void_cookie_t ck)
+{
+    xcb_generic_error_t *err;
+
+    err = xcb_request_check (conn, ck);
+    if (err)
+    {
+        msg_Err (vd, "%s: X11 error %d", str, err->error_code);
+        free (err);
+        return VLC_EGENERIC;
+    }
+    return VLC_SUCCESS;
+}
+
+/**
+ * Gets the size of an X window.
+ */
+int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
+                   unsigned *restrict width, unsigned *restrict height)
+{
+    xcb_get_geometry_cookie_t ck = xcb_get_geometry (conn, wnd->xid);
+    xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply (conn, ck, NULL);
+
+    if (!geo)
+        return -1;
+
+    *width = geo->width;
+    *height = geo->height;
+    free (geo);
+    return 0;
+}
+
+/**
+ * Create a blank cursor.
+ * Note that the pixmaps are leaked (until the X disconnection). Hence, this
+ * function should be called no more than once per X connection.
+ * @param conn XCB connection
+ * @param scr target XCB screen
+ */
+xcb_cursor_t CreateBlankCursor (xcb_connection_t *conn,
+                                const xcb_screen_t *scr)
+{
+    xcb_cursor_t cur = xcb_generate_id (conn);
+    xcb_pixmap_t pix = xcb_generate_id (conn);
+
+    xcb_create_pixmap (conn, 1, pix, scr->root, 1, 1);
+    xcb_create_cursor (conn, cur, pix, pix, 0, 0, 0, 1, 1, 1, 0, 0);
+    return cur;
+}
+
 /* NOTE: we assume no other thread will be _setting_ our video output events
  * variables. Afterall, only this plugin is supposed to know when these occur.
   * Otherwise, we'd var_OrInteger() and var_NandInteger() functions...




More information about the vlc-devel mailing list