Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
usher_frame_timing.h File Reference

C interface for conservative frame-time estimation and EXIF evidence. More...

#include <stdbool.h>
#include <stdint.h>
#include "exifite.h"
Include dependency graph for usher_frame_timing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usher_frame_timing
 Timing evidence for one exposure, with microsecond uncertainty. More...

Functions

struct usher_frame_timing usher_frame_timing_estimate (uint64_t sequence, uint64_t sensor_ns, int64_t exposure_us, int64_t duration_us)
 Translate fresh sensor evidence into a cautious pose-alignment time.
bool usher_frame_document (const struct usher_frame_timing *timing, unsigned width, unsigned height, struct exif_document *document)
 Initialize capture EXIF for the JPEG encoded from this exposure.

Detailed Description

C interface for conservative frame-time estimation and EXIF evidence.

Camera timestamps use BOOTTIME while USHER pose history uses MONOTONIC. Preserve original sensor evidence and conversion uncertainty so a consumer can decline pose alignment instead of treating an estimate as a measurement. The implementation is C11; C++ camera code links through this stable C ABI.

Definition in file usher_frame_timing.h.

Function Documentation

◆ usher_frame_document()

bool usher_frame_document ( const struct usher_frame_timing * timing,
unsigned width,
unsigned height,
struct exif_document * document )

Initialize capture EXIF for the JPEG encoded from this exposure.

Parameters
[in]timingSame-exposure evidence, qualified or not.
widthActual encoded image width.
heightActual encoded image height.
[out]documentCaller-owned bounded destination; previous contents are replaced.
Returns
False for a null argument, invalid boot identity/dimensions or failed reservation.

The capture owner may add model-specific tags before serializing one APP1 payload. No filesystem operation, sidecar or feature-sized allocation is performed here. The consumer still checks boot, dimensions and timing bounds.

Warning
Embedded identity is not a checksum or calibrated timing measurement.

Definition at line 114 of file usher_frame_timing.c.

◆ usher_frame_timing_estimate()

struct usher_frame_timing usher_frame_timing_estimate ( uint64_t sequence,
uint64_t sensor_ns,
int64_t exposure_us,
int64_t duration_us )

Translate fresh sensor evidence into a cautious pose-alignment time.

Parameters
sequenceCamera sequence belonging to this exposure.
sensor_nsSensor timestamp in the local BOOTTIME domain.
exposure_usExposure duration in microseconds; accepted range 0..100000.
duration_usFrame duration in microseconds; accepted range 1..200000.
Returns
Original evidence plus an estimated midpoint and uncertainty, or unqualified defaults when clock sampling or plausibility checks fail.

Bracketing BOOTTIME with MONOTONIC samples avoids assuming equal clock origins, including after suspend. The returned record is a value, so callers can retain it with the exact frame without allocation or shared state.

Warning
Sensor timestamps must follow BOOTTIME. Frame duration is not a measured rolling-shutter readout time; this estimate alone proves neither shutter synchronization nor geolocation accuracy.

Definition at line 67 of file usher_frame_timing.c.