hololink::module::FrameMetadataInterfaceV1
hololink::module::FrameMetadataInterfaceV1
Decode the block of metadata the device sends with each frame.
Along with a frame’s data, the device transmits a block of metadata associated with that frame. A receiver reserves block_size() bytes for the block when it sizes the buffer it receives frames into, then passes the received block to decode() to read the values out of it.
The device writes the block in its own layout; use this service to deserialize it.
Inherits from: hololink::module::Service< FrameMetadataInterfaceV1 > (public)
Methods
block_size
The size of a frame’s metadata block, in bytes.
A receiver adds this to the space it reserves for each frame, and hands decode() a block this size. The value doesn’t change while the service is in use.
Returns: Size of the metadata block, in bytes.
decode
Deserialize received frame metadata into out_metadata.
Returns: HOLOLINK_MODULE_OK, or HOLOLINK_MODULE_INVALID_PARAMETER when fewer than block_size() bytes are available at host_memory.
Parameters
The metadata block received with a frame, in host memory.
Bytes available at host_memory.
What the device reported about the frame.
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
Overload 1
Overload 2
Fetch a module’s FrameMetadataInterfaceV1 instance.
Returns: The module’s frame metadata service.
Throws: std::runtime_error if the module publishes no frame metadata service and allow_null is false.
Parameters
The module that claims the device, from Adapter::get_module.
Return an empty pointer, rather than throwing, when the module publishes no frame metadata 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.
Inner classes
FrameMetadata
What the device reported about one received frame.