/** Different IO area types */ enum spa_io_type {
SPA_IO_Invalid,
SPA_IO_Buffers, /**< area to exchange buffers, struct spa_io_buffers */
SPA_IO_Range, /**< expected byte range, struct spa_io_range (currently not used in PipeWire) */
SPA_IO_Clock, /**< area to update clock information, struct spa_io_clock */
SPA_IO_Latency, /**< latency reporting, struct spa_io_latency (currently not used in
* PipeWire). \see spa_param_latency */
SPA_IO_Control, /**< area for control messages, struct spa_io_sequence */
SPA_IO_Notify, /**< area for notify messages, struct spa_io_sequence */
SPA_IO_Position, /**< position information in the graph, struct spa_io_position */
SPA_IO_RateMatch, /**< rate matching between nodes, struct spa_io_rate_match */
SPA_IO_Memory, /**< memory pointer, struct spa_io_memory (currently not used in PipeWire) */
SPA_IO_AsyncBuffers, /**< async area to exchange buffers, struct spa_io_async_buffers */
};
/** *IOareatoexchangeamemoryregion
*/ struct spa_io_memory {
int32_t status; /**< the status code */
uint32_t size; /**< the size of \a data */ void *data; /**< a memory pointer */
}; #define SPA_IO_MEMORY_INIT ((struct spa_io_memory) { SPA_STATUS_OK, 0, NULL, })
/** A range, suitable for input ports that can suggest a range to output ports */ struct spa_io_range {
uint64_t offset; /**< offset in range */
uint32_t min_size; /**< minimum size of data */
uint32_t max_size; /**< maximum size of data */
};
/** *Absolutetimereporting. * *Nodesthatcanreportclockinginformationwillreceivethisioblock. *Theapplicationsetstheid.Thisisusuallysetaspartofthe *positioninformationbutcanalsobesetseparately. * *Theclockcountstheelapsedtimeaccordingtotheclockprovider *sincetheproviderwaslaststarted. * *Drivernodesaresupposedtoupdatethecontentsof\refSPA_IO_Clockbefore *signalingthestartofagraphcycle.Theseupdatedclockvaluesbecome *visibletoothernodesin\refSPA_IO_Position.Non-drivernodesdo *notneedtoupdatethecontentsoftheir\refSPA_IO_Clock. * *Thehostgenerallygiveseachnodeaseparate\refspa_io_clockin\ref *SPA_IO_Clock,sothatupdatesmadebythedriverarenotvisibleinthe *contentsof\refSPA_IO_Clockofothernodes.Instead,\refSPA_IO_Position *isusedtolookupthecurrentgraphtime. * *Anodeisadriverwhen\refspa_io_clock.idin\refSPA_IO_Clockand *\refspa_io_position.clock.idin\refSPA_IO_Positionarethesame.
*/ struct spa_io_clock { #define SPA_IO_CLOCK_FLAG_FREEWHEEL (1u<<0) /* graph is freewheeling */ #define SPA_IO_CLOCK_FLAG_XRUN_RECOVER (1u<<1) /* recovering from xrun */ #define SPA_IO_CLOCK_FLAG_LAZY (1u<<2) /* lazy scheduling */ #define SPA_IO_CLOCK_FLAG_NO_RATE (1u<<3) /* the rate of the clock is only approximately. *itisrecommendedtousethensecasaclocksource.
* The rate_diff contains the measured inaccuracy. */
uint32_t flags; /**< Clock flags */
uint32_t id; /**< Unique clock id, set by host application */ char name[64]; /**< Clock name prefixed with API, set by node when it receives *\refSPA_IO_Clock.Theclocknameisuniqueperclockand
* can be used to check if nodes share the same clock. */
uint64_t nsec; /**< Time in nanoseconds against monotonic clock *(CLOCK_MONOTONIC).Thisfieldsreflectsarealtimeinstant
* in the past. The value may have jitter. */ struct spa_fraction rate; /**< Rate for position/duration/delay/xrun */
uint64_t position; /**< Current position, in samples @ \ref rate */
uint64_t duration; /**< Duration of current cycle, in samples @ \ref rate */
int64_t delay; /**< Delay between position and hardware, in samples @ \ref rate */ double rate_diff; /**< Rate difference between clock and monotonic time, as a ratio of
* clock speeds. */
uint64_t next_nsec; /**< Estimated next wakeup time in nanoseconds. *Thistimeisalogicalstarttimeofthenextcycle,and *isnotnecessarilyinthefuture.
*/
struct spa_fraction target_rate; /**< Target rate of next cycle */
uint64_t target_duration; /**< Target duration of next cycle */
uint32_t target_seq; /**< Seq counter. must be equal at start and
* end of read and lower bit must be 0 */
uint32_t cycle; /**< incremented each time the graph is started */
uint64_t xrun; /**< Estimated accumulated xrun duration */
};
/* the size of the video in this cycle */ struct spa_io_video_size { #define SPA_IO_VIDEO_SIZE_VALID (1<<0)
uint32_t flags; /**< optional flags */
uint32_t stride; /**< video stride in bytes */ struct spa_rectangle size; /**< the video size */ struct spa_fraction framerate; /**< the minimum framerate, the cycle duration is *alwayssmallertoensurethereisonlyone
* video frame per cycle. */
uint32_t padding[4];
};
/** *Latencyreporting * *CurrentlynotusedinPipeWire.Instead,\seespa_param_latency
*/ struct spa_io_latency { struct spa_fraction rate; /**< rate for min/max */
uint64_t min; /**< min latency */
uint64_t max; /**< max latency */
};
/** control stream, io area for SPA_IO_Control and SPA_IO_Notify */ struct spa_io_sequence { struct spa_pod_sequence sequence; /**< sequence of timed events */
};
/** bar and beat segment */ struct spa_io_segment_bar { #define SPA_IO_SEGMENT_BAR_FLAG_VALID (1<<0)
uint32_t flags; /**< extra flags */
uint32_t offset; /**< offset in segment of this beat */ float signature_num; /**< time signature numerator */ float signature_denom; /**< time signature denominator */ double bpm; /**< beats per minute */ double beat; /**< current beat in segment */ double bar_start_tick; double ticks_per_beat;
uint32_t padding[4];
};
/** *Asegmentconvertsarunningtimetoasegment(stream)position. * *Thesegmentpositionisvalidwhenthecurrentrunningtimeisbetween *startandstart+duration.Thepositionisthen *calculatedas: * *(runningtime-start)*rate+position; * *SupportforloopingisdonebyspecifyingtheLOOPINGflagswitha *non-zeroduration.Whentherunningtimereachesstart+duration, *durationisaddedtostartandthelooprepeats. * *Carehastobetakenwhentherunningtime+clock.durationextends *pastthestart+durationfromthesegment;theusershouldcorrectly *wraparoundandpartiallyrepeattheloopinthecurrentcycle. * *Extrainformationcanbeplacedinthesegmentbysettingthevalidflags *andfillingupthecorrespondingstructures.
*/ struct spa_io_segment {
uint32_t version; #define SPA_IO_SEGMENT_FLAG_LOOPING (1<<0) /**< after the duration, the segment repeats */ #define SPA_IO_SEGMENT_FLAG_NO_POSITION (1<<1) /**< position is invalid. The position can be invalid *afteraseek,forexample,whentheexactmapping *oftheextrasegmentinfo(bar,video,...)to
* position has not been determined yet */
uint32_t flags; /**< extra flags */
uint64_t start; /**< value of running time when this *infoisactive.Canbeinthefuturefor *pendingchanges.Itdoesnothavetobein
* exact multiples of the clock duration. */
uint64_t duration; /**< duration when this info becomes invalid expressed *inrunningtime.Ifthedurationis0,this *segmentextendstothenextsegment.Ifthe *segmentbecomesinvalidandtheloopingflagis
* set, the segment repeats. */ double rate; /**< overall rate of the segment, can be negative for
* backwards time reporting. */
uint64_t position; /**< The position when the running time == start. *canbeinvalidwhentheowneroftheextrasegment
* information has not yet made the mapping. */
/** the maximum number of segments visible in the future */ #define SPA_IO_POSITION_MAX_SEGMENTS 8
/** *Thepositioninformationaddsextrameaningtotherawclocktimes. * *Itissetonallnodesin\refSPA_IO_Position,andthecontentsof\ref *spa_io_position.clockcontaintheclockupdatesmadebythedrivingnodein *thegraphinits\refSPA_IO_Clock.Also,\refspa_io_position.clock.id *willcontaintheclockidofthedrivingnodeinthegraph. * *Thepositionclockindicatesthelogicalstarttimeofthecurrentgraph *cycle. * *Thepositioninformationcontains1ormoresegmentsthatconvertthe *rawclocktimestoastreamtime.Theyaresortedbasedontheir *starttimes,andthustheorderinwhichtheywillactivatein *thefuture.Thismakesitpossibletolookaheadinthescheduled *segmentsandanticipatethechangesinthetimeline.
*/ struct spa_io_position { struct spa_io_clock clock; /**< clock position of driver, always valid and
* read only */ struct spa_io_video_size video; /**< size of the video in the current cycle */
int64_t offset; /**< an offset to subtract from the clock position *togetarunningtime.Thisisthetimethat *thestatehasbeenintheRUNNINGstateandthe *timethatshouldbeusedtocomparethesegment
* start values against. */
uint32_t state; /**< one of enum spa_io_position_state */
uint32_t n_segments; /**< number of segments */ struct spa_io_segment segments[SPA_IO_POSITION_MAX_SEGMENTS]; /**< segments */
};
/** *Ratematching. * *Itisusuallysetonthenodesthatprocessresampleddata,by *thecomponent(audioadapter)thathandlesresamplingbetweengraph *andnoderates.The\aflagsand\aratefieldsmaybemodifiedbythenode. * *Thenodecanrequestacorrectiontotheresamplingrateinitsprocess(),bysetting *\refSPA_IO_RATE_MATCH_ACTIVEon\aflags,andsetting\aratetothedesiredrate *correction.UsuallytherateisobtainedfromDLLorotheradaptivemechanismthat *e.g.drivesthenodebufferfillleveltowardaspecificvalue. * *Whenresamplingto(graph->node)direction,thenumberofsamplesproduced *bytheresamplervariesoneachcycle,astheratesarenotcommensurate. * *Whenresamplingto(node->graph)direction,thenumberofsamplesconsumedbythe *resamplervaries.Nodeoutputportsinprocess()shouldproduce\asizenumberof *samplestomatchwhattheresamplerneedstoproduceonegraphquantumofoutput *samples. * *Resamplingfiltersintroduceprocessingdelay,givenby\adelayand\adelay_frac,in *samplesatnoderate.Thedelayvariesoneachcyclee.g.whenresamplingbetween *noncommensuraterates. * *Thefirstsampleoutput(graph->node)orconsumed(node->graph)bytheresampleris *offsetby\adelay+\adelay_frac/1e9nodesamplesrelativetothenominalgraph *cyclestartposition: * *\code{.unparsed} *first_resampled_sample_nsec= *first_original_sample_nsec *-(rate_match->delay*SPA_NSEC_PER_SEC+rate_match->delay_frac)/node_rate *\endcode
*/ struct spa_io_rate_match {
uint32_t delay; /**< resampling delay, in samples at
* node rate */
uint32_t size; /**< requested input size for resampler */ double rate; /**< rate for resampler (set by node) */ #define SPA_IO_RATE_MATCH_FLAG_ACTIVE (1 << 0)
uint32_t flags; /**< extra flags (set by node) */
int32_t delay_frac; /**< resampling delay fractional part,
* in units of nanosamples (1/10^9 sample) at node rate */
uint32_t padding[6];
};
/** async buffers */ struct spa_io_async_buffers { struct spa_io_buffers buffers[2]; /**< async buffers, writers write to current (cycle+1)&1,
* readers read from (cycle)&1 */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.