[libcamera-devel] libcamerasrc on librem 5: bayer support missing

Pavel Machek pavel at ucw.cz
Wed Dec 21 15:11:52 CET 2022


Hi!

> > > > This gets me going. I don't know how to pass details of bayer format,
> > > > so help would be welcome there.
> > > 
> > > 
> > >       video/x-bayer
> > >                  format: { (string)bggr, (string)grbg, (string)gbrg, (string)rggb }
> > > 
> > > 
> > > So in you case, create caps that looks like video/x-bayer, format=grbg, width=X,
> > > height=Y. Stride must match the Width * 4, cause there is no custom stride
> > > support yet.
> > 
> > Thanks for the hints. Should I add support for other bayer8 formats
> > and submit it for merge?
> 
> If you can get it working and tested - yes please?!

I can only test grbg8, but support for other 3 is fairly obvious.

> > +static const gchar *
> > +bayer_format_to_string(int format)
> > +{
> > +       switch (format) {
> > +       case formats::SGRBG8:
> > +               return "grbg";
> 
> I expect this string needs to mention that it's 8 bit. There could be
> 10bit, 12bit, 14bit, 16bit variations of this ...

Not really. Gstreamer does not support anything but 8 bit...

> > +++ b/src/gstreamer/gstlibcamerasrc.cpp
> > @@ -161,7 +161,7 @@ G_DEFINE_TYPE_WITH_CODE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT,
> >                         GST_DEBUG_CATEGORY_INIT(source_debug, "libcamerasrc", 0,
> >                                                 "libcamera Source"))
> >  
> > -#define TEMPLATE_CAPS GST_STATIC_CAPS("video/x-raw; image/jpeg")
x> > +#define TEMPLATE_CAPS GST_STATIC_CAPS("video/x-raw; video/x-bayer; image/jpeg")
> 
> If this is a prioritised list, I expect x-bayer should be after jpeg?
> But I'm not sure if it is...
> 
> And I wonder if the caps should be determined from the camera device anyway?

I don't believe it is prioritised, and won't pretend to understand the
dynamic negotiation, as this works with jpeg we should be fine.

Best regards,
      	       	      	   	     		     	 	       Pavel

-- 
People of Russia, stop Putin before his war on Ukraine escalates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20221221/f72559db/attachment.sig>


More information about the libcamera-devel mailing list