PipeWire  0.3.27
core.h File Reference

Go to the source code of this file.

Data Structures

struct  pw_core_info
 The core information. More...
 
struct  pw_core_events
 Core events. More...
 
struct  pw_core_methods
 Core methods. More...
 
struct  pw_registry_events
 Registry events. More...
 
struct  pw_registry_methods
 Registry methods. More...
 

Macros

#define PW_TYPE_INTERFACE_Core   PW_TYPE_INFO_INTERFACE_BASE "Core"
 
#define PW_TYPE_INTERFACE_Registry   PW_TYPE_INFO_INTERFACE_BASE "Registry"
 
#define PW_VERSION_CORE   3
 
#define PW_VERSION_REGISTRY   3
 
#define PW_DEFAULT_REMOTE   "pipewire-0"
 
#define PW_ID_CORE   0
 
#define PW_ID_ANY   (uint32_t)(0xffffffff)
 
#define PW_CORE_CHANGE_MASK_PROPS   (1 << 0)
 
#define PW_CORE_CHANGE_MASK_ALL   ((1 << 1)-1)
 
#define PW_CORE_EVENT_INFO   0
 Core. More...
 
#define PW_CORE_EVENT_DONE   1
 
#define PW_CORE_EVENT_PING   2
 
#define PW_CORE_EVENT_ERROR   3
 
#define PW_CORE_EVENT_REMOVE_ID   4
 
#define PW_CORE_EVENT_BOUND_ID   5
 
#define PW_CORE_EVENT_ADD_MEM   6
 
#define PW_CORE_EVENT_REMOVE_MEM   7
 
#define PW_CORE_EVENT_NUM   8
 
#define PW_VERSION_CORE_EVENTS   0
 
#define PW_CORE_METHOD_ADD_LISTENER   0
 
#define PW_CORE_METHOD_HELLO   1
 
#define PW_CORE_METHOD_SYNC   2
 
#define PW_CORE_METHOD_PONG   3
 
#define PW_CORE_METHOD_ERROR   4
 
#define PW_CORE_METHOD_GET_REGISTRY   5
 
#define PW_CORE_METHOD_CREATE_OBJECT   6
 
#define PW_CORE_METHOD_DESTROY   7
 
#define PW_CORE_METHOD_NUM   8
 
#define PW_VERSION_CORE_METHODS   0
 
#define pw_core_method(o, method, version, ...)
 
#define pw_core_add_listener(c, ...)   pw_core_method(c,add_listener,0,__VA_ARGS__)
 
#define pw_core_hello(c, ...)   pw_core_method(c,hello,0,__VA_ARGS__)
 
#define pw_core_sync(c, ...)   pw_core_method(c,sync,0,__VA_ARGS__)
 
#define pw_core_pong(c, ...)   pw_core_method(c,pong,0,__VA_ARGS__)
 
#define pw_core_error(c, ...)   pw_core_method(c,error,0,__VA_ARGS__)
 
#define pw_core_destroy(c, ...)   pw_core_method(c,destroy,0,__VA_ARGS__)
 
#define PW_REGISTRY_EVENT_GLOBAL   0
 
#define PW_REGISTRY_EVENT_GLOBAL_REMOVE   1
 
#define PW_REGISTRY_EVENT_NUM   2
 
#define PW_VERSION_REGISTRY_EVENTS   0
 
#define PW_REGISTRY_METHOD_ADD_LISTENER   0
 
#define PW_REGISTRY_METHOD_BIND   1
 
#define PW_REGISTRY_METHOD_DESTROY   2
 
#define PW_REGISTRY_METHOD_NUM   3
 
#define PW_VERSION_REGISTRY_METHODS   0
 
#define pw_registry_method(o, method, version, ...)
 
#define pw_registry_add_listener(p, ...)   pw_registry_method(p,add_listener,0,__VA_ARGS__)
 Registry. More...
 
#define pw_registry_destroy(p, ...)   pw_registry_method(p,destroy,0,__VA_ARGS__)
 

Functions

 vsnprintf (buffer, sizeof(buffer), message, args)
 
return pw_core_error (core, id, seq, res, buffer)
 
 va_start (args, message)
 
 va_end (args)
 
int pw_core_steal_fd (struct pw_core *core)
 Steal the fd of the core connection or < 0 on error. More...
 
int pw_core_set_paused (struct pw_core *core, bool paused)
 Pause or resume the core. More...
 
