Skip to main content

Sample Struct

Typed payload returned by Run::pull() and consumed by Run::push(). More...

Declaration

struct simaai::neat::Sample { ... }

Included Headers

#include <SessionOptions.h>

Public Member Attributes Index

SampleKindkind = SampleKind::Unknown

Discriminator: which payload field is meaningful. More...

boolowned = ...

If false, the framework holds a borrowed reference to the underlying buffer. More...

std::optional< simaai::neat::Tensor >tensor

Set when kind == Tensor. More...

TensorListtensors

Set when kind == TensorSet. More...

std::vector< Sample >fields

Set when kind == Bundle (recursive multi-logical-output). More...

std::stringcaps_string

Caps string from the source GStreamer buffer (for media-typed payloads). More...

std::stringmedia_type

MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor"). More...

std::stringpayload_tag

Subformat tag (e.g., "NV12", "FP32", "INT8"). More...

std::stringformat

Subformat tag for the payload. More...

int64_tframe_id = -1

Source-assigned frame ID, when carried. More...

std::stringstream_id

Stream identifier (multi-stream pipelines). More...

std::stringstream_label

Human-readable stream label. More...

std::stringport_name

Ingress port name (multi-input models). More...

intoutput_index = -1

Logical output index this sample corresponds to. More...

intlogical_output_index = -1

Logical output index this sample corresponds to. More...

intmemory_index = -1

Underlying memory segment index (advanced; for zero-copy routing). More...

introute_slot = -1

Route-graph slot identifier (advanced). More...

std::stringsegment_name

Memory segment name (advanced). More...

int64_tinput_seq = -1

Input sequence number assigned at push time (lets pull match push). More...

int64_torig_input_seq = ...

Original input sequence (when re-numbered through a sub-pipeline). More...

int64_tpts_ns = -1

Presentation timestamp in nanoseconds (-1 if absent). More...

int64_tdts_ns = -1

Decoding timestamp in nanoseconds (-1 if absent). More...

int64_tduration_ns = -1

Sample duration in nanoseconds (-1 if absent). 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 379 of file SessionOptions.h.

Public Member Attributes

caps_string

std::string simaai::neat::Sample::caps_string

Caps string from the source GStreamer buffer (for media-typed payloads).

Definition at line 389 of file SessionOptions.h.

dts_ns

int64_t simaai::neat::Sample::dts_ns = -1

Decoding timestamp in nanoseconds (-1 if absent).

Definition at line 413 of file SessionOptions.h.

413 int64_t dts_ns = -1;

duration_ns

int64_t simaai::neat::Sample::duration_ns = -1

Sample duration in nanoseconds (-1 if absent).

Definition at line 414 of file SessionOptions.h.

414 int64_t duration_ns = -1;

fields

std::vector<Sample> simaai::neat::Sample::fields

Set when kind == Bundle (recursive multi-logical-output).

Definition at line 386 of file SessionOptions.h.

386 std::vector<Sample> fields;

format

std::string simaai::neat::Sample::format

Subformat tag for the payload.

Deprecated

Use payload_tag. Kept for transition.

Definition at line 396 of file SessionOptions.h.

396 std::string format;

frame_id

int64_t simaai::neat::Sample::frame_id = -1

Source-assigned frame ID, when carried.

Definition at line 398 of file SessionOptions.h.

398 int64_t frame_id = -1;

input_seq

int64_t simaai::neat::Sample::input_seq = -1

Input sequence number assigned at push time (lets pull match push).

Definition at line 409 of file SessionOptions.h.

409 int64_t input_seq = -1;

kind

SampleKind simaai::neat::Sample::kind = SampleKind::Unknown

Discriminator: which payload field is meaningful.

Definition at line 380 of file SessionOptions.h.

logical_output_index

int simaai::neat::Sample::logical_output_index = -1

Logical output index this sample corresponds to.

Definition at line 405 of file SessionOptions.h.

media_type

std::string simaai::neat::Sample::media_type

MIME-style media type (e.g., "video/x-raw", "application/vnd.simaai.tensor").

Definition at line 390 of file SessionOptions.h.

390 std::string media_type;

memory_index

int simaai::neat::Sample::memory_index = -1

Underlying memory segment index (advanced; for zero-copy routing).

Definition at line 406 of file SessionOptions.h.

406 int memory_index = -1;

orig_input_seq

int64_t simaai::neat::Sample::orig_input_seq

Original input sequence (when re-numbered through a sub-pipeline).

Initialiser
= -1

Definition at line 410 of file SessionOptions.h.

output_index

int simaai::neat::Sample::output_index = -1

Logical output index this sample corresponds to.

Deprecated

Legacy alias for logical_output_index.

Definition at line 404 of file SessionOptions.h.

404 int output_index = -1;

owned

bool simaai::neat::Sample::owned

If false, the framework holds a borrowed reference to the underlying buffer.

Initialiser
= true

Definition at line 381 of file SessionOptions.h.

381 bool owned =

payload_tag

std::string simaai::neat::Sample::payload_tag

Subformat tag (e.g., "NV12", "FP32", "INT8").

Replaces deprecated format.

Definition at line 392 of file SessionOptions.h.

392 std::string payload_tag;

port_name

std::string simaai::neat::Sample::port_name

Ingress port name (multi-input models).

Definition at line 401 of file SessionOptions.h.

401 std::string port_name;

pts_ns

int64_t simaai::neat::Sample::pts_ns = -1

Presentation timestamp in nanoseconds (-1 if absent).

Definition at line 412 of file SessionOptions.h.

412 int64_t pts_ns = -1;

route_slot

int simaai::neat::Sample::route_slot = -1

Route-graph slot identifier (advanced).

Definition at line 407 of file SessionOptions.h.

407 int route_slot = -1;

segment_name

std::string simaai::neat::Sample::segment_name

Memory segment name (advanced).

Definition at line 408 of file SessionOptions.h.

408 std::string segment_name;

stream_id

std::string simaai::neat::Sample::stream_id

Stream identifier (multi-stream pipelines).

Definition at line 399 of file SessionOptions.h.

399 std::string stream_id;

stream_label

std::string simaai::neat::Sample::stream_label

Human-readable stream label.

Definition at line 400 of file SessionOptions.h.

400 std::string stream_label;

tensor

std::optional<simaai::neat::Tensor> simaai::neat::Sample::tensor

Set when kind == Tensor.

Definition at line 384 of file SessionOptions.h.

384 std::optional<simaai::neat::Tensor> tensor;

tensors

TensorList simaai::neat::Sample::tensors

Set when kind == TensorSet.

Definition at line 385 of file SessionOptions.h.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.