mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
test and define HAVE_XSHM build ximage plugin
Original commit message from CVS: test and define HAVE_XSHM build ximage plugin
This commit is contained in:
parent
da9273564d
commit
9a378dd53e
4 changed files with 24 additions and 16 deletions
|
@ -520,6 +520,13 @@ GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink-Xv, [
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl check for XShm
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_XSHM, true)
|
||||||
|
GST_CHECK_FEATURE(XSHM, [X11 Shared Memory], ximage, [
|
||||||
|
AC_CHECK_HEADER(X11/extensions/XShm.h,
|
||||||
|
HAVE_XSHM=yes, HAVE_XSHM=no)
|
||||||
|
])
|
||||||
|
|
||||||
dnl Next, check for the optional libraries:
|
dnl Next, check for the optional libraries:
|
||||||
dnl These are all libraries used in building plug-ins
|
dnl These are all libraries used in building plug-ins
|
||||||
dnl ================================================
|
dnl ================================================
|
||||||
|
@ -1330,6 +1337,7 @@ sys/v4l/Makefile
|
||||||
sys/v4l2/Makefile
|
sys/v4l2/Makefile
|
||||||
sys/vcd/Makefile
|
sys/vcd/Makefile
|
||||||
sys/xvideo/Makefile
|
sys/xvideo/Makefile
|
||||||
|
sys/ximage/Makefile
|
||||||
sys/glsink/Makefile
|
sys/glsink/Makefile
|
||||||
ext/Makefile
|
ext/Makefile
|
||||||
ext/a52dec/Makefile
|
ext/a52dec/Makefile
|
||||||
|
|
|
@ -35,7 +35,7 @@ VCD_DIR=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if USE_XFREE
|
if USE_XFREE
|
||||||
XVIDEO_DIR=xvideo
|
XVIDEO_DIR=xvideo ximage
|
||||||
else
|
else
|
||||||
XVIDEO_DIR=
|
XVIDEO_DIR=
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -116,7 +116,7 @@ gst_ximagesink_ximage_new (GstXImageSink *ximagesink, gint width, gint height)
|
||||||
|
|
||||||
ximage->size = (ximagesink->xcontext->bpp / 8) * ximage->width * ximage->height;
|
ximage->size = (ximagesink->xcontext->bpp / 8) * ximage->width * ximage->height;
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
if (ximagesink->xcontext->use_xshm)
|
if (ximagesink->xcontext->use_xshm)
|
||||||
{
|
{
|
||||||
ximage->ximage = XShmCreateImage (ximagesink->xcontext->disp,
|
ximage->ximage = XShmCreateImage (ximagesink->xcontext->disp,
|
||||||
|
@ -163,7 +163,7 @@ gst_ximagesink_ximage_new (GstXImageSink *ximagesink, gint width, gint height)
|
||||||
ximage->width * (ximagesink->xcontext->bpp / 8));
|
ximage->width * (ximagesink->xcontext->bpp / 8));
|
||||||
|
|
||||||
GST_DEBUG ("ximagesink creating an image without XShm");
|
GST_DEBUG ("ximagesink creating an image without XShm");
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
if (ximage->ximage)
|
if (ximage->ximage)
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ gst_ximagesink_ximage_destroy (GstXImageSink *ximagesink, GstXImage *ximage)
|
||||||
|
|
||||||
g_mutex_lock (ximagesink->x_lock);
|
g_mutex_lock (ximagesink->x_lock);
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
if (ximagesink->xcontext->use_xshm)
|
if (ximagesink->xcontext->use_xshm)
|
||||||
{
|
{
|
||||||
if (ximage->SHMInfo.shmaddr)
|
if (ximage->SHMInfo.shmaddr)
|
||||||
|
@ -216,7 +216,7 @@ gst_ximagesink_ximage_destroy (GstXImageSink *ximagesink, GstXImage *ximage)
|
||||||
#else
|
#else
|
||||||
if (ximage->ximage)
|
if (ximage->ximage)
|
||||||
XDestroyImage(ximage->ximage);
|
XDestroyImage(ximage->ximage);
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
g_mutex_unlock (ximagesink->x_lock);
|
g_mutex_unlock (ximagesink->x_lock);
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ gst_ximagesink_ximage_put (GstXImageSink *ximagesink, GstXImage *ximage)
|
||||||
x = MAX (0, (attr.width - ximage->width) / 2);
|
x = MAX (0, (attr.width - ximage->width) / 2);
|
||||||
y = MAX (0, (attr.height - ximage->height) / 2);
|
y = MAX (0, (attr.height - ximage->height) / 2);
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
if (ximagesink->xcontext->use_xshm)
|
if (ximagesink->xcontext->use_xshm)
|
||||||
{
|
{
|
||||||
XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
XShmPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
||||||
|
@ -260,7 +260,7 @@ gst_ximagesink_ximage_put (GstXImageSink *ximagesink, GstXImage *ximage)
|
||||||
XPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
XPutImage (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
||||||
ximagesink->xwindow->gc, ximage->ximage,
|
ximagesink->xwindow->gc, ximage->ximage,
|
||||||
0, 0, x, y, ximage->width, ximage->height);
|
0, 0, x, y, ximage->width, ximage->height);
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
XSync(ximagesink->xcontext->disp, FALSE);
|
XSync(ximagesink->xcontext->disp, FALSE);
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink)
|
||||||
|
|
||||||
xcontext->endianness = (ImageByteOrder (xcontext->disp) == LSBFirst) ? G_LITTLE_ENDIAN:G_BIG_ENDIAN;
|
xcontext->endianness = (ImageByteOrder (xcontext->disp) == LSBFirst) ? G_LITTLE_ENDIAN:G_BIG_ENDIAN;
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
/* Search for XShm extension support */
|
/* Search for XShm extension support */
|
||||||
if (XQueryExtension (xcontext->disp, "MIT-SHM", &i, &i, &i))
|
if (XQueryExtension (xcontext->disp, "MIT-SHM", &i, &i, &i))
|
||||||
{
|
{
|
||||||
|
@ -396,7 +396,7 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink)
|
||||||
xcontext->use_xshm = FALSE;
|
xcontext->use_xshm = FALSE;
|
||||||
GST_DEBUG ("ximagesink is not using XShm extension");
|
GST_DEBUG ("ximagesink is not using XShm extension");
|
||||||
}
|
}
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
if (xcontext->endianness == G_LITTLE_ENDIAN && xcontext->depth == 24) {
|
if (xcontext->endianness == G_LITTLE_ENDIAN && xcontext->depth == 24) {
|
||||||
xcontext->endianness = G_BIG_ENDIAN;
|
xcontext->endianness = G_BIG_ENDIAN;
|
||||||
|
|
|
@ -23,19 +23,19 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
/* FIXME : We should have a configure test for shm support */
|
/* FIXME : We should have a configure test for shm support */
|
||||||
#define USE_SHM
|
#define HAVE_XSHM
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
#include <X11/extensions/XShm.h>
|
#include <X11/extensions/XShm.h>
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
@ -93,9 +93,9 @@ struct _GstXWindow {
|
||||||
struct _GstXImage {
|
struct _GstXImage {
|
||||||
XImage *ximage;
|
XImage *ximage;
|
||||||
|
|
||||||
#ifdef USE_SHM
|
#ifdef HAVE_XSHM
|
||||||
XShmSegmentInfo SHMInfo;
|
XShmSegmentInfo SHMInfo;
|
||||||
#endif /* USE_SHM */
|
#endif /* HAVE_XSHM */
|
||||||
|
|
||||||
char *data;
|
char *data;
|
||||||
gint width, height, size;
|
gint width, height, size;
|
||||||
|
|
Loading…
Reference in a new issue