Loading...
Searching...
No Matches
CaptureCorrelator.hpp File Reference

Assembles one CaptureFrameSet out of several independent capture threads, for a rig whose sensors are separate V4L2 devices. More...

Detailed Description

Assembles one CaptureFrameSet out of several independent capture threads, for a rig whose sensors are separate V4L2 devices.

CaptureSyncGroup::publish() writes every member of a set and bumps the generation in one call, which suits a device that hands over all its sensors from a single capture – Argus' multi-sensor session, an SDI card with several inputs. Two USB or CSI cameras are not that: each has its own file descriptor, its own thread and its own arrival time, and two threads calling publish() would interleave halves of different captures into one set.

This is the piece in front of the group that turns N independent arrivals into one publication. Each thread offers its own member and nothing else; the offer that completes the row publishes it.

Pairing is by arrival, not by timestamp. On a frequency-locked rig – sensors sharing a clock, which is the case this exists for – consecutive arrivals correspond, and the eyes sit a constant offset apart that no amount of matching will remove. Timestamps are carried through so the group can report the skew that actually occurred rather than the skew the hardware promised.

A member that outruns its partners displaces its own previous offer: the older frame can no longer belong to any set, and its slot is handed straight back to the caller for requeueing. Holding it instead would starve the driver of buffers, which presents as a stall rather than as a drop.

Only complete rows are published. A member that stops delivering therefore holds the whole rig, which is deliberate twice over: it is what a rig means, and CaptureSyncGroup::take() serves only the newest complete set anyway. Publishing partial rows would not keep the live members going – it would advance the group's generation while the newest complete one stood still, and once that gap reaches the ring depth the last good set is treated as lapped and every member goes dark. displacedFrames() climbing at the frame rate is what the stall looks like from here.

Go to the source code of this file.

Classes

class  score::gfx::interop::CaptureCorrelator
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.