PulseAudio
16.0
|
Main loop abstraction layer. More...
Go to the source code of this file.
Data Structures | |
struct | pa_mainloop_api |
An abstract mainloop API vtable. More... | |
Typedefs | |
typedef struct pa_mainloop_api | pa_mainloop_api |
An abstract mainloop API vtable. More... | |
typedef enum pa_io_event_flags | pa_io_event_flags_t |
A bitmask for IO events. More... | |
typedef struct pa_io_event | pa_io_event |
An opaque IO event source object. More... | |
typedef void(* | pa_io_event_cb_t) (pa_mainloop_api *ea, pa_io_event *e, int fd, pa_io_event_flags_t events, void *userdata) |
An IO event callback prototype. More... | |
typedef void(* | pa_io_event_destroy_cb_t) (pa_mainloop_api *a, pa_io_event *e, void *userdata) |
A IO event destroy callback prototype. More... | |
typedef struct pa_time_event | pa_time_event |
An opaque timer event source object. More... | |
typedef void(* | pa_time_event_cb_t) (pa_mainloop_api *a, pa_time_event *e, const struct timeval *tv, void *userdata) |
A time event callback prototype. More... | |
typedef void(* | pa_time_event_destroy_cb_t) (pa_mainloop_api *a, pa_time_event *e, void *userdata) |
A time event destroy callback prototype. More... | |
typedef struct pa_defer_event | pa_defer_event |
An opaque deferred event source object. More... | |
typedef void(* | pa_defer_event_cb_t) (pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event callback prototype. More... | |
typedef void(* | pa_defer_event_destroy_cb_t) (pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event destroy callback prototype. More... | |
Enumerations | |
enum | pa_io_event_flags { PA_IO_EVENT_NULL = 0 , PA_IO_EVENT_INPUT = 1 , PA_IO_EVENT_OUTPUT = 2 , PA_IO_EVENT_HANGUP = 4 , PA_IO_EVENT_ERROR = 8 } |
A bitmask for IO events. More... | |
Functions | |
void | pa_mainloop_api_once (pa_mainloop_api *m, void(*callback)(pa_mainloop_api *m, void *userdata), void *userdata) |
Run the specified callback function once from the main loop using an anonymous defer event. More... | |
Main loop abstraction layer.
Both the PulseAudio core and the PulseAudio client library use a main loop abstraction layer. Due to this it is possible to embed PulseAudio into other applications easily. Three main loop implementations are currently available:
The structure pa_mainloop_api is used as a vtable for the main loop abstraction.
This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available through mainloop-signal.h.
typedef struct pa_defer_event pa_defer_event |
An opaque deferred event source object.
Events of this type are triggered once in every main loop iteration
typedef void(* pa_defer_event_cb_t) (pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event callback prototype.
typedef void(* pa_defer_event_destroy_cb_t) (pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event destroy callback prototype.
typedef struct pa_io_event pa_io_event |
An opaque IO event source object.
typedef void(* pa_io_event_cb_t) (pa_mainloop_api *ea, pa_io_event *e, int fd, pa_io_event_flags_t events, void *userdata) |
An IO event callback prototype.
typedef void(* pa_io_event_destroy_cb_t) (pa_mainloop_api *a, pa_io_event *e, void *userdata) |
A IO event destroy callback prototype.
typedef enum pa_io_event_flags pa_io_event_flags_t |
A bitmask for IO events.
typedef struct pa_mainloop_api pa_mainloop_api |
An abstract mainloop API vtable.
typedef struct pa_time_event pa_time_event |
An opaque timer event source object.
typedef void(* pa_time_event_cb_t) (pa_mainloop_api *a, pa_time_event *e, const struct timeval *tv, void *userdata) |
A time event callback prototype.
typedef void(* pa_time_event_destroy_cb_t) (pa_mainloop_api *a, pa_time_event *e, void *userdata) |
A time event destroy callback prototype.
enum pa_io_event_flags |
void pa_mainloop_api_once | ( | pa_mainloop_api * | m, |
void(*)(pa_mainloop_api *m, void *userdata) | callback, | ||
void * | userdata | ||
) |
Run the specified callback function once from the main loop using an anonymous defer event.
If the mainloop runs in a different thread, you need to follow the mainloop implementation's rules regarding how to safely create defer events. In particular, if you're using pa_threaded_mainloop, you must lock the mainloop before calling this function.