Sample Struct
Typed payload returned by Run::pull() and consumed by Run::push(). More...
Declaration
Included Headers
Public Operators Index
| Sample & | operator[] (std::size_t i) |
|
Logical field access. For non-Bundle Samples only index 0 is meaningful. More... | |
| const Sample & | operator[] (std::size_t i) const |
Public Member Functions Index
| bool | empty () const noexcept |
| std::size_t | size () const noexcept |
|
Number of logical payloads represented by this Sample. More... | |
| void | reserve (std::size_t n) |
|
Reserve Bundle field storage. Turns an empty Sample into a Bundle builder. More... | |
| void | push_back (Sample sample) |
|
Append a field to this Sample. Turns an empty Sample into a Bundle builder. More... | |
| Sample & | front () |
|
First logical payload. For non-Bundle Samples, this is the Sample itself. More... | |
| const Sample & | front () const |
| Sample & | back () |
|
Last logical payload. For non-Bundle Samples, this is the Sample itself. More... | |
| const Sample & | back () const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
Public Member Attributes Index
| SampleKind | kind = SampleKind::Unknown |
|
Discriminator: which payload field is meaningful. More... | |
| bool | owned = ... |
|
If false, the framework holds a borrowed reference to the underlying buffer. More... | |
| std::optional< simaai::neat::Tensor > | tensor |
| TensorList | tensors |
|
Set when kind == TensorSet. More... | |
| std::vector< Sample > | fields |
|
Set when kind == Bundle (recursive multi-logical-output). More... | |
| std::string | caps_string |
|
Caps string from the source GStreamer buffer (for media-typed payloads). More... | |
| PayloadType | payload_type = PayloadType::Auto |
|
Public semantic payload family. More... | |
| std::string | media_type |
|
MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor"). More... | |
| std::string | payload_tag |
|
Subformat tag (e.g., "NV12", "FP32", "INT8"). More... | |
| std::string | format |
|
Subformat tag for the payload. More... | |
| int64_t | frame_id = -1 |
|
Source-assigned frame ID, when carried. More... | |
| std::string | stream_id |
|
Stream identifier (multi-stream pipelines). More... | |
| std::string | stream_label |
|
Human-readable stream label. More... | |
| std::string | port_name |
|
Ingress port name (multi-input models). More... | |
| int | output_index = -1 |
|
Logical output index this sample corresponds to. More... | |
| int | logical_output_index = -1 |
|
Logical output index this sample corresponds to. More... | |
| int | memory_index = -1 |
|
Underlying memory segment index (advanced; for zero-copy routing). More... | |
| int | route_slot = -1 |
|
Route-graph slot identifier (advanced). More... | |
| std::string | segment_name |
|
Memory segment name (advanced). More... | |
| int64_t | input_seq = -1 |
|
Input sequence number assigned at push time (lets pull match push). More... | |
| int64_t | orig_input_seq = ... |
|
Original input sequence (when re-numbered through a sub-pipeline). More... | |
| int64_t | pts_ns = -1 |
|
Presentation timestamp in nanoseconds (-1 if absent). More... | |
| int64_t | dts_ns = -1 |
|
Decoding timestamp in nanoseconds (-1 if absent). More... | |
| int64_t | duration_ns = -1 |
| SampleAttributes | attributes |
|
Per-frame user attributes captured by a source (see MultipartHeaderCaptureOptions). More... | |
Description
Typed payload returned by Run::pull() and consumed by Run::push().
A Sample is a tagged union: depending on kind, exactly one of tensor, tensors, or fields is meaningful. Includes per-buffer metadata: stream/port labels, timestamps, frame IDs, and routing slot information. Use make_tensor_sample(), make_image_sample(), or make_bundle_sample() to construct typed Samples ergonomically.
Definition at line 524 of file GraphOptions.h.
Public Operators
operator[]()
| inline |
Logical field access. For non-Bundle Samples only index 0 is meaningful.
Definition at line 634 of file GraphOptions.h.
operator[]()
| inline |
Definition at line 640 of file GraphOptions.h.
Public Member Functions
back()
| inline |
Last logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 620 of file GraphOptions.h.
back()
| inline |
Definition at line 626 of file GraphOptions.h.
begin()
| inline |
Definition at line 709 of file GraphOptions.h.
begin()
| inline |
Definition at line 715 of file GraphOptions.h.
cbegin()
| inline |
Definition at line 721 of file GraphOptions.h.
cend()
| inline |
Definition at line 724 of file GraphOptions.h.
empty()
| inline noexcept |
Returns true when this Sample carries no payload.
Definition at line 570 of file GraphOptions.h.
end()
| inline |
Definition at line 712 of file GraphOptions.h.
end()
| inline |
Definition at line 718 of file GraphOptions.h.
front()
| inline |
First logical payload. For non-Bundle Samples, this is the Sample itself.
Definition at line 606 of file GraphOptions.h.
front()
| inline |
Definition at line 612 of file GraphOptions.h.
push_back()
| inline |
Append a field to this Sample. Turns an empty Sample into a Bundle builder.
Definition at line 595 of file GraphOptions.h.
reserve()
| inline |
Reserve Bundle field storage. Turns an empty Sample into a Bundle builder.
Definition at line 587 of file GraphOptions.h.
size()
| inline noexcept |
Number of logical payloads represented by this Sample.
A Bundle reports its number of fields. Any non-empty non-Bundle Sample reports 1. This intentionally lets Sample replace the former "list of Samples" surface while keeping a single recursive public payload type.
Definition at line 579 of file GraphOptions.h.
Public Member Attributes
attributes
|
Per-frame user attributes captured by a source (see MultipartHeaderCaptureOptions).
Empty unless a producer was configured to capture them. Attributes stay associated with the frame they were captured on across the guaranteed boundaries documented in docs/develop-apps/; they are not merged or synthesized by intermediate nodes.
Definition at line 567 of file GraphOptions.h.
caps_string
|
Caps string from the source GStreamer buffer (for media-typed payloads).
Definition at line 534 of file GraphOptions.h.
dts_ns
|
Decoding timestamp in nanoseconds (-1 if absent).
Definition at line 559 of file GraphOptions.h.
duration_ns
|
Sample duration in nanoseconds (-1 if absent).
Definition at line 560 of file GraphOptions.h.
fields
|
Set when kind == Bundle (recursive multi-logical-output).
Definition at line 531 of file GraphOptions.h.
format
|
Subformat tag for the payload.
- Deprecated
-
Use payload_tag. Kept for transition.
Definition at line 542 of file GraphOptions.h.
frame_id
|
Source-assigned frame ID, when carried.
Definition at line 544 of file GraphOptions.h.
input_seq
|
Input sequence number assigned at push time (lets pull match push).
Definition at line 555 of file GraphOptions.h.
kind
|
Discriminator: which payload field is meaningful.
Definition at line 525 of file GraphOptions.h.
logical_output_index
|
Logical output index this sample corresponds to.
Definition at line 551 of file GraphOptions.h.
media_type
|
MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor").
Definition at line 536 of file GraphOptions.h.
memory_index
|
Underlying memory segment index (advanced; for zero-copy routing).
Definition at line 552 of file GraphOptions.h.
orig_input_seq
|
Original input sequence (when re-numbered through a sub-pipeline).
- Initialiser
-
= -1
Definition at line 556 of file GraphOptions.h.
output_index
|
Logical output index this sample corresponds to.
- Deprecated
-
Legacy alias for logical_output_index.
Definition at line 550 of file GraphOptions.h.