PipeWire 0.1.9

Data Structures | Macros | Functions
core.h File Reference
Include dependency graph for core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | pw_core_events
| core events emited by the core object added with pw_core_add_listener More...

## Macros
#define | PW_PERM_R 0400
| object can be seen and events can be received More...
#define | PW_PERM_W 0200
| methods can be called that modify the object More...
#define | PW_PERM_X 0100
| methods can be called on the object. More...
#define | PW_PERM_RWX (PW_PERM_R|PW_PERM_W|PW_PERM_X)
#define | PW_PERM_IS_R(p) (((p)&PW_PERM_R) == PW_PERM_R)
#define | PW_PERM_IS_W(p) (((p)&PW_PERM_W) == PW_PERM_W)
#define | PW_PERM_IS_X(p) (((p)&PW_PERM_X) == PW_PERM_X)
#define | PW_VERSION_CORE_EVENTS 0
#define | PW_CORE_PROP_USER_NAME "pipewire.core.user-name"
| The user name that started the core. More...
#define | PW_CORE_PROP_HOST_NAME "pipewire.core.host-name"
| The host name of the machine. More...
#define | PW_CORE_PROP_NAME "pipewire.core.name"
| The name of the core. More...
#define | PW_CORE_PROP_VERSION "pipewire.core.version"
| The version of the core. More...
#define | PW_CORE_PROP_DAEMON "pipewire.daemon"
| If the core should listen for connections, boolean default false. More...

## Functions
struct pw_core * | pw_core_new (struct pw_loop *main_loop, struct pw_properties *props)
| Make a new core object for a given main_loop. More...
void | pw_core_destroy (struct pw_core *core)
| destroy a core object, all resources except the main_loop will be destroyed More...
void | pw_core_add_listener (struct pw_core *core, struct spa_hook *listener, const struct pw_core_events *events, void *data)
| Add a new event listener to a core. More...
struct pw_type * | pw_core_get_type (struct pw_core *core)
| Get the type object of a core. More...
const struct pw_core_info * | pw_core_get_info (struct pw_core *core)
| Get the core info object. More...
struct pw_global * | pw_core_get_global (struct pw_core *core)
| Get the core global object. More...
const struct pw_properties * | pw_core_get_properties (struct pw_core *core)
| Get the core properties. More...
int | pw_core_update_properties (struct pw_core *core, const struct spa_dict *dict)
| Update the core properties. More...
const struct spa_support * | pw_core_get_support (struct pw_core *core, uint32_t *n_support)
| Get the core support objects. More...
struct pw_loop * | pw_core_get_main_loop (struct pw_core *core)
| get the core main loop More...
int | pw_core_for_each_global (struct pw_core *core, int(*callback)(void *data, struct pw_global *global), void *data)
| Iterate the globals of the core. More...
struct pw_global * | pw_core_find_global (struct pw_core *core, uint32_t id)
| Find a core global by id. More...
struct pw_factory * | pw_core_find_factory (struct pw_core *core, const char *name)
| Find a factory by name. More...

## Macro Definition Documentation

## ◆ PW_CORE_PROP_DAEMON

#define PW_CORE_PROP_DAEMON "pipewire.daemon"

If the core should listen for connections, boolean default false.

Referenced by pw_pipewire::pw_fill_remote_properties().

## ◆ PW_CORE_PROP_HOST_NAME

#define PW_CORE_PROP_HOST_NAME "pipewire.core.host-name"

The host name of the machine.

Referenced by pw_core::pw_core_new().

## ◆ PW_CORE_PROP_NAME

#define PW_CORE_PROP_NAME "pipewire.core.name"

The name of the core.

Default is pipewire-<user-name>-<pid>

Referenced by pw_core::pw_core_new(), and pw_pipewire::pw_fill_remote_properties().

## ◆ PW_CORE_PROP_USER_NAME

#define PW_CORE_PROP_USER_NAME "pipewire.core.user-name"

The user name that started the core.

Referenced by pw_core::pw_core_new().

## ◆ PW_CORE_PROP_VERSION

#define PW_CORE_PROP_VERSION "pipewire.core.version"

The version of the core.

Referenced by pw_core::pw_core_new(), and pw_pipewire::pw_fill_remote_properties().

