[libcamera-devel] Accessing all available framesizes to display in qcam

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jun 10 10:37:27 CEST 2019


On Mon, Jun 10, 2019 at 08:56:05AM +0200, Jacopo Mondi wrote:
> Hello H,
> 
> On Sat, Jun 08, 2019 at 07:51:47PM -0700, Your Name wrote:
> > Hello,
> >  I am trying to access all the frame sizes that are available in order
> >  to list it out in qcam as a drop down menu. When I try to add the
> >  following code in v4l2_device.cpp inside int V4L2Device:open()
> >
> > 	struct v4l2_frmsizeenum v4l2frmsizeenum = {};
> > 	ret = ioctl(fd_,VIDIOC_ENUM_FRAMESIZES,&v4l2frmsizeenum);
> >  The ret value comes out to be -1 indicating an error with ioctl.
> >
> >  The standard
> > 	ret = ioctl(fd_, VIDIOC_QUERYCAP, &caps_);
> >  seems to work just fine.
> 
> It's pretty hard to provide any meaningful suggestion without seeing
> any of the code or the complete error messages :)
> 
> >
> >  Is there something specific in v4l2 that I am missing to query all the
> >  frame sizes? It would be better if it's located somewhere else in the
> >  libcamera repo.
> >
> 
> Format enumeration is currently in development. Kieran sent a series a
> month ago where format enumeration was introduced as a V4L2Device
> operation:
> https://lists.libcamera.org/pipermail/libcamera-devel/2019-May/002737.html
> 
> That series is now replaced by one from Niklas which is in review and
> where support for size and format enumerations is implemented as well:
> "[PATCH 00/17] libcamera: Add support for format information and validation"
> 
> You can have a look at how enumeration is implemented there and
> compare it with your code.
> 
> >  I am learning how to help with open source development. I can reformat
> >  the message if you think it is more appropriate.
> >
> >  I am using Logitech HD Pro Webcam C920 on ubuntu 18.04.
> 
> Message is fine (if "Your Name" in the subject was intentional :)

Please note that we require a real name for contributions, to identify
the person signing the patch, as per the developer certificate of
origin.

> It's nice having people testing with multiple cameras, so keep
> experimenting and maybe try to apply one of the above two series and see
> what happens.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list