PipeWire: Loop

PipeWire 1.4.2 |

Loading...
Searching...
No Matches
Files | Data Structures | Typedefs | Macros | Functions
Loop
SPA » Support

Event loop interface. More...

## Files
file | loop.h
| `spa/support/loop.h`

## Data Structures
struct | spa_loop
struct | spa_loop_control
struct | spa_loop_utils
struct | spa_source
struct | spa_loop_methods
| Register sources and work items to an event loop. More...
struct | spa_loop_control_hooks
| Control hooks. More...
struct | spa_loop_control_methods
| Control an event loop. More...
struct | spa_loop_utils_methods
| Create sources for an event loop. More...

## Typedefs
typedef void(* | spa_source_func_t) (struct spa_source *source)
typedef int(* | spa_invoke_func_t) (struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
typedef void(* | spa_source_io_func_t) (void *data, int fd, uint32_t mask)
typedef void(* | spa_source_idle_func_t) (void *data)
typedef void(* | spa_source_event_func_t) (void *data, uint64_t count)
typedef void(* | spa_source_timer_func_t) (void *data, uint64_t expirations)
typedef void(* | spa_source_signal_func_t) (void *data, int signal_number)

## Macros
#define | SPA_TYPE_INTERFACE_Loop SPA_TYPE_INFO_INTERFACE_BASE "Loop"
#define | SPA_TYPE_INTERFACE_DataLoop SPA_TYPE_INFO_INTERFACE_BASE "DataLoop"
#define | SPA_VERSION_LOOP 0
#define | SPA_TYPE_INTERFACE_LoopControl SPA_TYPE_INFO_INTERFACE_BASE "LoopControl"
#define | SPA_VERSION_LOOP_CONTROL 1
#define | SPA_TYPE_INTERFACE_LoopUtils SPA_TYPE_INFO_INTERFACE_BASE "LoopUtils"
#define | SPA_VERSION_LOOP_UTILS 0
#define | SPA_VERSION_LOOP_METHODS 0
#define | SPA_VERSION_LOOP_CONTROL_HOOKS 0
#define | SPA_VERSION_LOOP_CONTROL_METHODS 1
#define | SPA_VERSION_LOOP_UTILS_METHODS 0

## Functions
SPA_API_LOOP int | spa_loop_add_source (struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int | spa_loop_update_source (struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int | spa_loop_remove_source (struct spa_loop *object, struct spa_source *source)
SPA_API_LOOP int | spa_loop_invoke (struct spa_loop *object, spa_invoke_func_t func, uint32_t seq, const void *data, size_t size, bool block, void *user_data)
SPA_API_LOOP void | spa_loop_control_hook_before (struct spa_hook_list *l)
SPA_API_LOOP void | spa_loop_control_hook_after (struct spa_hook_list *l)
SPA_API_LOOP int | spa_loop_control_get_fd (struct spa_loop_control *object)
SPA_API_LOOP void | spa_loop_control_add_hook (struct spa_loop_control *object, struct spa_hook *hook, const struct spa_loop_control_hooks *hooks, void *data)
SPA_API_LOOP void | spa_loop_control_enter (struct spa_loop_control *object)
SPA_API_LOOP void | spa_loop_control_leave (struct spa_loop_control *object)
SPA_API_LOOP int | spa_loop_control_iterate (struct spa_loop_control *object, int timeout)
SPA_API_LOOP int | spa_loop_control_iterate_fast (struct spa_loop_control *object, int timeout)
SPA_API_LOOP int | spa_loop_control_check (struct spa_loop_control *object)
SPA_API_LOOP struct spa_source * | spa_loop_utils_add_io (struct spa_loop_utils *object, int fd, uint32_t mask, bool close, spa_source_io_func_t func, void *data)
SPA_API_LOOP int | spa_loop_utils_update_io (struct spa_loop_utils *object, struct spa_source *source, uint32_t mask)
SPA_API_LOOP struct spa_source * | spa_loop_utils_add_idle (struct spa_loop_utils *object, bool enabled, spa_source_idle_func_t func, void *data)
SPA_API_LOOP int | spa_loop_utils_enable_idle (struct spa_loop_utils *object, struct spa_source *source, bool enabled)
SPA_API_LOOP struct spa_source * | spa_loop_utils_add_event (struct spa_loop_utils *object, spa_source_event_func_t func, void *data)
SPA_API_LOOP int | spa_loop_utils_signal_event (struct spa_loop_utils *object, struct spa_source *source)
SPA_API_LOOP struct spa_source * | spa_loop_utils_add_timer (struct spa_loop_utils *object, spa_source_timer_func_t func, void *data)
SPA_API_LOOP int | spa_loop_utils_update_timer (struct spa_loop_utils *object, struct spa_source *source, struct timespec *value, struct timespec *interval, bool absolute)
SPA_API_LOOP struct spa_source * | spa_loop_utils_add_signal (struct spa_loop_utils *object, int signal_number, spa_source_signal_func_t func, void *data)
SPA_API_LOOP void | spa_loop_utils_destroy_source (struct spa_loop_utils *object, struct spa_source *source)

## Detailed Description

Event loop interface.

## Typedef Documentation

## ◆ spa_source_func_t

typedef void(* spa_source_func_t) (struct spa_source *source)

## ◆ spa_invoke_func_t

typedef int(* spa_invoke_func_t) (struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)

## ◆ spa_source_io_func_t

typedef void(* spa_source_io_func_t) (void *data, int fd, uint32_t mask)

## ◆ spa_source_idle_func_t

typedef void(* spa_source_idle_func_t) (void *data)

## ◆ spa_source_event_func_t

typedef void(* spa_source_event_func_t) (void *data, uint64_t count)

## ◆ spa_source_timer_func_t

typedef void(* spa_source_timer_func_t) (void *data, uint64_t expirations)

## ◆ spa_source_signal_func_t

typedef void(* spa_source_signal_func_t) (void *data, int signal_number)

## Macro Definition Documentation

## ◆ SPA_TYPE_INTERFACE_Loop

#define SPA_TYPE_INTERFACE_Loop SPA_TYPE_INFO_INTERFACE_BASE "Loop"

## ◆ SPA_TYPE_INTERFACE_DataLoop

#define SPA_TYPE_INTERFACE_DataLoop SPA_TYPE_INFO_INTERFACE_BASE "DataLoop"

## ◆ SPA_VERSION_LOOP

#define SPA_VERSION_LOOP 0

## ◆ SPA_TYPE_INTERFACE_LoopControl

#define SPA_TYPE_INTERFACE_LoopControl SPA_TYPE_INFO_INTERFACE_BASE "LoopControl"

## ◆ SPA_VERSION_LOOP_CONTROL

#define SPA_VERSION_LOOP_CONTROL 1

## ◆ SPA_TYPE_INTERFACE_LoopUtils

#define SPA_TYPE_INTERFACE_LoopUtils SPA_TYPE_INFO_INTERFACE_BASE "LoopUtils"

## ◆ SPA_VERSION_LOOP_UTILS

#define SPA_VERSION_LOOP_UTILS 0

## ◆ SPA_VERSION_LOOP_METHODS

#define SPA_VERSION_LOOP_METHODS 0

## ◆ SPA_VERSION_LOOP_CONTROL_HOOKS

#define SPA_VERSION_LOOP_CONTROL_HOOKS 0

## ◆ SPA_VERSION_LOOP_CONTROL_METHODS

#define SPA_VERSION_LOOP_CONTROL_METHODS 1

## ◆ SPA_VERSION_LOOP_UTILS_METHODS

#define SPA_VERSION_LOOP_UTILS_METHODS 0

## Function Documentation

## ◆ spa_loop_add_source()

SPA_API_LOOP int spa_loop_add_source | ( | struct spa_loop * | object,
|  | struct spa_source * | source )

## ◆ spa_loop_update_source()

SPA_API_LOOP int spa_loop_update_source | ( | struct spa_loop * | object,
|  | struct spa_source * | source )

## ◆ spa_loop_remove_source()

SPA_API_LOOP int spa_loop_remove_source | ( | struct spa_loop * | object,
|  | struct spa_source * | source )

## ◆ spa_loop_invoke()

SPA_API_LOOP int spa_loop_invoke | ( | struct spa_loop * | object,
|  | spa_invoke_func_t | func,
|  | uint32_t | seq,
|  | const void * | data,
|  | size_t | size,
|  | bool | block,
|  | void * | user_data )

## ◆ spa_loop_control_hook_before()

SPA_API_LOOP void spa_loop_control_hook_before | ( | struct spa_hook_list * | l | ) |

## ◆ spa_loop_control_hook_after()

SPA_API_LOOP void spa_loop_control_hook_after | ( | struct spa_hook_list * | l | ) |

## ◆ spa_loop_control_get_fd()

SPA_API_LOOP int spa_loop_control_get_fd | ( | struct spa_loop_control * | object | ) |

## ◆ spa_loop_control_add_hook()

SPA_API_LOOP void spa_loop_control_add_hook | ( | struct spa_loop_control * | object,
|  | struct spa_hook * | hook,
|  | const struct spa_loop_control_hooks * | hooks,
|  | void * | data )

## ◆ spa_loop_control_enter()

SPA_API_LOOP void spa_loop_control_enter | ( | struct spa_loop_control * | object | ) |

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_loop_control_leave()

SPA_API_LOOP void spa_loop_control_leave | ( | struct spa_loop_control * | object | ) |

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_loop_control_iterate()

SPA_API_LOOP int spa_loop_control_iterate | ( | struct spa_loop_control * | object,
|  | int | timeout )

Examples
  local-v4l2.c, spa/examples/adapter-control.c, spa/examples/example-control.c, spa/examples/local-libcamera.c, spa/examples/local-v4l2.c, and spa/examples/local-videotestsrc.c.

## ◆ spa_loop_control_iterate_fast()

SPA_API_LOOP int spa_loop_control_iterate_fast | ( | struct spa_loop_control * | object,
|  | int | timeout )

## ◆ spa_loop_control_check()

SPA_API_LOOP int spa_loop_control_check | ( | struct spa_loop_control * | object | ) |

## ◆ spa_loop_utils_add_io()

SPA_API_LOOP struct spa_source * spa_loop_utils_add_io | ( | struct spa_loop_utils * | object,
|  | int | fd,
|  | uint32_t | mask,
|  | bool | close,
|  | spa_source_io_func_t | func,
|  | void * | data )

## ◆ spa_loop_utils_update_io()

SPA_API_LOOP int spa_loop_utils_update_io | ( | struct spa_loop_utils * | object,
|  | struct spa_source * | source,
|  | uint32_t | mask )

## ◆ spa_loop_utils_add_idle()

SPA_API_LOOP struct spa_source * spa_loop_utils_add_idle | ( | struct spa_loop_utils * | object,
|  | bool | enabled,
|  | spa_source_idle_func_t | func,
|  | void * | data )

## ◆ spa_loop_utils_enable_idle()

SPA_API_LOOP int spa_loop_utils_enable_idle | ( | struct spa_loop_utils * | object,
|  | struct spa_source * | source,
|  | bool | enabled )

## ◆ spa_loop_utils_add_event()

SPA_API_LOOP struct spa_source * spa_loop_utils_add_event | ( | struct spa_loop_utils * | object,
|  | spa_source_event_func_t | func,
|  | void * | data )

## ◆ spa_loop_utils_signal_event()

SPA_API_LOOP int spa_loop_utils_signal_event | ( | struct spa_loop_utils * | object,
|  | struct spa_source * | source )

## ◆ spa_loop_utils_add_timer()

SPA_API_LOOP struct spa_source * spa_loop_utils_add_timer | ( | struct spa_loop_utils * | object,
|  | spa_source_timer_func_t | func,
|  | void * | data )

## ◆ spa_loop_utils_update_timer()

SPA_API_LOOP int spa_loop_utils_update_timer | ( | struct spa_loop_utils * | object,
|  | struct spa_source * | source,
|  | struct timespec * | value,
|  | struct timespec * | interval,
|  | bool | absolute )

## ◆ spa_loop_utils_add_signal()

SPA_API_LOOP struct spa_source * spa_loop_utils_add_signal | ( | struct spa_loop_utils * | object,
|  | int | signal_number,
|  | spa_source_signal_func_t | func,
|  | void * | data )

## ◆ spa_loop_utils_destroy_source()

SPA_API_LOOP void spa_loop_utils_destroy_source | ( | struct spa_loop_utils * | object,
|  | struct spa_source * | source )