mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-08 13:30:08 -05:00
core-proxy: add connect_self
This commit is contained in:
parent
ca6f1bd2f1
commit
7b0b5b77c3
2 changed files with 26 additions and 0 deletions
|
|
@ -409,6 +409,24 @@ error_free:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPA_EXPORT
|
||||||
|
struct pw_core_proxy *
|
||||||
|
pw_core_connect_self(struct pw_core *core, struct pw_properties *properties,
|
||||||
|
size_t user_data_size)
|
||||||
|
{
|
||||||
|
const struct pw_core_info *info;
|
||||||
|
|
||||||
|
if (properties == NULL)
|
||||||
|
properties = pw_properties_new(NULL, NULL);
|
||||||
|
if (properties == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
info = pw_core_get_info(core);
|
||||||
|
pw_properties_set(properties, PW_KEY_REMOTE_NAME, info->name);
|
||||||
|
|
||||||
|
return pw_core_connect(core, properties, user_data_size);
|
||||||
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
int pw_core_proxy_steal_fd(struct pw_core_proxy *proxy)
|
int pw_core_proxy_steal_fd(struct pw_core_proxy *proxy)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,14 @@ pw_core_connect_fd(struct pw_core *core, /**< a \ref pw_core */
|
||||||
* the properties is taken.*/
|
* the properties is taken.*/
|
||||||
size_t user_data_size /**< extra user data size */);
|
size_t user_data_size /**< extra user data size */);
|
||||||
|
|
||||||
|
/** Connect to a given PipeWire instance \memberof pw_core_proxy
|
||||||
|
* \return a pw_core_proxy on success or NULL with errno set on error */
|
||||||
|
struct pw_core_proxy *
|
||||||
|
pw_core_connect_self(struct pw_core *core, /**< a \ref pw_core to connect to */
|
||||||
|
struct pw_properties *properties, /**< optional properties, ownership of
|
||||||
|
* the properties is taken.*/
|
||||||
|
size_t user_data_size /**< extra user data size */);
|
||||||
|
|
||||||
/** Steal the fd of the core_proxy connection or < 0 on error. The core_proxy
|
/** Steal the fd of the core_proxy connection or < 0 on error. The core_proxy
|
||||||
* will be disconnected after this call. */
|
* will be disconnected after this call. */
|
||||||
int pw_core_proxy_steal_fd(struct pw_core_proxy *core_proxy);
|
int pw_core_proxy_steal_fd(struct pw_core_proxy *core_proxy);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue