[libcamera-devel] [PATCH] gstreamer: Add support for additional RGB formats

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Aug 24 11:47:41 CEST 2022


Quoting Laurent Pinchart (2022-08-24 10:25:09)
> On Wed, Aug 24, 2022 at 10:18:52AM +0100, Kieran Bingham wrote:
> > Quoting Umang Jain via libcamera-devel (2022-08-23 23:36:40)
> > > Hi Laurent,
> > > 
> > > Thank you for the patch.
> > > 
> > > On 8/24/22 12:08 AM, Laurent Pinchart via libcamera-devel wrote:
> > > > libcamerasrc only supports three RGB formats. Adding the other RGB
> > > > formats supported by libcamera is trivial, do so.
> > > >
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > > > ---
> > > > I haven't tested this yet as I don't have a board hooked up that can
> > > > capture these formats. If someone can test it with an OV5640 sensor on
> > > > an i.MX8MP, that would be great, otherwise I'll get to it in the not too
> > > > distant future.
> > > > ---
> > > >   src/gstreamer/gstlibcamera-utils.cpp | 14 +++++++++++++-
> > > >   1 file changed, 13 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
> > > > index c97c0d438de2..5a21a391c698 100644
> > > > --- a/src/gstreamer/gstlibcamera-utils.cpp
> > > > +++ b/src/gstreamer/gstlibcamera-utils.cpp
> > > > @@ -19,9 +19,21 @@ static struct {
> > > >       /* Compressed */
> > > >       { GST_VIDEO_FORMAT_ENCODED, formats::MJPEG },
> > > >   
> > > > -     /* RGB */
> > > > +     /* RGB16 */
> > > > +     { GST_VIDEO_FORMAT_RGB16, formats::RGB565 },
> > > > +
> > > > +     /* RGB24 */
> > > >       { GST_VIDEO_FORMAT_RGB, formats::BGR888 },
> > > >       { GST_VIDEO_FORMAT_BGR, formats::RGB888 },
> > > > +
> > > > +     /* RGB32 */
> > > > +     { GST_VIDEO_FORMAT_BGRx, formats::XRGB8888 },
> > > > +     { GST_VIDEO_FORMAT_RGBx, formats::XBGR8888 },
> > > > +     { GST_VIDEO_FORMAT_xBGR, formats::RGBX8888 },
> > > > +     { GST_VIDEO_FORMAT_xRGB, formats::BGRX8888 },
> > > > +     { GST_VIDEO_FORMAT_BGRA, formats::ARGB8888 },
> > > > +     { GST_VIDEO_FORMAT_RGBA, formats::ABGR8888 },
> > > > +     { GST_VIDEO_FORMAT_ABGR, formats::RGBA8888 },
> > > 
> > > I have individually cross referenced each entry with V4L2 pixel format 
> > > and seems correct to me,
> > > 
> > > Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> > 
> > I'll be happy to see this patch in and support extended.
> > 
> > What pixelformats do we support that are not supported by the gstreamer
> > element, or perhaps are not supported by gstreamer at all? Or are all
> > formats covered with this?
> 
> The above list covers all our RGB formats. I haven't checked the other
> ones.

It looks like these are the unsupported formats. I haven't looked to see
which are actually supported by Gstreamer, but if anyone wants to - this
is the list to add:

        R8, R10, R12
        RGB565_BE
        AVUY8888, XVUY8888
        NV42
        YVU422, YUV444, YVU444

        All raw formats. (I expect gstreamer won't handle RAW?)

Kieran

> 
> > All the above formats match my expectations with ordering.
> > 
> > Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > 
> > > >       { GST_VIDEO_FORMAT_ARGB, formats::BGRA8888 },
> > > >   
> > > >       /* YUV Semiplanar */
> 
> -- 
> Regards,
> 
> Laurent Pinchart


More information about the libcamera-devel mailing list