int pw_core_disconnect (struct pw_core *core)
 disconnect and destroy a core More...
 
void * pw_core_get_user_data (struct pw_core *core)
 Get the user_data. More...
 
struct pw_client * pw_core_get_client (struct pw_core *core)
 Get the client proxy of the connected core. More...
 
struct pw_contextpw_core_get_context (struct pw_core *core)
 Get the context object used to created this core. More...
 
const struct pw_propertiespw_core_get_properties (struct pw_core *core)
 Get properties from the core. More...
 
int pw_core_update_properties (struct pw_core *core, const struct spa_dict *dict)
 Update the core properties. More...
 
struct pw_mempoolpw_core_get_mempool (struct pw_core *core)
 Get the core mempool object. More...
 
struct pw_proxypw_core_find_proxy (struct pw_core *core, uint32_t id)
 Get the proxy with the given id. More...
 
struct pw_proxypw_core_export (struct pw_core *core, const char *type, const struct spa_dict *props, void *object, size_t user_data_size)
 Export an object into the PipeWire instance associated with core. More...
 

Variables

static uint32_t id
 
static uint32_t int seq
 
static uint32_t int int res
 
static uint32_t int int const char * message
 
static uint32_t int int const char va_list args
 
 buffer [1023] = '\0'
 
static uint32_t int int const char int r
 

Macro Definition Documentation

◆ pw_core_add_listener

#define pw_core_add_listener (   c,
  ... 
)    pw_core_method(c,add_listener,0,__VA_ARGS__)

◆ PW_CORE_CHANGE_MASK_ALL

#define PW_CORE_CHANGE_MASK_ALL   ((1 << 1)-1)

◆ PW_CORE_CHANGE_MASK_PROPS

#define PW_CORE_CHANGE_MASK_PROPS   (1 << 0)

◆ pw_core_destroy

#define pw_core_destroy (   c,
  ... 
)    pw_core_method(c,destroy,0,__VA_ARGS__)

◆ pw_core_error

#define pw_core_error (   c,
  ... 
)    pw_core_method(c,error,0,__VA_ARGS__)

◆ PW_CORE_EVENT_ADD_MEM

#define PW_CORE_EVENT_ADD_MEM   6

◆ PW_CORE_EVENT_BOUND_ID

#define PW_CORE_EVENT_BOUND_ID   5

◆ PW_CORE_EVENT_DONE

#define PW_CORE_EVENT_DONE   1

◆ PW_CORE_EVENT_ERROR

#define PW_CORE_EVENT_ERROR   3

◆ PW_CORE_EVENT_INFO

#define PW_CORE_EVENT_INFO   0

Core.

◆ PW_CORE_EVENT_NUM

#define PW_CORE_EVENT_NUM   8

◆ PW_CORE_EVENT_PING

#define PW_CORE_EVENT_PING   2

◆ PW_CORE_EVENT_REMOVE_ID

#define PW_CORE_EVENT_REMOVE_ID   4

◆ PW_CORE_EVENT_REMOVE_MEM

#define PW_CORE_EVENT_REMOVE_MEM   7

◆ pw_core_hello

#define pw_core_hello (   c,
  ... 
)    pw_core_method(c,hello,0,__VA_ARGS__)

◆ pw_core_method

#define pw_core_method (   o,
  method,
  version,
  ... 
)
Value:
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_core_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})

◆ PW_CORE_METHOD_ADD_LISTENER

#define PW_CORE_METHOD_ADD_LISTENER   0

◆ PW_CORE_METHOD_CREATE_OBJECT

#define PW_CORE_METHOD_CREATE_OBJECT   6

◆ PW_CORE_METHOD_DESTROY

#define PW_CORE_METHOD_DESTROY   7

◆ PW_CORE_METHOD_ERROR

#define PW_CORE_METHOD_ERROR   4

◆ PW_CORE_METHOD_GET_REGISTRY

#define PW_CORE_METHOD_GET_REGISTRY   5

◆ PW_CORE_METHOD_HELLO

#define PW_CORE_METHOD_HELLO   1

◆ PW_CORE_METHOD_NUM

#define PW_CORE_METHOD_NUM   8

◆ PW_CORE_METHOD_PONG

#define PW_CORE_METHOD_PONG   3

◆ PW_CORE_METHOD_SYNC

#define PW_CORE_METHOD_SYNC   2

◆ pw_core_pong

