PipeWire  0.3.33
spa_io_segment Struct Reference

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

Data Fields

uint32_t version
 
uint32_t flags
 extra flags More...
 
uint64_t start
 value of running time when this info is active. More...
 
uint64_t duration
 duration when this info becomes invalid expressed in running time. More...
 
double rate
 overall rate of the segment, can be negative for backwards time reporting. More...
 
uint64_t position
 The position when the running time == start. More...
 
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

◆ bar

struct spa_io_segment_bar spa_io_segment::bar

◆ 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.

◆ flags

uint32_t spa_io_segment::flags

extra flags

◆ 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.

◆ rate

double spa_io_segment::rate

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

◆ start

uint64_t spa_io_segment::start

value of running time when this info is active.

Can be in the future for pending changes. It does not have to be in exact multiples of the clock duration.

◆ version

uint32_t spa_io_segment::version

◆ video

struct spa_io_segment_video spa_io_segment::video

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