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

Jacopo Mondi jacopo at jmondi.org
Mon Jun 10 08:56:05 CEST 2019


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 :)

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.

Thanks
   j

>
>  Thanks,
>  H
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20190610/e6f9a11d/attachment.sig>


More information about the libcamera-devel mailing list