[Gstreamer-bugs] [Bug 112621] Changed - lots of plugins get RGB caps wrong
bugzilla-daemon at widget.gnome.org
bugzilla-daemon at widget.gnome.org
Fri May 9 15:52:07 PDT 2003
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
http://bugzilla.gnome.org/show_bug.cgi?id=112621
Changed by ds at schleef.org.
--- shadow/112621 Fri May 9 18:36:32 2003
+++ shadow/112621.tmp.22023 Fri May 9 18:52:07 2003
@@ -126,6 +126,49 @@
24-bit and 32-bit RGB formats are typically byte-oriented, not
word-oriented. There is no inherint endianness in the data as there
is with 16-bit or 15-bit, there is merely arrangement.
The reason there aren't many #ifdefs currently is because nothing
really works on big-endian machines.
+
+------- Additional Comments From ds at schleef.org 2003-05-09 18:51 -------
+> Benjamin, before the patch, it works that way.
+
+Only on little endian machines.
+
+Here's a concrete example of the problem. Swfdec creates 24 bit RGB
+images where the ((guint8 *)data)[0] is red, [1] is green, [2] is
+blue, [3] is red, etc., independent of host endianness. To describe
+this using G_BYTE_ORDER, we need:
+
+#ifdef G_BYTE_ORDER == G_BIG_ENDIAN
+ c = GST_CAPS_NEW (
+ "swfdec_videosrc",
+ "video/raw",
+ "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC
+('R','G','B',' ')),
+ "bpp", GST_PROPS_INT (24),
+ "depth", GST_PROPS_INT (24),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "red_mask", GST_PROPS_INT (0xff0000),
+ "green_mask", GST_PROPS_INT (0x00ff00),
+ "blue_mask", GST_PROPS_INT (0x0000ff)
+ );
+#else
+ c = GST_CAPS_NEW (
+ "swfdec_videosrc",
+ "video/raw",
+ "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC
+('R','G','B',' ')),
+ "bpp", GST_PROPS_INT (24),
+ "depth", GST_PROPS_INT (24),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "red_mask", GST_PROPS_INT (0x0000ff),
+ "green_mask", GST_PROPS_INT (0x00ff00),
+ "blue_mask", GST_PROPS_INT (0xff0000)
+ );
+#endif
+
+Arguably, one can make this cleaner, although not smaller. However,
+one must use #ifdefs for GST_PAD_TEMPLATE_FACTORY().
+
+
More information about the Gstreamer-bugs
mailing list