#define _(x) x
#include <gst/video/video.h>
+#ifdef HAVE_XFIXES
+#include <xcb/xfixes.h>
+#endif
+
//#include "gst/glib-compat-private.h"
GST_DEBUG_CATEGORY_STATIC (gst_debug_xcbimage_src);
use_root_window:
#ifdef HAVE_XFIXES
- /* check if xfixes supported */
- {
- int error_base;
-
- if (XFixesQueryExtension (s->xcontext->disp, &s->fixes_event_base,
- &error_base)) {
- s->have_xfixes = TRUE;
- GST_DEBUG_OBJECT (s, "X Server supports XFixes");
- } else {
-
- GST_DEBUG_OBJECT (s, "X Server does not support XFixes");
- }
+ /* check if xfixes is supported */
+ if (xcb_get_extension_data (s->xcontext->conn, &xcb_xfixes_id)->present) {
+ GST_DEBUG_OBJECT (s, "X Server supports XFixes");
+ s->have_xfixes = TRUE;
+ } else {
+ GST_DEBUG_OBJECT (s, "X Server does not support XFixes");
}
#ifdef HAVE_XDAMAGE
#include "xcbimageutil.h"
+#include <X11/Xlib-xcb.h>
+
GType
gst_meta_xcbimage_api_get_type (void)
{
}
#endif /* HAVE_XSHM */
+static xcb_connection_t *
+get_xcb_connection (Display *dpy)
+{
+ xcb_connection_t *conn;
+
+ conn = XGetXCBConnection (dpy);
+ if (xcb_connection_has_error (conn)) {
+ g_warning ("Could not get XCB connection");
+ return NULL;
+ }
+
+ return conn;
+}
+
/* This function gets the X Display and global info about it. Everything is
stored in our object and will be cleaned when the object is disposed. Note
here that caps for supported format are generated without any window or
g_free (xcontext);
return NULL;
}
+ xcontext->conn = get_xcb_connection (xcontext->disp);
xcontext->screen = DefaultScreenOfDisplay (xcontext->disp);
xcontext->visual = DefaultVisualOfScreen (xcontext->screen);
xcontext->root = RootWindowOfScreen (xcontext->screen);