PipeWire  0.1.5
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_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...
 

Typedefs

typedef uint32_t(* pw_permission_func_t) (struct pw_global *global, struct pw_client *client, void *data)
 the permission function. More...
 

Functions

struct pw_corepw_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...
 
void pw_core_set_permission_callback (struct pw_core *core, pw_permission_func_t callback, void *data)
 Set a callback that will be called to check the permissions of a global object for a client. More...
 
struct pw_typepw_core_get_type (struct pw_core *core)
 Get the type object of a core. More...
 
const struct pw_core_infopw_core_get_info (struct pw_core *core)
 Get the core info object. More...
 
struct pw_globalpw_core_get_global (struct pw_core *core)
 Get the core global object. More...
 
const struct pw_propertiespw_core_get_properties (struct pw_core *core)
 Get the core properties. More...
 
void 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_looppw_core_get_main_loop (struct pw_core *core)
 get the core main loop More...
 
bool pw_core_for_each_global (struct pw_core *core, bool(*callback)(void *data, struct pw_global *global), void *data)
 iterate the globals More...
 
struct pw_globalpw_core_find_global (struct pw_core *core, uint32_t id)
 Find a core global by id. More...
 
struct spa_format * pw_core_find_format (struct pw_core *core, struct pw_port *output, struct pw_port *input, struct pw_properties *props, uint32_t n_format_filters, struct spa_format **format_filters, char **error)
 Find a good format between 2 ports. More...
 
struct pw_portpw_core_find_port (struct pw_core *core, struct pw_port *other_port, uint32_t id, struct pw_properties *props, uint32_t n_format_filters, struct spa_format **format_filters, char **error)
 Find a ports compatible with other_port and the format filters. More...
 
struct pw_factorypw_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_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_VERSION

#define PW_CORE_PROP_VERSION   "pipewire.core.version"

The version of the core.

Referenced by pw_pipewire::pw_fill_remote_properties().

◆ PW_PERM_IS_R

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

◆ 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)

◆ 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

Typedef Documentation

◆ pw_permission_func_t

typedef uint32_t(* pw_permission_func_t) (struct pw_global *global, struct pw_client *client, void *data)

the permission function.

It returns the allowed access permissions for global for client

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.

◆ pw_core_find_format()

struct spa_format* pw_core_find_format ( struct pw_core core,
struct pw_port output,
struct pw_port input,
struct pw_properties props,
uint32_t  n_format_filters,
struct spa_format **  format_filters,
char **  error 
)

Find a good format between 2 ports.

Referenced by pw_core::pw_core_find_port().

◆ pw_core_find_global()

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

Find a core global by id.

◆ pw_core_find_port()

struct pw_port* pw_core_find_port ( struct pw_core core,
struct pw_port other_port,
uint32_t  id,
struct pw_properties props,
uint32_t  n_format_filters,
struct spa_format **  format_filters,
char **  error 
)

Find a ports compatible with other_port and the format filters.

◆ pw_core_for_each_global()

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

iterate the globals

◆ 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.

◆ 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_set_permission_callback()

void pw_core_set_permission_callback ( struct pw_core core,
pw_permission_func_t  callback,
void *  data 
)

Set a callback that will be called to check the permissions of a global object for a client.

◆ pw_core_update_properties()

void pw_core_update_properties ( struct pw_core core,
const struct spa_dict *  dict 
)

Update the core properties.