Loop
Core API

PipeWire loop object provides an implementation of the spa loop interfaces. More...

## Files

file | loop.h
| `pipewire/loop.h`

## Data Structures

struct | pw_loop

## Macros

#define | pw_loop_add_source(l, ...) spa_loop_add_source((l)->loop,__VA_ARGS__)
#define | pw_loop_update_source(l, ...) spa_loop_update_source((l)->loop,__VA_ARGS__)
#define | pw_loop_remove_source(l, ...) spa_loop_remove_source((l)->loop,__VA_ARGS__)
#define | pw_loop_invoke(l, ...) spa_loop_invoke((l)->loop,__VA_ARGS__)
#define | pw_loop_get_fd(l) spa_loop_control_get_fd((l)->control)
#define | pw_loop_add_hook(l, ...) spa_loop_control_add_hook((l)->control,__VA_ARGS__)
#define | pw_loop_enter(l) spa_loop_control_enter((l)->control)
#define | pw_loop_iterate(l, ...) spa_loop_control_iterate((l)->control,__VA_ARGS__)
#define | pw_loop_leave(l) spa_loop_control_leave((l)->control)
#define | pw_loop_add_io(l, ...) spa_loop_utils_add_io((l)->utils,__VA_ARGS__)
#define | pw_loop_update_io(l, ...) spa_loop_utils_update_io((l)->utils,__VA_ARGS__)
#define | pw_loop_add_idle(l, ...) spa_loop_utils_add_idle((l)->utils,__VA_ARGS__)
#define | pw_loop_enable_idle(l, ...) spa_loop_utils_enable_idle((l)->utils,__VA_ARGS__)
#define | pw_loop_add_event(l, ...) spa_loop_utils_add_event((l)->utils,__VA_ARGS__)
#define | pw_loop_signal_event(l, ...) spa_loop_utils_signal_event((l)->utils,__VA_ARGS__)
#define | pw_loop_add_timer(l, ...) spa_loop_utils_add_timer((l)->utils,__VA_ARGS__)
#define | pw_loop_update_timer(l, ...) spa_loop_utils_update_timer((l)->utils,__VA_ARGS__)
#define | pw_loop_add_signal(l, ...) spa_loop_utils_add_signal((l)->utils,__VA_ARGS__)
#define | pw_loop_destroy_source(l, ...) spa_loop_utils_destroy_source((l)->utils,__VA_ARGS__)

## Functions

struct pw_loop * | pw_loop_new (const struct spa_dict *props)
| Create a new loop. More...
void | pw_loop_destroy (struct pw_loop *loop)
| Destroy a loop. More...

## Detailed Description

PipeWire loop object provides an implementation of the spa loop interfaces.

It can be used to implement various event loops.

## Macro Definition Documentation

## pw_loop_add_source

#define pw_loop_add_source | ( |  | l,
|  |  | ...
| ) |  | spa_loop_add_source((l)->loop,__VA_ARGS__)

## pw_loop_update_source

#define pw_loop_update_source | ( |  | l,
|  |  | ...
| ) |  | spa_loop_update_source((l)->loop,__VA_ARGS__)

## pw_loop_remove_source

#define pw_loop_remove_source | ( |  | l,
|  |  | ...
| ) |  | spa_loop_remove_source((l)->loop,__VA_ARGS__)

## pw_loop_invoke

#define pw_loop_invoke | ( |  | l,
|  |  | ...
| ) |  | spa_loop_invoke((l)->loop,__VA_ARGS__)

Examples
  export-sink.c, and local-v4l2.c.

## pw_loop_get_fd

#define pw_loop_get_fd | ( |  | l | ) | spa_loop_control_get_fd((l)->control)

## pw_loop_add_hook

#define pw_loop_add_hook | ( |  | l,
|  |  | ...
| ) |  | spa_loop_control_add_hook((l)->control,__VA_ARGS__)

## pw_loop_enter

#define pw_loop_enter | ( |  | l | ) | spa_loop_control_enter((l)->control)

## pw_loop_iterate

#define pw_loop_iterate | ( |  | l,
|  |  | ...
| ) |  | spa_loop_control_iterate((l)->control,__VA_ARGS__)

Examples
  local-v4l2.c.

## pw_loop_leave

#define pw_loop_leave | ( |  | l | ) | spa_loop_control_leave((l)->control)

## pw_loop_add_io

#define pw_loop_add_io | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_add_io((l)->utils,__VA_ARGS__)

## pw_loop_update_io

#define pw_loop_update_io | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_update_io((l)->utils,__VA_ARGS__)

## pw_loop_add_idle

#define pw_loop_add_idle | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_add_idle((l)->utils,__VA_ARGS__)

## pw_loop_enable_idle

#define pw_loop_enable_idle | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_enable_idle((l)->utils,__VA_ARGS__)

## pw_loop_add_event

#define pw_loop_add_event | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_add_event((l)->utils,__VA_ARGS__)

Examples
  video-play-fixate.c.

## pw_loop_signal_event

#define pw_loop_signal_event | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_signal_event((l)->utils,__VA_ARGS__)

Examples
  video-play-fixate.c.

## pw_loop_add_timer

#define pw_loop_add_timer | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_add_timer((l)->utils,__VA_ARGS__)

Examples
  video-play-pull.c, video-play-reneg.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, and video-src.c.

## pw_loop_update_timer

#define pw_loop_update_timer | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_update_timer((l)->utils,__VA_ARGS__)

Examples
  video-play-pull.c, video-play-reneg.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, and video-src.c.

## pw_loop_add_signal

#define pw_loop_add_signal | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_add_signal((l)->utils,__VA_ARGS__)

Examples
  audio-dsp-filter.c, audio-dsp-src.c, audio-src.c, export-spa-device.c, export-spa.c, video-play-fixate.c, video-play-pull.c, video-play-reneg.c, video-play.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, and video-src.c.

## pw_loop_destroy_source

#define pw_loop_destroy_source | ( |  | l,
|  |  | ...
| ) |  | spa_loop_utils_destroy_source((l)->utils,__VA_ARGS__)

## Function Documentation

## pw_loop_new()

struct pw_loop* pw_loop_new | ( | const struct spa_dict * | props | ) |

Create a new loop.

Returns
  a newly allocated loop

## pw_loop_destroy()

void pw_loop_destroy | ( | struct pw_loop * | loop | ) |

Destroy a loop.

Parameters

  loop | a loop to destroy