[FFmpeg-devel] [PATCH] Enable RGB32 on video4linux2 devices
Fri Sep 5 15:58:42 CEST 2008
On Fri, 05 Sep 2008 15:46:43 +0200, Luca Abeni wrote:
> Jean Delvare wrote:
> > My original patch wasn't correct, I realized it only after testing,
> > sorry about that. There are two factors which make this specific format
> > difficult to deal with:
> > * The RGB4 format is apparently not totally specified in the V4L2
> > standard. Some drivers think it means RGBA and others think it means
> > ARGB:
> > http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#PACKED-RGB
> > * The 32-bit RGB formats in ffmpeg depend on the host endianess. This
> > means that PIX_FMT_RGB32 isn't the same the same if ffmpeg runs on a
> > little-endian machine or a big-endian machine.
> Maybe these are the factors that confused me when I wrote the
> original code, suggesting to comment out the rgb32 format ;-)
> > There seems to be an alias which resolves to the correct format based
> > on the endianess: PIX_FMT_BGRA.
> Yes, I think BGRA should be what is needed here.
> > However I suspect it won't
> > work on big-endian machines, where it resolves to PIX_FMT_BGR32_1, due
> > to ffmpeg refusing to use PIX_FMT_BGR32_1 as an input pixel format:
> > swScaler: rgb32x is not supported as input pixel format
> Well, that's just swscaler not supporting this specific pixel format; it
> does not look like v4l2.c's fault. So, I think your patch is ok.
> I'll commit your patch later today, or tomorrow, as soon as I have some
Excellent. Thanks for your support!
More information about the ffmpeg-devel