/** Loop events, use \ref pw_data_loop_add_listener to add a listener */ struct pw_data_loop_events { #define PW_VERSION_DATA_LOOP_EVENTS 0
uint32_t version; /** The loop is destroyed */ void (*destroy) (void *data);
};
/** Make a new loop. */ struct pw_data_loop *
pw_data_loop_new(conststruct spa_dict *props);
/** Add an event listener to loop */ void pw_data_loop_add_listener(struct pw_data_loop *loop, struct spa_hook *listener, conststruct pw_data_loop_events *events, void *data);
/** wait for activity on the loop up to \a timeout milliseconds.
* Should be called from the loop function */ int pw_data_loop_wait(struct pw_data_loop *loop, int timeout);
/** make sure the thread will exit. Can be called from a loop callback */ void pw_data_loop_exit(struct pw_data_loop *loop);
/** Get the loop implementation of this data loop */ struct pw_loop *
pw_data_loop_get_loop(struct pw_data_loop *loop);
/** Get the loop name. Since 1.1.0 */ constchar * pw_data_loop_get_name(struct pw_data_loop *loop); /** Get the loop class. Since 1.1.0 */ constchar * pw_data_loop_get_class(struct pw_data_loop *loop);
/** Destroy the loop */ void pw_data_loop_destroy(struct pw_data_loop *loop);
/** Start the processing thread */ int pw_data_loop_start(struct pw_data_loop *loop);
/** Stop the processing thread */ int pw_data_loop_stop(struct pw_data_loop *loop);
/** Check if the current thread is the processing thread.
* May be called from any thread. */ bool pw_data_loop_in_thread(struct pw_data_loop *loop); /** Get the thread object */ struct spa_thread *pw_data_loop_get_thread(struct pw_data_loop *loop);
/** invoke func in the context of the thread or in the caller thread when *theloopisnotrunning.Maybecalledfromtheloop'sthread,butotherwise *canonlybecalledbyasinglethreadatatime. *Ifcalledfromtheloop'sthread,allcallbackspreviouslyqueuedwith *pw_data_loop_invoke()willberunsynchronously,whichmightcause *unexpectedreentrancyproblems. * *\param[in]loopThelooptoinvokefuncon. *\paramfuncThefunctiontobeinvoked. *\paramseqAsequencenumber,opaquetoPipeWire.Thiswillbemade *availabletofunc. *\param[in]dataDatathatwillbecopiedintotheinternalringbufferandmade *availabletofunc.Becausethisdataiscopied,itisokayto *passapointertoalocalvariable,butdonotpassapointerto *anobjectthathasidentity. *\paramsizeThesizeofdatatocopy. *\paramblockIf\true,donotreturnuntilfunchasbeencalled.Otherwise, *returnsimmediately.Passing\truedoesnotriskadeadlockbecause *thedatathreadisneverallowedtowaitonanyotherthread. *\paramuser_dataAnopaquepointerpassedtofunc. *\return`-EPIPE`iftheinternalringbufferfilledup, *ifblockis\false,0isreturnedwhenseqisSPA_ID_INVALIDorthe *sequencenumberwiththeASYNCbitsetotherwise.Whenblockis\true, *thereturnvalueoffuncisreturned. *
* Since 0.3.3 */ int pw_data_loop_invoke(struct pw_data_loop *loop,
spa_invoke_func_t func, uint32_t seq, constvoid *data, size_t size, bool block, void *user_data);
/** Set a custom spa_thread_utils for this loop. Setting NULL restores the
* system default implementation. Since 0.3.50 */ void pw_data_loop_set_thread_utils(struct pw_data_loop *loop, struct spa_thread_utils *impl); /** *\}
*/
#ifdef __cplusplus
} #endif
#endif/* PIPEWIRE_DATA_LOOP_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-08-24)
¤
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.