#define pw_core_pong (   c,
  ... 
)    pw_core_method(c,pong,0,__VA_ARGS__)

◆ pw_core_sync

#define pw_core_sync (   c,
  ... 
)    pw_core_method(c,sync,0,__VA_ARGS__)

◆ PW_DEFAULT_REMOTE

#define PW_DEFAULT_REMOTE   "pipewire-0"

◆ PW_ID_ANY

#define PW_ID_ANY   (uint32_t)(0xffffffff)

◆ PW_ID_CORE

#define PW_ID_CORE   0

◆ pw_registry_add_listener

#define pw_registry_add_listener (   p,
  ... 
)    pw_registry_method(p,add_listener,0,__VA_ARGS__)

Registry.

◆ pw_registry_destroy

#define pw_registry_destroy (   p,
  ... 
)    pw_registry_method(p,destroy,0,__VA_ARGS__)

◆ PW_REGISTRY_EVENT_GLOBAL

#define PW_REGISTRY_EVENT_GLOBAL   0

◆ PW_REGISTRY_EVENT_GLOBAL_REMOVE

#define PW_REGISTRY_EVENT_GLOBAL_REMOVE   1

◆ PW_REGISTRY_EVENT_NUM

#define PW_REGISTRY_EVENT_NUM   2

◆ pw_registry_method

#define pw_registry_method (   o,
  method,
  version,
  ... 
)
Value:
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_registry_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})

◆ PW_REGISTRY_METHOD_ADD_LISTENER

#define PW_REGISTRY_METHOD_ADD_LISTENER   0

◆ PW_REGISTRY_METHOD_BIND

#define PW_REGISTRY_METHOD_BIND   1

◆ PW_REGISTRY_METHOD_DESTROY

#define PW_REGISTRY_METHOD_DESTROY   2

◆ PW_REGISTRY_METHOD_NUM

#define PW_REGISTRY_METHOD_NUM   3

◆ PW_TYPE_INTERFACE_Core

#define PW_TYPE_INTERFACE_Core   PW_TYPE_INFO_INTERFACE_BASE "Core"

◆ PW_TYPE_INTERFACE_Registry

#define PW_TYPE_INTERFACE_Registry   PW_TYPE_INFO_INTERFACE_BASE "Registry"

◆ PW_VERSION_CORE

#define PW_VERSION_CORE   3

◆ PW_VERSION_CORE_EVENTS

#define PW_VERSION_CORE_EVENTS   0

◆ PW_VERSION_CORE_METHODS

#define PW_VERSION_CORE_METHODS   0

◆ PW_VERSION_REGISTRY

#define PW_VERSION_REGISTRY   3

◆ PW_VERSION_REGISTRY_EVENTS

#define PW_VERSION_REGISTRY_EVENTS   0

◆ PW_VERSION_REGISTRY_METHODS

#define PW_VERSION_REGISTRY_METHODS   0

Function Documentation

◆ pw_core_disconnect()

int pw_core_disconnect ( struct pw_core *  core)

disconnect and destroy a core

References NAME, pw_log::pw_log_debug, pw_proxy::pw_proxy_destroy(), and pw_proxy_remove().

Referenced by pw_filter_disconnect(), and pw_stream_disconnect().

◆ pw_core_error()

return pw_core_error ( core  ,
id  ,
seq  ,
res  ,
buffer   
)

Referenced by pw_proxy_error().

◆ pw_core_export()

struct pw_proxy* pw_core_export ( struct pw_core *  core,
const char *  type,
const struct spa_dict props,
void *  object,
size_t  user_data_size 
)

Export an object into the PipeWire instance associated with core.

Parameters
corethe core
typethe type of object
propsextra properties
objectobject to export
user_data_sizeextra user data

References pw_export_type::func, NAME, pw_context_find_export_type(), pw_log::pw_log_debug, pw_log::pw_log_error, res, and pw_export_type::type.

◆ pw_core_find_proxy()

struct pw_proxy* pw_core_find_proxy ( struct pw_core *  core,
uint32_t  id 
)

Get the proxy with the given id.

References pw_map::pw_map_lookup().

◆ pw_core_get_client()

struct pw_client* pw_core_get_client ( struct pw_core *  core)

Get the client proxy of the connected core.

This will have the id of PW_ID_CLIENT (1)

◆ pw_core_get_context()

struct pw_context* pw_core_get_context ( struct pw_core *  core)

