PipeWire
0.3.66
|
The core global object. More...
Files | |
file | core.h |
pipewire/core.h | |
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_core |
struct | pw_registry |
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" |
The default remote name to connect to. More... | |
#define | PW_ID_CORE 0 |
default ID for the core object after connect More... | |
#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__) |
Start a conversation with the server. More... | |
#define | pw_core_sync(c, ...) pw_core_method(c,sync,0,__VA_ARGS__) |
Do server roundtrip. More... | |
#define | pw_core_pong(c, ...) pw_core_method(c,pong,0,__VA_ARGS__) |
Reply to a server ping event. More... | |
#define | pw_core_error(c, ...) pw_core_method(c,error,0,__VA_ARGS__) |
Fatal error event. More... | |
#define | pw_core_destroy(c, ...) pw_core_method(c,destroy,0,__VA_ARGS__) |
Destroy an resource. More... | |
Functions | |
struct pw_core_info * | pw_core_info_update (struct pw_core_info *info, const struct pw_core_info *update) |
Update an existing pw_core_info with update with reset. More... | |
struct pw_core_info * | pw_core_info_merge (struct pw_core_info *info, const struct pw_core_info *update, bool reset) |
Update an existing pw_core_info with update. More... | |
void | pw_core_info_free (struct pw_core_info *info) |
Free a pw_core_info More... | |
static int | pw_core_errorv (struct pw_core *core, uint32_t id, int seq, int res, const char *message, va_list args) |
static int | pw_core_errorf (struct pw_core *core, uint32_t id, int seq, int res, const char *message,...) |
static struct pw_registry * | pw_core_get_registry (struct pw_core *core, uint32_t version, size_t user_data_size) |
static void * | pw_core_create_object (struct pw_core *core, const char *factory_name, const char *type, uint32_t version, const struct spa_dict *props, size_t user_data_size) |
struct pw_core * | pw_context_connect (struct pw_context *context, struct pw_properties *properties, size_t user_data_size) |
Connect to a PipeWire instance. More... | |
struct pw_core * | pw_context_connect_fd (struct pw_context *context, int fd, struct pw_properties *properties, size_t user_data_size) |
Connect to a PipeWire instance on the given socket. More... | |
struct pw_core * | pw_context_connect_self (struct pw_context *context, struct pw_properties *properties, size_t user_data_size) |
Connect to a given PipeWire instance. More... | |
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_context * | pw_core_get_context (struct pw_core *core) |
Get the context object used to created this core. More... | |
const struct pw_properties * | pw_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_mempool * | pw_core_get_mempool (struct pw_core *core) |
Get the core mempool object. More... | |
struct pw_proxy * | pw_core_find_proxy (struct pw_core *core, uint32_t id) |
Get the proxy with the given id. More... | |
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. More... | |
The core global object.
This is a special singleton object. It is used for internal PipeWire protocol features. Connecting to a PipeWire instance returns one core object, the caller should then register event listeners using pw_core_add_listener.
Updates to the core object are then provided through the pw_core_events interface. See Tutorial - Part 2: Enumerating Objects for an example.
#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" |
The default remote name to connect to.
#define PW_ID_CORE 0 |
default ID for the core object after connect
#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.
#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__) |
Start a conversation with the server.
This will send the core info and will destroy all resources for the client (except the core and client resource).
#define pw_core_sync | ( | c, | |
... | |||
) | pw_core_method(c,sync,0,__VA_ARGS__) |
Do server roundtrip.
Ask the server to emit the 'done' event with seq.
Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
seq | the seq number passed to the done event |
#define pw_core_pong | ( | c, | |
... | |||
) | pw_core_method(c,pong,0,__VA_ARGS__) |
Reply to a server ping event.
Reply to the server ping event with the same seq.
seq | the seq number received in the ping event |
#define pw_core_error | ( | c, | |
... | |||
) | pw_core_method(c,error,0,__VA_ARGS__) |
Fatal error event.
The error method is sent out when a fatal (non-recoverable) error has occurred. The id argument is the proxy object where the error occurred, most often in response to an event on that object. The message is a brief description of the error, for (debugging) convenience.
This method is usually also emitted on the resource object with id.
id | object where the error occurred |
res | error code |
message | error description |
#define pw_core_destroy | ( | c, | |
... | |||
) | pw_core_method(c,destroy,0,__VA_ARGS__) |
Destroy an resource.
Destroy the server resource for the given proxy.
obj | the proxy to destroy |
struct pw_core_info* pw_core_info_update | ( | struct pw_core_info * | info, |
const struct pw_core_info * | update | ||
) |
Update an existing pw_core_info with update with reset.
struct pw_core_info* pw_core_info_merge | ( | struct pw_core_info * | info, |
const struct pw_core_info * | update, | ||
bool | reset | ||
) |
Update an existing pw_core_info with update.
void pw_core_info_free | ( | struct pw_core_info * | info | ) |
Free a pw_core_info
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
struct pw_core* pw_context_connect | ( | struct pw_context * | context, |
struct pw_properties * | properties, | ||
size_t | user_data_size | ||
) |
Connect to a PipeWire instance.
context | a Context |
properties | optional properties, ownership of the properties is taken. |
user_data_size | extra user data size |
struct pw_core* pw_context_connect_fd | ( | struct pw_context * | context, |
int | fd, | ||
struct pw_properties * | properties, | ||
size_t | user_data_size | ||
) |
Connect to a PipeWire instance on the given socket.
context | a Context |
fd | the connected socket to use, the socket will be closed automatically on disconnect or error. |
properties | optional properties, ownership of the properties is taken. |
user_data_size | extra user data size |
struct pw_core* pw_context_connect_self | ( | struct pw_context * | context, |
struct pw_properties * | properties, | ||
size_t | user_data_size | ||
) |
Connect to a given PipeWire instance.
context | a Context to connect to |
properties | optional properties, ownership of the properties is taken. |
user_data_size | extra user data size |
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.
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.
int pw_core_disconnect | ( | struct pw_core * | core | ) |
disconnect and destroy a core
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
Get the client proxy of the connected core.
This will have the id of PW_ID_CLIENT (1)
struct pw_context* pw_core_get_context | ( | struct pw_core * | core | ) |
Get the context object used to created this core.
const struct pw_properties* pw_core_get_properties | ( | struct pw_core * | core | ) |
Get properties from the core.
Update the core properties.
This updates the properties of the associated client.
struct pw_mempool* pw_core_get_mempool | ( | struct pw_core * | core | ) |
Get the core mempool object.
Get the proxy with the given id.
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.
core | the core |
type | the type of object |
props | extra properties |
object | object to export |
user_data_size | extra user data |