## ◆ PW_PERM_IS_R

#define PW_PERM_IS_R | ( |  | p | ) | (((p)&PW_PERM_R) == PW_PERM_R)

Referenced by pw_core_find_global(), pw_core::pw_core_find_port(), pw_core_for_each_global(), pw_global::pw_global_destroy(), and pw_global::pw_global_register().

## ◆ PW_PERM_IS_W

#define PW_PERM_IS_W | ( |  | p | ) | (((p)&PW_PERM_W) == PW_PERM_W)

## ◆ PW_PERM_IS_X

#define PW_PERM_IS_X | ( |  | p | ) | (((p)&PW_PERM_X) == PW_PERM_X)

## ◆ PW_PERM_R

#define PW_PERM_R 0400

object can be seen and events can be received

## ◆ PW_PERM_RWX

#define PW_PERM_RWX (PW_PERM_R|PW_PERM_W|PW_PERM_X)

Referenced by pw_global_get_permissions().

## ◆ PW_PERM_W

#define PW_PERM_W 0200

methods can be called that modify the object

## ◆ PW_PERM_X

#define PW_PERM_X 0100

methods can be called on the object.

The W flag must be present in order to call methods that modify the object.

## ◆ PW_VERSION_CORE_EVENTS

#define PW_VERSION_CORE_EVENTS 0

## Function Documentation

## ◆ pw_core_add_listener()

void pw_core_add_listener | ( | struct pw_core * | core,
|  | struct spa_hook * | listener,
|  | const struct pw_core_events * | events,
|  | void * | data
| ) |  |

Add a new event listener to a core.

## ◆ pw_core_destroy()

void pw_core_destroy | ( | struct pw_core * | core | ) |

destroy a core object, all resources except the main_loop will be destroyed

## ◆ pw_core_find_factory()

struct pw_factory* pw_core_find_factory | ( | struct pw_core * | core,
|  | const char * | name
| ) |  |

Find a factory by name.

Parameters

  core | the core
  name | the factory name

## ◆ pw_core_find_global()

struct pw_global* pw_core_find_global | ( | struct pw_core * | core,
|  | uint32_t | id
| ) |  |

Find a core global by id.

Parameters

  core | the core
  id | the global id

References pw_global_get_permissions(), pw_map::pw_map_lookup(), and PW_PERM_IS_R.

## ◆ pw_core_for_each_global()

int pw_core_for_each_global | ( | struct pw_core * | core,
|  | int(*)(void *data, struct pw_global *global) | callback,
|  | void * | data
| ) |  |

Iterate the globals of the core.

The callback should return 0 to fetch the next item, any other value stops the iteration and returns the value. When all callbacks return 0, this function returns 0 when all globals are iterated.

Parameters

  core | the core

References pw_global_get_permissions(), and PW_PERM_IS_R.

## ◆ pw_core_get_global()

struct pw_global* pw_core_get_global | ( | struct pw_core * | core | ) |

Get the core global object.

## ◆ pw_core_get_info()

const struct pw_core_info* pw_core_get_info | ( | struct pw_core * | core | ) |

Get the core info object.

## ◆ pw_core_get_main_loop()

struct pw_loop* pw_core_get_main_loop | ( | struct pw_core * | core | ) |

get the core main loop

## ◆ pw_core_get_properties()

const struct pw_properties* pw_core_get_properties | ( | struct pw_core * | core | ) |

Get the core properties.

## ◆ pw_core_get_support()

const struct spa_support* pw_core_get_support | ( | struct pw_core * | core,
|  | uint32_t * | n_support
| ) |  |

Get the core support objects.

## ◆ pw_core_get_type()

struct pw_type* pw_core_get_type | ( | struct pw_core * | core | ) |

Get the type object of a core.

References pw_type::core.

## ◆ pw_core_new()

struct pw_core* pw_core_new | ( | struct pw_loop * | main_loop,
|  | struct pw_properties * | props
| ) |  |

Make a new core object for a given main_loop.

Ownership of the properties is taken

## ◆ pw_core_update_properties()

int pw_core_update_properties | ( | struct pw_core * | core,
|  | const struct spa_dict * | dict
| ) |  |

Update the core properties.