Get the context object used to created this core.

◆ pw_core_get_mempool()

struct pw_mempool* pw_core_get_mempool ( struct pw_core *  core)

Get the core mempool object.

◆ pw_core_get_properties()

const struct pw_properties* pw_core_get_properties ( struct pw_core *  core)

Get properties from the core.

◆ pw_core_get_user_data()

void* pw_core_get_user_data ( struct pw_core *  core)

Get the user_data.

It is of the size specified when this object was constructed

◆ pw_core_set_paused()

int pw_core_set_paused ( struct pw_core *  core,
bool  paused 
)

Pause or resume the core.

When the core is paused, no new events will be dispatched until the core is resumed again.

References NAME, pw_log::pw_log_debug, and pw_protocol_client_set_paused.

◆ pw_core_steal_fd()

int pw_core_steal_fd ( struct pw_core *  core)

Steal the fd of the core connection or < 0 on error.

The core will be disconnected after this call.

References NAME, pw_log::pw_log_debug, and pw_protocol_client_steal_fd.

◆ pw_core_update_properties()

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

Update the core properties.

This updates the properties of the associated client.

Returns
the number of properties that were updated

References pw_properties::dict, NAME, pw_client_update_properties, pw_log::pw_log_debug, and pw_properties::pw_properties_update().

◆ va_end()

◆ va_start()

◆ vsnprintf()

vsnprintf ( buffer  ,
sizeof(buffer ,
message  ,
args   
)

Variable Documentation

◆ args

uint32_t int int const char va_list args

◆ buffer

buffer[1023] = '\0'

◆ id

static uint32_t id

◆ message

static uint32_t int int const char * message

◆ r

return r

◆ res

static uint32_t int int res

Referenced by pw_buffers_negotiate(), pw_conf_save_state(), pw_context_connect(), pw_context_connect_fd(), pw_impl_client::pw_context_create_client(), pw_context_create_core(), pw_context_create_device(), pw_context_create_factory(), pw_context_create_link(), pw_context_create_node(), pw_context_create_port(), pw_impl_module::pw_context_load_module(), pw_context_parse_conf_section(), pw_control_add_link(), pw_control_remove_link(), pw_core_export(), pw_data_loop_invoke(), pw_data_loop_wait(), pw_filter_add_port(), pw_filter_connect(), pw_filter_dequeue_buffer(), pw_filter_new_simple(), pw_filter_queue_buffer(), pw_filter_set_error(), pw_filter_update_params(), pw_global::pw_global_bind(), pw_global_for_each_resource(), pw_global::pw_global_new(), pw_impl_client_update_properties(), pw_impl_core_register(), pw_impl_device_for_each_param(), pw_impl_factory_create_object(), pw_impl_link_activate(), pw_impl_node_for_each_param(), pw_impl_node_for_each_port(), pw_impl_node_get_free_port_id(), pw_impl_node_set_implementation(), pw_impl_node::pw_impl_node_set_state(), pw_impl_port_add(), pw_impl_port_for_each_filtered_param(), pw_impl_port_for_each_link(), pw_impl_port_for_each_param(), pw_impl_port_init_mix(), pw_impl_port_release_mix(), pw_impl_port_set_param(), pw_impl_port_use_buffers(), pw_loop::pw_loop_new(), pw_main_loop::pw_main_loop_run(), pw_map::pw_map_for_each(), pw_memblock::pw_mempool_alloc(), pw_properties::pw_properties_new_string(), pw_properties::pw_properties_setf(), pw_proxy_error(), pw_proxy_errorf(), pw_proxy_init(), pw_proxy::pw_proxy_new(), pw_proxy_sync(), pw_resource_error(), pw_resource_errorf(), pw_resource_errorf_id(), pw_resource_new(), pw_resource_ping(), pw_stream_connect(), pw_stream_dequeue_buffer(), pw_stream_new_simple(), pw_stream_queue_buffer(), pw_stream_set_error(), pw_stream_update_params(), pw_stream_update_properties(), pw_work_queue::pw_work_queue_add(), pw_work_queue::pw_work_queue_complete(), and pw_work_queue::pw_work_queue_new().

◆ seq

pw_core_methods
Core methods.
Definition: core.h:220
buffer
Definition: filter.c:58
args
static uint32_t int int const char va_list args
Definition: core.h:327
pw_registry_methods
Registry methods.
Definition: core.h:448