hololink::module::VsyncInterfaceV1
hololink::module::VsyncInterfaceV1
Controls the VSYNC trigger that starts frames on a board’s cameras.
VSYNC is a timing pulse train sent to the cameras’ frame-start (external trigger) inputs, so that the cameras begin their frames together. Something has to generate those pulses; this interface is what a camera driver, or an application, needs in order to use whichever source is installed. PtpPpsOutputInterfaceV1 is the source currently provided, and the same object is available through both interfaces.
This interface does not configure the source: choosing the pulse rate and making the source ready (so that is_enabled() is true) is done through the source’s own interface. Here, a camera driver checks is_enabled() to decide whether to put its sensor in external-trigger mode, and the application calls start() once the cameras are ready and stop() when done.
Inherits from: hololink::module::Service< VsyncInterfaceV1 > (public)
Methods
is_enabled
Whether the source has been configured to produce pulses.
Camera drivers consult this while configuring, to decide whether to put their sensor in external-trigger mode. start() and stop() are only meaningful while this is true.
Returns: true if the source is configured; false otherwise.
start
Begin generating trigger pulses.
The application normally calls this once, after every camera has been put into external-trigger mode and is waiting, so that the first pulse reaches all of them at the same time. Calling it while pulses are already being generated has no effect. If the source is not enabled (see is_enabled()), no pulses are generated.
Returns: HOLOLINK_MODULE_OK on success, or an error status.
stop
Stop generating trigger pulses.
The source remains configured, so start() can resume the pulses. Calling it when no pulses are being generated has no effect.
Returns: HOLOLINK_MODULE_OK on success, or an error status.
module
The Module that this service was published from.
The service holds no strong reference to its Module, so this does not extend the Module’s lifetime.
Returns: The owning Module, or an empty pointer if the service has not been published or its Module no longer exists.
Static methods
get_service
Type-safe way to fetch a std::shared_ptr to an instance of <Derived> from a Module.
Note that Module usually caches instances, it’s likely that calls to get_service with the same locator_id will return pointers to the same implementation object.
Returns: A shared pointer to the service instance.
Parameters
Is the shared object that owns the instance we wish to fetch
Names the specific object, usually expressed as a set of “name=value;…” pairs, as defined by the implementations themselves. This name is normally fetched by calling Derived::locator_id(enumeration_metadata).
The default value of false causes this routine to throw a std::runtime_error if the service cannot be found within the module; this would be expected to terminate the calling program. If the application wants to handle the error, pass in true here and get_service will return nullptr when this module doesn’t provide the requested service.
for_each_type_id
Iterate over every type_id supported by this instance.
The callback signature is bool(const char*) — returning false halts the walk; true continues. Iteration is depth-first, so you’ll see the most specific implementation types first.