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.
This commit is contained in:
Jan Schmidt 2005-09-08 16:38:30 +00:00
parent 8e296da9dd
commit 0ba2f79cb5
3 changed files with 24 additions and 13 deletions

View file

@ -1,3 +1,11 @@
2005-09-08 Jan Schmidt <thaytan@mad.scientist.com>
* 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.
2005-09-07 Jan Schmidt <thaytan@mad.scientist.com>
* ext/libvisual/visual.c: (gst_visual_dispose),

View file

@ -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) &&

View file

@ -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 *