PipeWire  0.1.4.1
pw_core Class Reference

the core PipeWire object More...

Public Member Functions

struct pw_corepw_core_new (struct pw_loop *main_loop, struct pw_properties *properties)
 Create a new core object. More...
 
void pw_core_destroy (struct pw_core *core)
 Destroy a core object. More...
 
void pw_core_update_properties (struct pw_core *core, const struct spa_dict *dict)
 Update core properties. 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 port to link with. 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 common format between two ports. More...
 
struct pw_node_factorypw_core_find_node_factory (struct pw_core *core, const char *name)
 Find a node by name. More...
 
struct pw_globalpw_core_add_global (struct pw_core *core, struct pw_client *owner, struct pw_global *parent, uint32_t type, uint32_t version, pw_bind_func_t bind, void *object)
 Create and add a new global to the core. More...
 

Detailed Description

the core PipeWire object

The core object manages all available resources.

See Core API

Member Function Documentation

◆ pw_core_add_global()

struct pw_global * pw_core_add_global ( struct pw_core core,
struct pw_client owner,
struct pw_global parent,
uint32_t  type,
uint32_t  version,
pw_bind_func_t  bind,
void *  object 
)

Create and add a new global to the core.

Parameters
corea core
owneran optional owner of the global
typethe type of the global
n_ifacesnumber of interfaces
ifacesinterface information
objectthe associated object
binda function to bind to this global
[out]globala result global
Returns
true on success

References pw_global_get_permissions(), PW_PERM_IS_R, and pw_registry_resource_global.

Referenced by pw_node_factory_export().

◆ pw_core_destroy()

void pw_core_destroy ( struct pw_core core)

Destroy a core object.

Parameters
corea core to destroy

References pw_data_loop_destroy(), pw_global_destroy(), pw_module_destroy(), and pw_properties_free().

◆ 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 common format between two ports.

Parameters
corea core object
outputan output port
inputan input port
propsextra properties
n_format_filtersnumber of format filters
format_filtersarray of format filters
[out]erroran error when something is wrong
Returns
a common format of NULL on error

Find a common format between the given ports. The format will be restricted to a subset given with the format filters.

References PW_NODE_STATE_IDLE, and PW_PORT_STATE_CONFIGURE.

◆ pw_core_find_node_factory()

struct pw_node_factory * pw_core_find_node_factory ( struct pw_core core,
const char *  name 
)

Find a node by name.

Parameters
corethe core object
namethe name of the node to find

Find in the list of nodes registered in core for one with the given name.

◆ 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 port to link with.

Parameters
corea core
other_porta port to find a link with
idthe id of a port or SPA_ID_INVALID
propsextra properties
n_format_filtersnumber of filters
format_filtersarray of format filters
[out]erroran error when something is wrong
Returns
a port that can be used to link to otherport or NULL on error

References pw_core_find_format(), PW_DIRECTION_OUTPUT, pw_direction_reverse(), and pw_node_get_free_port().

◆ pw_core_new()

struct pw_core * pw_core_new ( struct pw_loop main_loop,
struct pw_properties properties 
)

Create a new core object.

Parameters
main_loopthe main loop to use
propertiesextra properties for the core, ownership it taken
Returns
a newly allocated core object

References pw_properties::dict, pw_loop::loop, pw_core_add_global(), pw_data_loop_get_loop(), pw_data_loop_new(), pw_data_loop_start(), pw_get_host_name(), pw_get_user_name(), pw_log_get(), pw_properties_get(), pw_properties_new(), pw_properties_setf(), pw_type_init(), and PW_VERSION_CORE.

◆ pw_core_update_properties()

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

Update core properties.

Parameters
corea core
dictproperties to update

Update the core object with the given properties

References PW_CORE_CHANGE_MASK_PROPS, pw_core_resource_info, and pw_properties_set().


The documentation for this class was generated from the following files: