PipeWire: pw_core Class Reference

PipeWire 0.1.8

Public Member Functions
pw_core Class Reference

the core PipeWire object More...

## Public Member Functions
struct pw_core * | pw_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...
int | pw_core_update_properties (struct pw_core *core, const struct spa_dict *dict)
| Update core properties. More...
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_pod **format_filters, char **error)
| Find a port to link with. More...
int | 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_pod **format_filters, struct spa_pod **format, struct spa_pod_builder *builder, char **error)
| Find a common format between two ports. More...
struct pw_factory * | pw_core_find_factory (struct pw_core *core, const char *name)
| Find a factory by name. More...

## Detailed Description

the core PipeWire object

The core object manages all available resources.

See Core API

## Member Function Documentation

## ◆ pw_core_destroy()

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

Destroy a core object.

Parameters

  core | a core to destroy

References pw_data_loop::pw_data_loop_destroy(), pw_global::pw_global_destroy(), pw_log::pw_log_debug(), pw_map::pw_map_clear(), pw_module::pw_module_destroy(), pw_node::pw_node_destroy(), pw_properties::pw_properties_free(), and pw_remote::pw_remote_destroy().

## ◆ 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 object
  name | the name of the factory to find

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

## ◆ pw_core_find_format()

int 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_pod ** | format_filters,
|  | struct spa_pod ** | format,
|  | struct spa_pod_builder * | builder,
|  | char ** | error
| ) |  |

Find a common format between two ports.

Parameters

  | core | a core object
  | output | an output port
  | input | an input port
  | props | extra properties
  | n_format_filters | number of format filters
  | format_filters | array of format filters
  [out] | error | an 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_type::core, pw_type::param, pw_log::pw_log_debug(), pw_log::pw_log_level_enabled, PW_NODE_STATE_IDLE, and PW_PORT_STATE_CONFIGURE.

Referenced by pw_core_find_port().

## ◆ 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_pod ** | format_filters,
|  | char ** | error
| ) |  |

Find a port to link with.

Parameters

  | core | a core
  | other_port | a port to find a link with
  | id | the id of a port or SPA_ID_INVALID
  | props | extra properties
  | n_format_filters | number of filters
  | format_filters | array of format filters
  [out] | error | an 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_pipewire::pw_direction_reverse(), pw_log::pw_log_debug(), and pw_node::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_loop | the main loop to use
  properties | extra properties for the core, ownership it taken

Returns
  a newly allocated core object

References pw_properties::dict, pw_loop::loop, PW_CORE_PROP_HOST_NAME, PW_CORE_PROP_NAME, PW_CORE_PROP_USER_NAME, PW_CORE_PROP_VERSION, pw_data_loop_get_loop(), pw_data_loop::pw_data_loop_new(), pw_data_loop::pw_data_loop_start(), pw_pipewire::pw_get_host_name(), pw_get_spa_dbus(), pw_pipewire::pw_get_user_name(), pw_global::pw_global_new(), pw_log::pw_log_debug(), pw_log::pw_log_get(), pw_map::pw_map_init(), pw_properties::pw_properties_get(), pw_properties::pw_properties_new(), pw_properties::pw_properties_setf(), pw_type::pw_type_init(), PW_VERSION_CORE, and pw_loop::utils.

## ◆ pw_core_update_properties()

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

Update core properties.

Parameters

  core | a core
  dict | properties to update

Update the core object with the given properties

References PW_CORE_CHANGE_MASK_PROPS, pw_core_resource_info, and pw_properties::pw_properties_set().

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

- core.h
- core.c