Module data_stream

Source
Expand description

Stabilizer data stream capabilities

§Design

Data streamining utilizes UDP packets to send data streams at high throughput. Packets are always sent in a best-effort fashion, and data may be dropped.

Stabilizer organizes streamed data into batches within a “Frame” that will be sent as a UDP packet. Each frame consits of a header followed by sequential batch serializations. The packet header is constant for all streaming capabilities, but the serialization format after the header is application-defined.

§Frame Header

The header consists of the following, all in little-endian.

  • Magic word 0x057B (u16): a constant to identify Stabilizer streaming data.
  • Format Code (u8): a unique ID that indicates the serialization format of each batch of data in the frame. Refer to StreamFormat for further information.
  • Batch Count (u8): the number of batches of data.
  • Sequence Number (u32): an the sequence number of the first batch in the frame. This can be used to determine if and how many stream batches are lost.

§Example

A sample Python script is available in scripts/stream_throughput.py to demonstrate reception of streamed data.

Structs§

DataStream
The “consumer” portion of the data stream.
FRAME_POOL
FrameGenerator
The data generator for a stream.
StreamTarget
Represents the destination for the UDP stream to send data to.

Enums§

StreamFormat
Specifies the format of streamed data

Functions§

setup_streaming
Configure streaming on a device.