[gst-devel] RGB caps

in7y118 at public.uni-hamburg.de in7y118 at public.uni-hamburg.de
Tue Nov 25 07:21:05 CET 2003


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);

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.

I hope there are no complaints.


Another thing:
What do you think is the best way to do RGBA? The easiest thing would be just 
adding an alpha_mask to the RGB caps and use prescaled RGB values (like cairo 
and fdo's new X visual do). That allows plugins to ignore the alpha part. That 
would just look as if the image was rendered on a black background.
The only thing that would break would be plugins rendering into the RGB buffer 
as if it were pure RGB _and_ not stripping the alpha_mask from the caps as 
that could lead to invalid data.
Other options to consider would be to use video/x-raw-rgba, non-prescaled 
video and/or a boolean property 'prescaled'.

Any opinions on that one?
Ronald? David? Someone else?


This rgb mess really annoyed me yesterday (or I wouldn't have touched 
ffmpeg)... ;)

Benjamin




More information about the gstreamer-devel mailing list