From efa3c21fdd6859b6b42b53d75209233002c89def Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 17 Dec 2003 22:37:26 +0000 Subject: [PATCH] Fix LE caps on bpp=24/32. Our docs currently say that these are BE only. I disagree, but still, it's our spec so let'... Original commit message from CVS: Fix LE caps on bpp=24/32. Our docs currently say that these are BE only. I disagree, but still, it's our spec so let's keep to it for now... --- sys/ximage/ximagesink.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 2749fe39b3..502e1f36d5 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -448,6 +448,15 @@ gst_ximagesink_xcontext_get (GstXImageSink *ximagesink) 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) && + xcontext->endianness == G_LITTLE_ENDIAN) { + xcontext->endianness = G_BIG_ENDIAN; + xcontext->visual->red_mask = GULONG_TO_BE (xcontext->visual->red_mask); + xcontext->visual->green_mask = GULONG_TO_BE (xcontext->visual->green_mask); + xcontext->visual->blue_mask = GULONG_TO_BE (xcontext->visual->blue_mask); + } xcontext->caps = GST_CAPS_NEW ("ximagesink_ximage_caps", "video/x-raw-rgb", "bpp", GST_PROPS_INT (xcontext->bpp),