[libcamera-devel] Application requesting statistics buffers

Naushir Patuck naush at raspberrypi.com
Fri Jun 26 13:56:21 CEST 2020


Hi,

As part of the work (just submitted for review) on providing a focus
FoM to the application through libcamera controls, one of the options
I explored was to allow the application to explicitly request the ISP
statistics buffer along with the image frame through the usual Request
mechanism.  The Raspberry Pi pipeline handler is written with enough
flexibility to allow this to happen.  However, one thing missing is a
way for the application to request (and provide) the statistics buffer
as an explicit format.

In the v4l2 world, we have a specific format
(V4L2_META_FMT_BCM2835_ISP_STATS) for the ISP statistics buffer
defined.  In order to create a libcamera::format (from formats.yaml),
it seems I must have an equivalent DRM format defined.  However, from
what I can tell, DRM formats are not defined for metadata types, only
image data, is that correct?  Would it be reasonable for me to define
an equivalent DRM_FORMAT_BCM2835_ISP_STATS for this purpose?

This may seem a somewhat isolated use case, but I can see that some
specific applications could want to do their own analysis of the
statistics data for their purposes.  In this example, a user wanted to
create a microscope application...

Right now I will not worry about the other problem with this where the
application will have to provide a stats buffer on every Request,
similar to the problem with RAW captures - but a zero-copy mechanism
is in the works from what I can tell :)

Let me know your thoughts on how we can achieve this.

Regards,
Naush


More information about the libcamera-devel mailing list