[libcamera-devel,v12,1/3] libcamera: controls: Add frame duration control
diff mbox series

Message ID 20210119153047.468190-1-naush@raspberrypi.com
State Accepted
Headers show
Series
  • [libcamera-devel,v12,1/3] libcamera: controls: Add frame duration control
Related show

Commit Message

Naushir Patuck Jan. 19, 2021, 3:30 p.m. UTC
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@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/control_ids.yaml | 36 ++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Laurent Pinchart Jan. 20, 2021, 11:50 a.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Tue, Jan 19, 2021 at 03:30:45PM +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@raspberrypi.com>
> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
> Tested-by: David Plowman <david.plowman@raspberrypi.com>
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> ---
>  src/libcamera/control_ids.yaml | 36 ++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> index 6d6f0fee508b..36c37161a3d5 100644
> --- a/src/libcamera/control_ids.yaml
> +++ b/src/libcamera/control_ids.yaml
> @@ -306,6 +306,42 @@ 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.

s/micro-seconds/microseconds/

(The indentation should be 2 spaces btw)

I'll handle this when applying.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +
> +          When provided by applications, the control specifies the sensor frame
> +          duration interval the pipeline has to use. This limits the 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. Setting both values to 0 reverts to using the
> +          IPA provided defaults.
> +
> +          The maximum frame duration provides the absolute limit to the shutter
> +          speed computed by the AE algorithm and it overrides any exposure mode
> +          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. When reported in
> +          metadata, the control expresses the minimum and maximum frame
> +          durations used after being clipped to the sensor provided frame
> +          duration limits.
> +
> +          \sa AeExposureMode
> +          \sa ExposureTime
> +
> +          \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).
> +
> +          \todo Provide an explicit definition of default control values, for
> +          this and all other controls.
> +      size: [2]
> +
>    # ----------------------------------------------------------------------------
>    # Draft controls section
>
Naushir Patuck Jan. 20, 2021, 11:54 a.m. UTC | #2
Hi Laurent,


On Wed, 20 Jan 2021 at 11:50, Laurent Pinchart <
laurent.pinchart@ideasonboard.com> wrote:

> Hi Naush,
>
> Thank you for the patch.
>
> On Tue, Jan 19, 2021 at 03:30:45PM +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@raspberrypi.com>
> > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
> > Tested-by: David Plowman <david.plowman@raspberrypi.com>
> > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> > ---
> >  src/libcamera/control_ids.yaml | 36 ++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >
> > diff --git a/src/libcamera/control_ids.yaml
> b/src/libcamera/control_ids.yaml
> > index 6d6f0fee508b..36c37161a3d5 100644
> > --- a/src/libcamera/control_ids.yaml
> > +++ b/src/libcamera/control_ids.yaml
> > @@ -306,6 +306,42 @@ 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.
>
> s/micro-seconds/microseconds/
>
> (The indentation should be 2 spaces btw)
>
> I'll handle this when applying.
>

Thank you!  Apologies that I missed fixing those typos you pointed out
earlier.

Regards,
Naush


>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>

> > +
> > +          When provided by applications, the control specifies the
> sensor frame
> > +          duration interval the pipeline has to use. This limits the
> 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. Setting both values to 0 reverts to
> using the
> > +          IPA provided defaults.
> > +
> > +          The maximum frame duration provides the absolute limit to the
> shutter
> > +          speed computed by the AE algorithm and it overrides any
> exposure mode
> > +          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. When reported
> in
> > +          metadata, the control expresses the minimum and maximum frame
> > +          durations used after being clipped to the sensor provided
> frame
> > +          duration limits.
> > +
> > +          \sa AeExposureMode
> > +          \sa ExposureTime
> > +
> > +          \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).
> > +
> > +          \todo Provide an explicit definition of default control
> values, for
> > +          this and all other controls.
> > +      size: [2]
> > +
> >    #
> ----------------------------------------------------------------------------
> >    # Draft controls section
> >
>
> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart Jan. 20, 2021, 12:16 p.m. UTC | #3
Hi Naush,

On Wed, Jan 20, 2021 at 11:54:38AM +0000, Naushir Patuck wrote:
> On Wed, 20 Jan 2021 at 11:50, Laurent Pinchart wrote:
> > On Tue, Jan 19, 2021 at 03:30:45PM +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@raspberrypi.com>
> > > Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
> > > Tested-by: David Plowman <david.plowman@raspberrypi.com>
> > > Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> > > ---
> > >  src/libcamera/control_ids.yaml | 36 ++++++++++++++++++++++++++++++++++
> > >  1 file changed, 36 insertions(+)
> > >
> > > diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
> > > index 6d6f0fee508b..36c37161a3d5 100644
> > > --- a/src/libcamera/control_ids.yaml
> > > +++ b/src/libcamera/control_ids.yaml
> > > @@ -306,6 +306,42 @@ 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.
> >
> > s/micro-seconds/microseconds/
> >
> > (The indentation should be 2 spaces btw)
> >
> > I'll handle this when applying.
> 
> Thank you!  Apologies that I missed fixing those typos you pointed out
> earlier.

No worries at all. I've now pushed the series.

> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > > +
> > > +          When provided by applications, the control specifies the sensor frame
> > > +          duration interval the pipeline has to use. This limits the 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. Setting both values to 0 reverts to using the
> > > +          IPA provided defaults.
> > > +
> > > +          The maximum frame duration provides the absolute limit to the shutter
> > > +          speed computed by the AE algorithm and it overrides any exposure mode
> > > +          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. When reported in
> > > +          metadata, the control expresses the minimum and maximum frame
> > > +          durations used after being clipped to the sensor provided frame
> > > +          duration limits.
> > > +
> > > +          \sa AeExposureMode
> > > +          \sa ExposureTime
> > > +
> > > +          \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).
> > > +
> > > +          \todo Provide an explicit definition of default control values, for
> > > +          this and all other controls.
> > > +      size: [2]
> > > +
> > >    # ----------------------------------------------------------------------------
> > >    # Draft controls section
> > >

Patch
diff mbox series

diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index 6d6f0fee508b..36c37161a3d5 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -306,6 +306,42 @@  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 limits the 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. Setting both values to 0 reverts to using the
+          IPA provided defaults.
+
+          The maximum frame duration provides the absolute limit to the shutter
+          speed computed by the AE algorithm and it overrides any exposure mode
+          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. When reported in
+          metadata, the control expresses the minimum and maximum frame
+          durations used after being clipped to the sensor provided frame
+          duration limits.
+
+          \sa AeExposureMode
+          \sa ExposureTime
+
+          \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).
+
+          \todo Provide an explicit definition of default control values, for
+          this and all other controls.
+      size: [2]
+
   # ----------------------------------------------------------------------------
   # Draft controls section