[gst-devel] RGB caps

David Schleef ds at schleef.org
Tue Nov 25 13:58:05 CET 2003


On Tue, Nov 25, 2003 at 04:20:16PM +0100, in7y118 at public.uni-hamburg.de wrote:
> While fixing ffcolorspace and ximagesink to work with RGB caps on LE and BE 
> machines, I did the following things/changes and am going to update 
> docs/random/mimetypes:
> - drop endianness. It's always G_BIG_ENDIAN.
> - drop depth. It's always depth == bpp.
> - masks are always host-endian. To get the red part of a pixel, use code like 
> this: red_part = pixel & GINT_TO_BE (red_mask);

1) 16 bit formats truly do have a endianness, since the green bits are
split between the bytes.

2) depth is not the same as bpp.

3) Changing masks to be host-endian goes against the second statement
below.

> Reasons for this:
> - There should never be the possibility to specify the same format with 
> different caps. (endianness and depth allowed this with adapting the masks.)
> - gst_caps_to_string must result in the same string for the same format on any 
> machine. Storing masks as real masks would break that.

The current system already guarantees both of these.

I have no problems with changing to a new standard for video/x-raw-rgb,
but the standard needs to be well-thought out and documented.



dave...





More information about the gstreamer-devel mailing list