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. | |
typedef enum pa_io_event_flags | pa_io_event_flags_t |
A bitmask for IO events. | |
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 protoype. | |
typedef void(* | pa_io_event_destroy_cb_t )(pa_mainloop_api *a, pa_io_event *e, void *userdata) |
A IO event destroy callback prototype \ since 0.9.3. | |
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 \ since 0.9.3. | |
typedef struct pa_defer_event | pa_defer_event |
An opaque deferred event source object. | |
typedef void(* | pa_defer_event_cb_t )(pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event callback protoype. | |
typedef void(* | pa_defer_event_destroy_cb_t )(pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event destroy callback prototype \ since 0.9.3. | |
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. |
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. Two main loop implemenations are currently available:
The structure pa_mainloop_api is used as vtable for the main loop abstraction.
This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available throught 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 protoype.
typedef void(* pa_defer_event_destroy_cb_t)(pa_mainloop_api *a, pa_defer_event *e, void *userdata) |
A defer event destroy callback prototype \ since 0.9.3.
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 protoype.
typedef void(* pa_io_event_destroy_cb_t)(pa_mainloop_api *a, pa_io_event *e, void *userdata) |
A IO event destroy callback prototype \ since 0.9.3.
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 \ since 0.9.3.
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.