[libcamera-devel] [PATCH v10 1/3] libcamera: controls: Add frame duration control

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Dec 20 06:38:29 CET 2020


Hi Naush,

Thank you for the patch.

On Fri, Dec 18, 2020 at 10:06:25AM +0000, Naushir Patuck wrote:
> Add an int64_t array control (controls::FrameDurations) to specify the
> minimum and maximum (in that order) frame duration to be used by the
> camera sensor.
> 
> Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
> Reviewed-by: David Plowman <david.plowman at raspberrypi.com>
> Tested-by: David Plowman <david.plowman at raspberrypi.com>
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
>  src/libcamera/control_ids.yaml | 41 ++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index 6d6f0fee..a58bff18 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -306,6 +306,47 @@ controls:
>          maximum valid value is given by the properties::ScalerCropMaximum
>          property, and the two can be used to implement digital zoom.
>  
> +  - FrameDurations:
> +      type: int64_t
> +      description: |
> +          The minimum and maximum (in that order) frame duration,
> +          expressed in micro-seconds.
> +
> +          When provided by applications, the control specifies the sensor frame
> +          duration interval the pipeline has to use. This could also limit the

s/could also limit/limits/ ?

> +          largest exposure time the sensor can use. For example, if a maximum
> +          frame duration of 33ms is requested (corresponding to 30 frames per
> +          second), the sensor will not be able to raise the exposure time above
> +          33ms. A fixed frame duration is achieved by setting the minimum and
> +          maximum values to be the same.
> +
> +          The maximum frame duration provides the absolute limit to the shutter
> +          speed computed by the AE algorithm and it overrides any exposure mode

I think we should talk about exposure time instead of shutter speed, but
we'll need to go through the whole documentation and code base to ensure
consistency, so this can be done later.

> +          setting specified with controls::AeExposureMode. Similarly, when a
> +          manual exposure time is set through controls::ExposureTime, it also
> +          gets clipped to the limits set by this control.
> +
> +          \sa AeExposureMode
> +          \sa ExposureTime
> +
> +          \todo Refer to the frame duration limits property to describe how
> +          application-provided values gets clipped and reset.
> +
> +          When reported by pipelines, the control expresses the minimum and

Is this about Request::metadata(), or Camera::properties() ? I assume
the former as it's defined in control_ids.yaml.

> +          maximum frame durations used after being clipped to what the current
> +          sensor mode supports, and what is achievable based on the exposure
> +          mode setting specified with controls::AeExposureMode or manual
> +          exposure time set through controls::ExposureTime. The sensor frame

I have a hard time parsing this, and a hard time seeing how it should be
used by applications :-S Do you need this for your use cases ?

> +          duration is one of the parameter that defines the capture frame rate
> +          but it does not alone provide enough information to fully calculate it
> +          as it does not account for pipeline processing delays.

Delays in the pipeline don't affect the frame duration, do they ? We
could drop frames when processing streams in software (for instance for
JPEG compression), but that's out of scope as libcamera doesn't support
that.

> +
> +          \todo Define how to calculate the capture frame rate by
> +          defining controls to report additional delays introduced by
> +          the capture pipeline or post-processing stages (ie JPEG
> +          conversion, frame scaling).
> +      size: [2]
> +
>    # ----------------------------------------------------------------------------
>    # Draft controls section
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list