summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-09-08 16:38:30 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-09-08 16:38:30 +0000
commit0ba2f79cb5e60f950c2f9e606303d748209eb37a (patch)
tree5af8c6009dabf9760ef8d24fde1798726d91f77d /sys
parent8e296da9dd14dc98a0c6d6f37db69c84f1b1bc15 (diff)
sys/: Fix compilation when XShm is not available.
Original commit message from CVS: * sys/ximage/ximagesink.c: (gst_ximage_buffer_init), (gst_ximagesink_check_xshm_calls), (gst_ximagesink_xcontext_get): * sys/xvimage/xvimagesink.c: (gst_xvimage_buffer_init), (gst_xvimagesink_check_xshm_calls): Fix compilation when XShm is not available.
Diffstat (limited to 'sys')
-rw-r--r--sys/ximage/ximagesink.c18
-rw-r--r--sys/xvimage/xvimagesink.c11
2 files changed, 16 insertions, 13 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c
index 9f62b9ce..caee628f 100644
--- a/sys/ximage/ximagesink.c
+++ b/sys/ximage/ximagesink.c
@@ -81,7 +81,6 @@ enum
};
static GstVideoSinkClass *parent_class = NULL;
-static gboolean error_caught = FALSE;
/* ============================================================= */
/* */
@@ -143,8 +142,10 @@ gst_ximage_buffer_finalize (GstXImageBuffer * ximage_buffer)
static void
gst_ximage_buffer_init (GstXImageBuffer * ximage_buffer, gpointer g_class)
{
+#ifdef HAVE_XSHM
ximage_buffer->SHMInfo.shmaddr = ((void *) -1);
ximage_buffer->SHMInfo.shmid = -1;
+#endif
}
static void
@@ -182,6 +183,9 @@ gst_ximage_buffer_get_type (void)
/* X11 stuff */
+#ifdef HAVE_XSHM
+static gboolean error_caught = FALSE;
+
static int
gst_ximagesink_handle_xerror (Display * display, XErrorEvent * xevent)
{
@@ -198,9 +202,6 @@ gst_ximagesink_handle_xerror (Display * display, XErrorEvent * xevent)
static gboolean
gst_ximagesink_check_xshm_calls (GstXContext * xcontext)
{
-#ifndef HAVE_XSHM
- return FALSE;
-#else
GstXImageBuffer *ximage = NULL;
int (*handler) (Display *, XErrorEvent *);
gboolean result = FALSE;
@@ -267,8 +268,8 @@ beach:
XSync (xcontext->disp, FALSE);
return result;
-#endif /* HAVE_XSHM */
}
+#endif /* HAVE_XSHM */
/* This function handles GstXImageBuffer creation depending on XShm availability */
static GstXImageBuffer *
@@ -881,17 +882,18 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
(ImageByteOrder (xcontext->disp) ==
LSBFirst) ? G_LITTLE_ENDIAN : G_BIG_ENDIAN;
-#ifdef HAVE_XSHM
/* Search for XShm extension support */
+#ifdef HAVE_XSHM
if (XShmQueryExtension (xcontext->disp) &&
gst_ximagesink_check_xshm_calls (xcontext)) {
xcontext->use_xshm = TRUE;
GST_DEBUG ("ximagesink is using XShm extension");
- } else {
+ } else
+#endif
+ {
xcontext->use_xshm = FALSE;
GST_DEBUG ("ximagesink is not using XShm extension");
}
-#endif /* HAVE_XSHM */
/* our caps system handles 24/32bpp RGB as big-endian. */
if ((xcontext->bpp == 24 || xcontext->bpp == 32) &&
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index fba849a0..3e839579 100644
--- a/sys/xvimage/xvimagesink.c
+++ b/sys/xvimage/xvimagesink.c
@@ -86,7 +86,6 @@ enum
};
static GstVideoSinkClass *parent_class = NULL;
-static gboolean error_caught = FALSE;
/* ============================================================= */
/* */
@@ -204,8 +203,10 @@ gst_xvimage_buffer_free (GstXvImageBuffer * xvimage)
static void
gst_xvimage_buffer_init (GstXvImageBuffer * xvimage, gpointer g_class)
{
+#ifdef HAVE_XSHM
xvimage->SHMInfo.shmaddr = ((void *) -1);
xvimage->SHMInfo.shmid = -1;
+#endif
}
static void
@@ -243,6 +244,9 @@ gst_xvimage_buffer_get_type (void)
/* X11 stuff */
+#ifdef HAVE_XSHM
+static gboolean error_caught = FALSE;
+
static int
gst_xvimagesink_handle_xerror (Display * display, XErrorEvent * xevent)
{
@@ -259,9 +263,6 @@ gst_xvimagesink_handle_xerror (Display * display, XErrorEvent * xevent)
static gboolean
gst_xvimagesink_check_xshm_calls (GstXContext * xcontext)
{
-#ifndef HAVE_XSHM
- return FALSE;
-#else
XvImage *xvimage;
XShmSegmentInfo SHMInfo;
gint size;
@@ -322,8 +323,8 @@ beach:
if (xvimage)
XFree (xvimage);
return result;
-#endif /* HAVE_XSHM */
}
+#endif /* HAVE_XSHM */
/* This function handles GstXvImage creation depending on XShm availability */
static GstXvImageBuffer *