|
VLink 2.0.0
A high-performance communication middleware
|
Functions | |
| struct | VLINK_EXPORT_AND_ALIGNED (8) CameraFrame final |
|
final |
Pixel/codec encoding format of the image payload.
Values 1-12 describe uncompressed planar/packed formats. Values 101-103 describe compressed codec formats. Pass to set_format() and read via format().
< Unknown or uninitialised format.
< Planar YUV 4:2:0 (I420).
< Planar YUV 4:2:2.
< Planar YUV 4:4:4.
< Semi-planar YUV 4:2:0 (Y + interleaved UV).
< Semi-planar YUV 4:2:0 (Y + interleaved VU).
< Packed YUYV 4:2:2.
< Packed YVYU 4:2:2.
< Packed UYVY 4:2:2.
< Packed VYUY 4:2:2.
< Packed 24-bit BGR (3 bytes/pixel).
< Packed 24-bit RGB (3 bytes/pixel).
< Planar 24-bit RGB (separate R, G, B planes).
< JPEG compressed image.
< H.264 / AVC compressed video frame.
< H.265 / HEVC compressed video frame.
Video stream frame type for compressed formats.
Relevant when format() is kFormatH264 or kFormatH265. Set via set_stream(); read via stream().
< Unknown stream type.
< I-frame (intra-coded, key frame).
< P-frame (predicted from previous frame).
< B-frame (bi-directionally predicted).
Default constructor.
Verifies via static_assert that the struct is exactly 80 bytes on 64-bit platforms. 32-bit architectures emit a compile-time warning.
Destructor – frees the owned pixel buffer if is_owner() is true.
Copy constructor – performs a deep copy of target.
| target | Source frame to copy. |
Move constructor – transfers ownership from target.
After the call target is empty and does not own any buffer.
| target | Source frame to move from. |
Copy-assignment operator – deep-copies target.
| target | Source frame to copy. Self-assignment is a no-op. |
*this.Move-assignment operator – transfers ownership from target.
| target | Source frame to move. Self-assignment is a no-op. |
*this.Deserialises a CameraFrame from a Bytes wire buffer.
Validates the magic-number envelope, copies the struct header, and sets the pixel data pointer to reference memory inside bytes (zero-copy). is_owner() will be false after a successful call; bytes must outlive this CameraFrame.
| bytes | Buffer produced by operator>>. |
true on success, false if the buffer fails validation or the total size is inconsistent.Serialises this CameraFrame into a Bytes wire buffer.
Writes the magic-number envelope, struct fields, and pixel payload into bytes, resizing it if necessary.
| bytes | Output buffer (reallocated automatically if needed). |
true.Checks whether bytes contains a valid CameraFrame wire buffer.
Verifies minimum size and both magic-number sentinels.
| bytes | Buffer to validate. |
true if the sentinels match and the size is sufficient.Returns the total serialised byte count for this frame.
Equals: sizeof(magic_begin) + sizeof(CameraFrame) + size() + sizeof(magic_end)
operator>>.Returns true when the pixel buffer is present and non-empty.
true if data() is non-null and size() > 0.Borrows the pixel buffer from target without copying.
Sets metadata and data pointer to match target; is_owner() becomes false. Any previously owned buffer is freed first.
| target | Source frame to borrow from. |
false if target == *this, otherwise true.Deep-copies the pixel buffer from target.
If *this already owns a same-size buffer the data is copied in-place; otherwise a new buffer is allocated.
| target | Source frame to copy. |
false if target == *this, otherwise true.Transfers ownership from target to *this.
After the call target is empty. Self-move is a no-op.
| target | Source frame to move from. |
false if target == *this, otherwise true.Allocates an owned pixel buffer of size bytes.
Frees any existing owned buffer before allocating the new one. Buffer content is uninitialised after the call.
| size | Number of bytes to allocate. Must be non-zero. |
false if size is zero, otherwise true.Releases all resources and zeroes all fields including header.
Borrows an external raw pixel pointer without copying.
Sets the internal data pointer to data with is_owner() == false. The caller is responsible for the buffer lifetime.
| data | Non-null pointer to pixel data. |
| size | Size of the buffer in bytes. |
false on invalid arguments or if the pointer is unchanged.Deep-copies pixel data from a raw pointer.
Allocates or reuses an owned buffer and copies size bytes from data.
| data | Source pixel data pointer. Must be non-null. |
| size | Number of bytes to copy. Must be non-zero. |
false on invalid arguments, otherwise true.Alias for deep_copy(uint8_t*, size_t).
| data | Source pointer. |
| size | Number of bytes. |
deep_copy call.Returns the camera channel (sensor index).
set_channel().Returns the image width in pixels.
set_width().Returns the image height in pixels.
set_height().Returns the capture frequency in Hz.
set_freq().Returns the pixel/codec encoding format.
Format value set by set_format().Returns the video stream frame type.
Stream value set by set_stream().Returns a read-only pointer to the pixel data buffer.
nullptr if the frame is empty.Returns the pixel buffer size in bytes.
Returns true if this object owns its pixel buffer.
An owned buffer is freed in the destructor. Borrowed buffers (created by shallow_copy or operator<<) are not freed.
true when memory ownership is held.Sets the camera channel (sensor index).
| channel | Channel identifier. |
Sets the image width in pixels.
| width | Pixel width of the image. |
Sets the image height in pixels.
| height | Pixel height of the image. |
Sets the capture frequency in Hz.
| freq | Capture rate in frames per second. |
Sets the pixel/codec encoding format.
| format | One of the Format enum values. |
Sets the video stream frame type.
| stream | One of the Stream enum values. |
Gets the reserved field.
< Sequencing and timestamp metadata for this frame.
Internal
< Frame identifier; semantics defined by the producing sensor.
< Monotonically increasing sequence number, wraps at UINT32_MAX.
< Reserved for future use; must be zero.
< Measurement timestamp in nanoseconds since epoch.
< Publish timestamp in nanoseconds since epoch.
Default constructor.
Verifies via static_assert that the struct is exactly 40 bytes on 64-bit platforms (the check is omitted on 32-bit architectures).
Default constructor.
Verifies via static_assert that the struct is exactly 80 bytes on 64-bit platforms.
Destructor – frees the owned tail buffer if is_owner() is true.
Copy constructor – deep-copies target.
| target | Source to copy. |
Move constructor – transfers ownership from target.
After the call target is empty and does not own any buffer.
| target | Source to move from. |
Copy-assignment operator.
| target | Source to copy. Self-assignment is a no-op. |
*this.Move-assignment operator.
| target | Source to move. Self-assignment is a no-op. |
*this.Deserialises a ProxyData from a Bytes wire buffer.
Validates magic-number sentinels and the internal region layout (positions and sizes must be contiguous and sum to size_). The tail buffer pointer references memory inside bytes (zero-copy); bytes must outlive this ProxyData.
| bytes | Buffer produced by operator>>. |
true on success; false on magic-number mismatch, size inconsistency, or invalid region layout.Serialises this ProxyData into a Bytes wire buffer.
Writes the magic-number envelope, the struct fields, and the tail payload into bytes, resizing it as needed.
| bytes | Output buffer (reallocated automatically if necessary). |
true.Returns the proxy control identifier.
set_control_id().Returns the proxy operation mode.
set_mode().Returns the message timestamp in microseconds.
set_timestamp().Returns the message sequence number.
set_seq().Returns the coarse schema family carried with this payload.
SchemaType value stored by set_schema().Returns a shallow Bytes view of the raw message payload.
The returned Bytes points into the internal tail buffer without copying. It must not outlive this ProxyData.
Bytes of the raw payload, or empty if not set.Returns the topic URL as a string_view.
Points into the internal tail buffer. Lifetime is tied to this object.
Returns the serialisation type string as a string_view.
For example "demo.proto.PointCloud" or "demo.fbs.CameraFrame". Points into the internal tail buffer.
Returns the source hostname as a string_view.
Optional field; empty if not provided to create(). Points into the internal tail buffer.
Sets the proxy control identifier.
| control_id | Control identifier value. |
Sets the proxy operation mode.
| mode | Mode value. |
Sets the message timestamp in microseconds.
| timestamp | Timestamp value (microseconds since epoch). |
Sets the message sequence number.
| seq | Sequence number. |
Sets the coarse schema family associated with the payload.
| schema | Numeric SchemaType value. |
Checks whether bytes contains a valid ProxyData wire buffer.
Verifies minimum buffer size and both magic-number sentinels.
| bytes | Buffer to validate. |
true if magic numbers match and size is sufficient.Returns the total serialised byte count for this ProxyData.
Equals: sizeof(magic_begin) + sizeof(ProxyData) + size() + sizeof(magic_end)
operator>>.Returns true when all internal region positions and sizes are consistent.
Checks that raw, url, ser, and hostname regions are contiguous and that their combined size equals the tail buffer size. Also requires a non-null data pointer and non-zero total size.
true when the object holds valid, usable data.Borrows the tail buffer from target without copying.
Sets metadata and pointer to match target; is_owner() becomes false. Any previously owned buffer is freed.
| target | Source to borrow from. |
false if target == *this, otherwise true.Deep-copies the tail buffer from target.
Allocates a new buffer of the same size and copies the payload. If *this already owns a same-size buffer the data is copied in-place.
| target | Source to copy. |
false if target == *this, otherwise true.Transfers ownership from target to *this.
After the call target is empty.
| target | Source to move from. |
false if target == *this, otherwise true.Constructs the envelope by packing all fields into a single allocation.
Allocates a buffer of size raw.size() + url.size() + ser.size() + hostname.size() and copies each region in order. Any previously owned buffer is freed first.
| raw | Raw serialised message payload. |
| url | Topic URL string (e.g., "dds://my/topic"). |
| ser | Serialisation type (e.g., "demo.proto.PointCloud"). |
| schema | Coarse schema family, typically a SchemaType value. |
| hostname | Optional source hostname; empty if not provided. |
Releases all resources and resets all fields to zero.
Returns the total tail buffer size in bytes.
Equals the sum of the raw payload, URL, serialisation type, and hostname sizes.
Returns true if this object owns its tail buffer.
Owned buffers are freed in the destructor. Borrowed buffers (from shallow_copy or operator<<) are not freed.
true when memory ownership is held.Internal
Default constructor.
Verifies via static_assert that the struct is exactly 64 bytes on 64-bit platforms. 32-bit architectures emit a compile-time warning.
Destructor.
Frees the owned data buffer if is_owner() is true.
Copy constructor.
Performs a deep copy of target, allocating a new buffer and copying the payload.
| target | Source to copy from. |
Move constructor.
Transfers ownership from target. After the call target is empty and no longer owns any buffer.
| target | Source to move from. |
Copy-assignment operator.
Deep-copies target into *this. Self-assignment is a no-op.
| target | Source to copy from. |
*this.Move-assignment operator.
Transfers ownership from target into *this. Self-assignment is a no-op. After the call target is empty.
| target | Source to move from. |
*this.Deserialises a RawData from a Bytes wire buffer.
Validates the magic-number envelope, then memcpy's the struct fields from the buffer. The internal data pointer is set to point directly into bytes (zero-copy, is_owner() == false). The caller must ensure bytes outlives this RawData.
| bytes | Serialised buffer produced by operator>>. |
true on success, false if the buffer is invalid or the total size does not match get_serialized_size().Serialises this RawData into a Bytes wire buffer.
Writes the magic-number envelope, the struct fields, and the payload into bytes. If bytes is the wrong size it is reallocated automatically.
| bytes | Output buffer (resized if necessary). |
true.Checks whether bytes contains a valid RawData wire format.
Verifies that the buffer is large enough and that both the begin and end magic numbers match the expected constants.
| bytes | Buffer to check. |
true if the magic numbers are present and the minimum size constraint is satisfied.Returns the total serialised byte count for this RawData.
Computed as:
operator>> will write.Returns true if the data pointer is non-null and the size is non-zero.
true when there is a valid payload available.Borrows (shallow-copies) the payload from another RawData.
Sets the internal pointer to the same buffer as target without copying data. is_owner() becomes false. The source must outlive this object. Any previously owned buffer is freed first.
| target | Source to borrow from. |
false if target == *this, otherwise true.Deep-copies the payload from another RawData.
Allocates a new buffer and copies the payload from target. If *this already owns a buffer of the same size, the data is copied in-place without reallocation.
| target | Source to copy from. |
false if target == *this, otherwise true.Transfers ownership from another RawData.
Equivalent to a move operation implemented as a member function. After the call target is empty and is_owner() on target is false.
| target | Source to move from. |
false if target == *this, otherwise true.Allocates an owned buffer of size bytes.
Any previously owned buffer is freed before the new allocation. The new buffer content is uninitialised.
| size | Number of bytes to allocate. Must be non-zero. |
false if size is zero, otherwise true.Releases all resources and resets all fields to zero.
Frees the owned buffer if is_owner() is true. The Header is also zeroed.
Borrows a raw pointer without copying.
Sets the internal pointer to data without allocating. Any previously owned buffer is freed. The caller is responsible for the lifetime of data.
| data | Pointer to the data to borrow. Must be non-null. |
| size | Size of the data in bytes. Must be non-zero. |
false if data is null, size is zero, or data already equals the current internal pointer.Copies data from a raw pointer into an owned buffer.
If *this already owns a buffer of the same size the data is copied in-place; otherwise a new buffer is allocated first via create().
| data | Source data pointer. Must be non-null. |
| size | Number of bytes to copy. Must be non-zero. |
false on invalid arguments, otherwise true.Alias for deep_copy(uint8_t*, size_t).
| data | Source data pointer. |
| size | Number of bytes. |
deep_copy call.Returns a mutable reference to the 16-bit user-reserved field.
This field travels through serialisation and can be used by the application for flags or minor sub-type identification without extending the struct.
reserved_buf_.Returns a read-only pointer to the payload bytes.
nullptr if the object is empty.Returns the payload size in bytes.
Returns true if this object owns its data buffer.
An owned buffer is freed in the destructor. Non-owned buffers (created by shallow_copy or operator<<) are never freed.
true when memory ownership is held.< Sequencing and timestamp metadata for this data packet.
Internal