After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693175 - ffmpegcolorspace: endianness inconsistency with 16-bit RGB
ffmpegcolorspace: endianness inconsistency with 16-bit RGB
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.36
Other Linux
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-05 01:33 UTC by Alexander Nestorov
Modified: 2013-02-11 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Nestorov 2013-02-05 01:33:15 UTC
I'm running Gstreamer on a big endian embeded device (Samsung S3C6410) and the CMOS on the device (OV9650) is outputting buffers with bpp=16 and endianness=4321.

Is it normal that bpp=24 and bpp=32 have endianness=4321 but bpp=16 has endianness=1234?

I think that it might be causing an error while linking ffmpegcolorspace.

I'm not completely sure if this is a Gstreamer bug or a bug in my CMOS driver.
Comment 1 Youness Alaoui 2013-02-05 01:43:01 UTC
What Alexander means to say is that the caps for ffmpegcolorspace use big endian for 24 and 32 bpp, but little endian for 16 bpp as can be seen with gst-inspect : 
http://privatepaste.com/bac504a359

So the question is whether or not it's intentional or if there's a bug in ffmpegcolorspace which should use BIG_ENDIAN for bpp=16 instead of BYTE_ORDER. Or if it's normal and the problem is his camera driver which should be outputting little endian when it's capturing in 16 bpp.

      video/x-raw-rgb
                    bpp: 32
                  depth: 32
             endianness: 4321
                    ...
      video/x-raw-rgb
                    bpp: 16
                  depth: 16
             endianness: 1234
                    ...
Comment 2 Wim Taymans 2013-02-05 13:53:38 UTC
(In reply to comment #0)
> Is it normal that bpp=24 and bpp=32 have endianness=4321 but bpp=16 has
> endianness=1234?

24 and 32 bits are always big endian, we use the masks to say where the R,G,B is.

For 16 bits it depends on how the bytes are in memory. You need to look at how 16 bits are placed inside the memory by the driver and then put this in the endianness property.

ffmpegcolorspace can only handle the native endianness for 16 bits so it only exposes BYTE_ORDER.
Comment 3 Youness Alaoui 2013-02-05 19:55:00 UTC
(In reply to comment #2)
> (In reply to comment #0)
> > Is it normal that bpp=24 and bpp=32 have endianness=4321 but bpp=16 has
> > endianness=1234?
> 
> 24 and 32 bits are always big endian, we use the masks to say where the R,G,B
> is.
> 
> For 16 bits it depends on how the bytes are in memory. You need to look at how
> 16 bits are placed inside the memory by the driver and then put this in the
> endianness property.
> 
> ffmpegcolorspace can only handle the native endianness for 16 bits so it only
> exposes BYTE_ORDER.

Ok, in that case, I suggest ffmpegcolorspace should handle both. v4l2src has in its caps both endianness 1234 and 4321 for 16 bits rgb. And in the case of alex's device, he gets 4321 as output, but he can't link v4l2src to ffmpegcolorspace because of that (unless he forces a different bpp through a capsfilter).
I would then suggest adding a endianness conversion method to ffmpegcolorspace to allow it to convert the format properly.

p.s: I checked 1.0. All I see is RGB16, BGR16 (in videoconvert and v4l2src), but no way to determine if it's LE or BE. If v4l2 allows for specifying LE and BE formats in 16 bits, then v4l2src is missing something...
Comment 4 Tim-Philipp Müller 2013-02-06 14:21:17 UTC
Maybe I'm confused, but isn't it like this (in 1.0):

RGB16 = in bits inside an uint16_t: RRRR RGGG GGGB BBBB
BGR16 = in bits inside an uint16_t: BBBB BGGG GGGR RRRR

So basically both are a mirror image of each other, like LE/BE.

So if it's all expressed in terms of big endian:

BGR16 == BGR16_BE == RGB16_LE and
RGB16 == RGB16_BE == BGR16_LE

?
Comment 5 Wim Taymans 2013-02-06 14:44:34 UTC
No, our RGB16/15 and BGR16/15 are native endianness only, there is no LE/BE variant.
Comment 6 Sebastian Dröge (slomo) 2013-02-11 11:38:23 UTC
So let's close this?