PipeWire  0.3.33
PipeWire Main-Loop Interface

A main loop object. More...

Data Structures

struct  pw_main_loop_events
 Events of the main loop. More...
 

Functions

struct pw_main_loop * pw_main_loop_new (const struct spa_dict *props)
 Create a new main loop. More...
 
void pw_main_loop_add_listener (struct pw_main_loop *loop, struct spa_hook *listener, const struct pw_main_loop_events *events, void *data)
 Add an event listener. More...
 
struct pw_looppw_main_loop_get_loop (struct pw_main_loop *loop)
 Get the loop implementation. More...
 
void pw_main_loop_destroy (struct pw_main_loop *loop)
 Destroy a loop. More...
 
int pw_main_loop_run (struct pw_main_loop *loop)
 Run a main loop. More...
 
int pw_main_loop_quit (struct pw_main_loop *loop)
 Quit a main loop. More...
 

Detailed Description

A main loop object.

Function Documentation

◆ pw_main_loop_add_listener()

void pw_main_loop_add_listener ( struct pw_main_loop *  loop,
struct spa_hook listener,
const struct pw_main_loop_events events,
void *  data 
)

Add an event listener.

References spa_hook_list_append().

◆ pw_main_loop_destroy()

void pw_main_loop_destroy ( struct pw_main_loop *  loop)

Destroy a loop.

Destroy a loop.

Parameters
loopthe main loop to destroy

References NAME, pw_log_debug, pw_loop_destroy(), and spa_hook_list_clean().

◆ pw_main_loop_get_loop()

struct pw_loop* pw_main_loop_get_loop ( struct pw_main_loop *  loop)

Get the loop implementation.

References pw_loop::loop.

◆ pw_main_loop_new()

struct pw_main_loop* pw_main_loop_new ( const struct spa_dict props)

Create a new main loop.

Returns
a newly allocated PipeWire Main-Loop Interface

◆ pw_main_loop_quit()

int pw_main_loop_quit ( struct pw_main_loop *  loop)

Quit a main loop.

Quit a main loop.

Parameters
loopa PipeWire Main-Loop Interface to stop

The call to pw_main_loop_run() will return

References pw_loop::loop, NAME, pw_log_debug, and pw_loop_signal_event.

◆ pw_main_loop_run()

int pw_main_loop_run ( struct pw_main_loop *  loop)

Run a main loop.

This blocks until pw_main_loop_quit is called

Run a main loop.

Parameters
loopthe main loop to start

Start running loop. This function blocks until pw_main_loop_quit() has been called

References pw_loop::loop, NAME, pw_log_debug, pw_log_warn, pw_loop_enter, pw_loop_iterate, pw_loop_leave, and spa_strerror.