PipeWire 1.1.0
Loading...
Searching...
No Matches
spa_io_segment Struct Reference

A segment converts a running time to a segment (stream) position. More...

#include <spa/node/io.h>

Data Fields

uint32_t version
 
uint32_t flags
 extra flags
 
uint64_t duration
 duration when this info becomes invalid expressed in running time.
 
double rate
 overall rate of the segment, can be negative for backwards time reporting.
 
uint64_t position
 The position when the running time == start.
 
struct spa_io_segment_bar bar
 
struct spa_io_segment_video video
 

Detailed Description

A segment converts a running time to a segment (stream) position.

The segment position is valid when the current running time is between start and start + duration. The position is then calculated as:

(running time - start) * rate + position;

Support for looping is done by specifying the LOOPING flags with a non-zero duration. When the running time reaches start + duration, duration is added to start and the loop repeats.

Care has to be taken when the running time + clock.duration extends past the start + duration from the segment; the user should correctly wrap around and partially repeat the loop in the current cycle.

Extra information can be placed in the segment by setting the valid flags and filling up the corresponding structures.

Field Documentation

◆ version

uint32_t spa_io_segment::version

◆ flags

uint32_t spa_io_segment::flags

extra flags

◆ duration

uint64_t spa_io_segment::duration

duration when this info becomes invalid expressed in running time.

If the duration is 0, this segment extends to the next segment. If the segment becomes invalid and the looping flag is set, the segment repeats.

◆ rate

double spa_io_segment::rate

overall rate of the segment, can be negative for backwards time reporting.

◆ position

uint64_t spa_io_segment::position

The position when the running time == start.

can be invalid when the owner of the extra segment information has not yet made the mapping.

◆ bar

struct spa_io_segment_bar spa_io_segment::bar

◆ video

struct spa_io_segment_video spa_io_segment::video

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