[1/5] controls: Add FrameWallClock control
diff mbox series

Message ID 20241206142742.7931-2-david.plowman@raspberrypi.com
State New
Headers show
Series
  • Implement wallclock timestamps for frames
Related show

Commit Message

David Plowman Dec. 6, 2024, 2:27 p.m. UTC
Add a FrameWallClock control that reports the same moment as the
frame's SensorTimestamp, but in wallclock units.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/libcamera/control_ids_core.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Kieran Bingham Dec. 6, 2024, 2:48 p.m. UTC | #1
Quoting David Plowman (2024-12-06 14:27:38)
> Add a FrameWallClock control that reports the same moment as the
> frame's SensorTimestamp, but in wallclock units.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  src/libcamera/control_ids_core.yaml | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> index d45cf8e5..d951b2a3 100644
> --- a/src/libcamera/control_ids_core.yaml
> +++ b/src/libcamera/control_ids_core.yaml
> @@ -971,4 +971,18 @@ controls:
>        description: |
>          Enable or disable the debug metadata.
>  
> +  - FrameWallClock:
> +      type: int64_t
> +      description: |
> +        This timestamp corresponds to the same moment in time as the
> +        SensorTimestamp, but is represented as a wall clock time as measured by
> +        the Linux-specific CLOCK_REALTIME clock id.
> +
> +        Being a wall clock measurement, it can be used to synchronise timing
> +        across different devices.
> +
> +        \sa SensorTimestamp
> +
> +        The FrameWallClock control can only be returned in metadata.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> +
>  ...
> -- 
> 2.39.5
>
Naushir Patuck Dec. 12, 2024, 12:37 p.m. UTC | #2
Hi David,

On Fri, 6 Dec 2024 at 14:27, David Plowman
<david.plowman@raspberrypi.com> wrote:
>
> Add a FrameWallClock control that reports the same moment as the
> frame's SensorTimestamp, but in wallclock units.
>
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>

> ---
>  src/libcamera/control_ids_core.yaml | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> index d45cf8e5..d951b2a3 100644
> --- a/src/libcamera/control_ids_core.yaml
> +++ b/src/libcamera/control_ids_core.yaml
> @@ -971,4 +971,18 @@ controls:
>        description: |
>          Enable or disable the debug metadata.
>
> +  - FrameWallClock:
> +      type: int64_t
> +      description: |
> +        This timestamp corresponds to the same moment in time as the
> +        SensorTimestamp, but is represented as a wall clock time as measured by
> +        the Linux-specific CLOCK_REALTIME clock id.
> +
> +        Being a wall clock measurement, it can be used to synchronise timing
> +        across different devices.
> +
> +        \sa SensorTimestamp
> +
> +        The FrameWallClock control can only be returned in metadata.
> +
>  ...
> --
> 2.39.5
>
Laurent Pinchart Dec. 18, 2024, 1:23 a.m. UTC | #3
Hi David,

Thank you for the patch.

On Fri, Dec 06, 2024 at 02:27:38PM +0000, David Plowman wrote:
> Add a FrameWallClock control that reports the same moment as the
> frame's SensorTimestamp, but in wallclock units.
> 
> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> ---
>  src/libcamera/control_ids_core.yaml | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> index d45cf8e5..d951b2a3 100644
> --- a/src/libcamera/control_ids_core.yaml
> +++ b/src/libcamera/control_ids_core.yaml
> @@ -971,4 +971,18 @@ controls:
>        description: |
>          Enable or disable the debug metadata.
>  
> +  - FrameWallClock:
> +      type: int64_t
> +      description: |
> +        This timestamp corresponds to the same moment in time as the
> +        SensorTimestamp, but is represented as a wall clock time as measured by
> +        the Linux-specific CLOCK_REALTIME clock id.

s/ id//

CLOCK_REALTIME is not Linux-specific, it's a POSIX clock, so you can
write "by the CLOCK_REALTIME clock".

> +
> +        Being a wall clock measurement, it can be used to synchronise timing
> +        across different devices.
> +
> +        \sa SensorTimestamp
> +
> +        The FrameWallClock control can only be returned in metadata.

Once Paul's ControlId series lands, this sentence should be replaced
with

      direction: out

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

> +
>  ...
David Plowman Dec. 18, 2024, 12:07 p.m. UTC | #4
Hi Laurent

Thanks for the review.

On Wed, 18 Dec 2024 at 01:23, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi David,
>
> Thank you for the patch.
>
> On Fri, Dec 06, 2024 at 02:27:38PM +0000, David Plowman wrote:
> > Add a FrameWallClock control that reports the same moment as the
> > frame's SensorTimestamp, but in wallclock units.
> >
> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
> > ---
> >  src/libcamera/control_ids_core.yaml | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
> > index d45cf8e5..d951b2a3 100644
> > --- a/src/libcamera/control_ids_core.yaml
> > +++ b/src/libcamera/control_ids_core.yaml
> > @@ -971,4 +971,18 @@ controls:
> >        description: |
> >          Enable or disable the debug metadata.
> >
> > +  - FrameWallClock:
> > +      type: int64_t
> > +      description: |
> > +        This timestamp corresponds to the same moment in time as the
> > +        SensorTimestamp, but is represented as a wall clock time as measured by
> > +        the Linux-specific CLOCK_REALTIME clock id.
>
> s/ id//
>
> CLOCK_REALTIME is not Linux-specific, it's a POSIX clock, so you can
> write "by the CLOCK_REALTIME clock".

Will do!

>
> > +
> > +        Being a wall clock measurement, it can be used to synchronise timing
> > +        across different devices.
> > +
> > +        \sa SensorTimestamp
> > +
> > +        The FrameWallClock control can only be returned in metadata.
>
> Once Paul's ControlId series lands, this sentence should be replaced
> with
>
>       direction: out

Yep, let's see which patch gets there first!!

Thanks
David

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

Patch
diff mbox series

diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml
index d45cf8e5..d951b2a3 100644
--- a/src/libcamera/control_ids_core.yaml
+++ b/src/libcamera/control_ids_core.yaml
@@ -971,4 +971,18 @@  controls:
       description: |
         Enable or disable the debug metadata.
 
+  - FrameWallClock:
+      type: int64_t
+      description: |
+        This timestamp corresponds to the same moment in time as the
+        SensorTimestamp, but is represented as a wall clock time as measured by
+        the Linux-specific CLOCK_REALTIME clock id.
+
+        Being a wall clock measurement, it can be used to synchronise timing
+        across different devices.
+
+        \sa SensorTimestamp
+
+        The FrameWallClock control can only be returned in metadata.
+
 ...