mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
pass spa_dict around as config
Don't pass pw_properties around when we simply need to pass around config info, only use pw_properties when used to construct an object that keeps the properties.
This commit is contained in:
parent
3eec3f5abf
commit
1317ca140c
20 changed files with 73 additions and 68 deletions
|
|
@ -142,7 +142,7 @@ static struct node *create_node(struct object *obj, uint32_t id,
|
||||||
node->handle = handle;
|
node->handle = handle;
|
||||||
node->node = iface;
|
node->node = iface;
|
||||||
node->proxy = pw_core_export(impl->core,
|
node->proxy = pw_core_export(impl->core,
|
||||||
info->type, pw_properties_new_dict(info->props), node->node, 0);
|
info->type, info->props, node->node, 0);
|
||||||
if (node->proxy == NULL)
|
if (node->proxy == NULL)
|
||||||
goto clean_node;
|
goto clean_node;
|
||||||
|
|
||||||
|
|
@ -250,7 +250,7 @@ static struct object *create_object(struct impl *impl, uint32_t id,
|
||||||
obj->handle = handle;
|
obj->handle = handle;
|
||||||
obj->device = iface;
|
obj->device = iface;
|
||||||
obj->proxy = pw_core_export(impl->core,
|
obj->proxy = pw_core_export(impl->core,
|
||||||
info->type, pw_properties_new_dict(info->props), obj->device, 0);
|
info->type, info->props, obj->device, 0);
|
||||||
if (obj->proxy == NULL)
|
if (obj->proxy == NULL)
|
||||||
goto clean_object;
|
goto clean_object;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,9 @@ static void make_node(struct data *data)
|
||||||
SPA_TYPE_INTERFACE_Node,
|
SPA_TYPE_INTERFACE_Node,
|
||||||
SPA_VERSION_NODE,
|
SPA_VERSION_NODE,
|
||||||
&impl_node, data);
|
&impl_node, data);
|
||||||
pw_core_export(data->core, SPA_TYPE_INTERFACE_Node, props, &data->impl_node, 0);
|
pw_core_export(data->core, SPA_TYPE_INTERFACE_Node,
|
||||||
|
&props->dict, &data->impl_node, 0);
|
||||||
|
pw_properties_free(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_permissions(struct data *data)
|
static void set_permissions(struct data *data)
|
||||||
|
|
|
||||||
|
|
@ -482,7 +482,9 @@ static void make_node(struct data *data)
|
||||||
SPA_TYPE_INTERFACE_Node,
|
SPA_TYPE_INTERFACE_Node,
|
||||||
SPA_VERSION_NODE,
|
SPA_VERSION_NODE,
|
||||||
&impl_node, data);
|
&impl_node, data);
|
||||||
pw_core_export(data->core, SPA_TYPE_INTERFACE_Node, props, &data->impl_node, 0);
|
pw_core_export(data->core, SPA_TYPE_INTERFACE_Node,
|
||||||
|
&props->dict, &data->impl_node, 0);
|
||||||
|
pw_properties_free(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_core_error(void *data, uint32_t id, int seq, int res, const char *message)
|
static void on_core_error(void *data, uint32_t id, int seq, int res, const char *message)
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,10 @@ static int make_node(struct data *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
data->proxy = pw_core_export(data->core,
|
data->proxy = pw_core_export(data->core,
|
||||||
SPA_TYPE_INTERFACE_Node, props,
|
SPA_TYPE_INTERFACE_Node, &props->dict,
|
||||||
data->node, 0);
|
data->node, 0);
|
||||||
|
pw_properties_free(props);
|
||||||
|
|
||||||
if (data->proxy == NULL)
|
if (data->proxy == NULL)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -583,8 +583,7 @@ static struct device *alsa_create_device(struct impl *impl, uint32_t id,
|
||||||
update_device_props(device);
|
update_device_props(device);
|
||||||
|
|
||||||
device->sdevice = sm_media_session_export_device(impl->session,
|
device->sdevice = sm_media_session_export_device(impl->session,
|
||||||
pw_properties_copy(device->props),
|
&device->props->dict, device->device);
|
||||||
device->device);
|
|
||||||
if (device->sdevice == NULL) {
|
if (device->sdevice == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto clean_device;
|
goto clean_device;
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ static struct bluez5_node *bluez5_create_node(struct bluez5_object *obj, uint32_
|
||||||
}
|
}
|
||||||
node->proxy = sm_media_session_export(impl->session,
|
node->proxy = sm_media_session_export(impl->session,
|
||||||
PW_TYPE_INTERFACE_Node,
|
PW_TYPE_INTERFACE_Node,
|
||||||
pw_properties_copy(node->props),
|
&node->props->dict,
|
||||||
node->adapter, 0);
|
node->adapter, 0);
|
||||||
|
|
||||||
spa_list_append(&obj->node_list, &node->link);
|
spa_list_append(&obj->node_list, &node->link);
|
||||||
|
|
@ -276,7 +276,7 @@ static struct bluez5_object *bluez5_create_object(struct impl *impl, uint32_t id
|
||||||
obj->device = iface;
|
obj->device = iface;
|
||||||
obj->props = pw_properties_new_dict(info->props);
|
obj->props = pw_properties_new_dict(info->props);
|
||||||
obj->proxy = sm_media_session_export(impl->session,
|
obj->proxy = sm_media_session_export(impl->session,
|
||||||
info->type, pw_properties_copy(obj->props), obj->device, 0);
|
info->type, &obj->props->dict, obj->device, 0);
|
||||||
if (obj->proxy == NULL) {
|
if (obj->proxy == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto clean_object;
|
goto clean_object;
|
||||||
|
|
|
||||||
|
|
@ -1210,16 +1210,16 @@ static const struct pw_registry_events registry_events = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
||||||
uint32_t type, struct pw_properties *properties,
|
uint32_t type, const struct spa_dict *props,
|
||||||
void *object, size_t user_data_size)
|
void *object, size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
||||||
return pw_core_export(impl->monitor_core, type,
|
return pw_core_export(impl->monitor_core, type,
|
||||||
properties, object, user_data_size);
|
props, object, user_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
||||||
struct pw_properties *properties, struct spa_device *object)
|
const struct spa_dict *props, struct spa_device *object)
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
struct impl *impl = SPA_CONTAINER_OF(sess, struct impl, this);
|
||||||
struct sm_device *device;
|
struct sm_device *device;
|
||||||
|
|
@ -1228,9 +1228,9 @@ struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
||||||
pw_log_debug(NAME " %p: device %p", impl, object);
|
pw_log_debug(NAME " %p: device %p", impl, object);
|
||||||
|
|
||||||
proxy = pw_core_export(impl->monitor_core, SPA_TYPE_INTERFACE_Device,
|
proxy = pw_core_export(impl->monitor_core, SPA_TYPE_INTERFACE_Device,
|
||||||
properties, object, sizeof(struct sm_device));
|
props, object, sizeof(struct sm_device));
|
||||||
|
|
||||||
device = (struct sm_device *) create_object(impl, proxy, &properties->dict);
|
device = (struct sm_device *) create_object(impl, proxy, props);
|
||||||
|
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,11 +218,11 @@ struct sm_object *sm_media_session_find_object(struct sm_media_session *sess, ui
|
||||||
int sm_media_session_schedule_rescan(struct sm_media_session *sess);
|
int sm_media_session_schedule_rescan(struct sm_media_session *sess);
|
||||||
|
|
||||||
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
struct pw_proxy *sm_media_session_export(struct sm_media_session *sess,
|
||||||
uint32_t type, struct pw_properties *properties,
|
uint32_t type, const struct spa_dict *props,
|
||||||
void *object, size_t user_data_size);
|
void *object, size_t user_data_size);
|
||||||
|
|
||||||
struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
struct sm_device *sm_media_session_export_device(struct sm_media_session *sess,
|
||||||
struct pw_properties *properties, struct spa_device *device);
|
const struct spa_dict *props, struct spa_device *device);
|
||||||
|
|
||||||
struct pw_proxy *sm_media_session_create_object(struct sm_media_session *sess,
|
struct pw_proxy *sm_media_session_create_object(struct sm_media_session *sess,
|
||||||
const char *factory_name, uint32_t type, uint32_t version,
|
const char *factory_name, uint32_t type, uint32_t version,
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ static struct v4l2_object *v4l2_create_object(struct impl *impl, uint32_t id,
|
||||||
v4l2_update_device_props(obj);
|
v4l2_update_device_props(obj);
|
||||||
|
|
||||||
obj->proxy = sm_media_session_export(impl->session,
|
obj->proxy = sm_media_session_export(impl->session,
|
||||||
info->type, pw_properties_copy(obj->props), obj->device, 0);
|
info->type, &obj->props->dict, obj->device, 0);
|
||||||
if (obj->proxy == NULL) {
|
if (obj->proxy == NULL) {
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto clean_object;
|
goto clean_object;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ static const struct spa_dict_item module_props[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_proxy *pw_core_spa_device_export(struct pw_core *core,
|
struct pw_proxy *pw_core_spa_device_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size);
|
size_t user_data_size);
|
||||||
|
|
||||||
struct pw_protocol *pw_protocol_native_ext_client_device_init(struct pw_context *context);
|
struct pw_protocol *pw_protocol_native_ext_client_device_init(struct pw_context *context);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ static const struct pw_proxy_events proxy_events = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_proxy *pw_core_spa_device_export(struct pw_core *core,
|
struct pw_proxy *pw_core_spa_device_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct spa_device *device = object;
|
struct spa_device *device = object;
|
||||||
|
|
@ -65,10 +65,8 @@ struct pw_proxy *pw_core_spa_device_export(struct pw_core *core,
|
||||||
"client-device",
|
"client-device",
|
||||||
SPA_TYPE_INTERFACE_Device,
|
SPA_TYPE_INTERFACE_Device,
|
||||||
SPA_VERSION_DEVICE,
|
SPA_VERSION_DEVICE,
|
||||||
props ? &props->dict : NULL,
|
props,
|
||||||
user_data_size + sizeof(struct device_data));
|
user_data_size + sizeof(struct device_data));
|
||||||
if (props)
|
|
||||||
pw_properties_free(props);
|
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ static const struct spa_dict_item module_props[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_proxy *pw_core_node_export(struct pw_core *core,
|
struct pw_proxy *pw_core_node_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object, size_t user_data_size);
|
uint32_t type, const struct spa_dict *props, void *object, size_t user_data_size);
|
||||||
struct pw_proxy *pw_core_spa_node_export(struct pw_core *core,
|
struct pw_proxy *pw_core_spa_node_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object, size_t user_data_size);
|
uint32_t type, const struct spa_dict *props, void *object, size_t user_data_size);
|
||||||
|
|
||||||
struct pw_protocol *pw_protocol_native_ext_client_node_init(struct pw_context *context);
|
struct pw_protocol *pw_protocol_native_ext_client_node_init(struct pw_context *context);
|
||||||
struct pw_protocol *pw_protocol_native_ext_client_node0_init(struct pw_context *context);
|
struct pw_protocol *pw_protocol_native_ext_client_node0_init(struct pw_context *context);
|
||||||
|
|
|
||||||
|
|
@ -1165,25 +1165,24 @@ static struct pw_proxy *node_export(struct pw_core *core, void *object, bool do_
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pw_proxy *pw_core_node_export(struct pw_core *core,
|
struct pw_proxy *pw_core_node_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct pw_impl_node *node = object;
|
struct pw_impl_node *node = object;
|
||||||
|
|
||||||
if (props) {
|
if (props)
|
||||||
pw_impl_node_update_properties(node, &props->dict);
|
pw_impl_node_update_properties(node, props);
|
||||||
pw_properties_free(props);
|
|
||||||
}
|
|
||||||
return node_export(core, object, false, user_data_size);
|
return node_export(core, object, false, user_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pw_proxy *pw_core_spa_node_export(struct pw_core *core,
|
struct pw_proxy *pw_core_spa_node_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct pw_impl_node *node;
|
struct pw_impl_node *node;
|
||||||
|
|
||||||
node = pw_context_create_node(pw_core_get_context(core), props, 0);
|
node = pw_context_create_node(pw_core_get_context(core),
|
||||||
|
props ? pw_properties_new_dict(props) : NULL, 0);
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ void * pw_metadata_new(struct pw_context *context, struct pw_resource *resource,
|
||||||
struct pw_properties *properties);
|
struct pw_properties *properties);
|
||||||
|
|
||||||
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object, size_t user_data_size);
|
uint32_t type, const struct spa_dict *props, void *object, size_t user_data_size);
|
||||||
|
|
||||||
int pw_protocol_native_ext_metadata_init(struct pw_context *context);
|
int pw_protocol_native_ext_metadata_init(struct pw_context *context);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ static const struct pw_proxy_events proxy_events = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct pw_metadata *meta = object;
|
struct pw_metadata *meta = object;
|
||||||
|
|
@ -62,13 +62,11 @@ struct pw_proxy *pw_core_metadata_export(struct pw_core *core,
|
||||||
struct object_data *data;
|
struct object_data *data;
|
||||||
|
|
||||||
proxy = pw_core_create_object(core,
|
proxy = pw_core_create_object(core,
|
||||||
"metadata",
|
"metadata",
|
||||||
PW_TYPE_INTERFACE_Metadata,
|
PW_TYPE_INTERFACE_Metadata,
|
||||||
PW_VERSION_METADATA,
|
PW_VERSION_METADATA,
|
||||||
props ? &props->dict : NULL,
|
props,
|
||||||
user_data_size + sizeof(struct object_data));
|
user_data_size + sizeof(struct object_data));
|
||||||
if (props)
|
|
||||||
pw_properties_free(props);
|
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -809,7 +809,7 @@ error:
|
||||||
static struct pw_protocol_client *
|
static struct pw_protocol_client *
|
||||||
impl_new_client(struct pw_protocol *protocol,
|
impl_new_client(struct pw_protocol *protocol,
|
||||||
struct pw_core *core,
|
struct pw_core *core,
|
||||||
const struct pw_properties *properties)
|
const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
struct client *impl;
|
struct client *impl;
|
||||||
struct pw_protocol_client *this;
|
struct pw_protocol_client *this;
|
||||||
|
|
@ -832,10 +832,10 @@ impl_new_client(struct pw_protocol *protocol,
|
||||||
goto error_free;
|
goto error_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties) {
|
if (props) {
|
||||||
str = pw_properties_get(properties, PW_KEY_REMOTE_INTENTION);
|
str = spa_dict_lookup(props, PW_KEY_REMOTE_INTENTION);
|
||||||
if (str == NULL &&
|
if (str == NULL &&
|
||||||
(str = pw_properties_get(properties, PW_KEY_REMOTE_NAME)) != NULL &&
|
(str = spa_dict_lookup(props, PW_KEY_REMOTE_NAME)) != NULL &&
|
||||||
strcmp(str, "internal") == 0)
|
strcmp(str, "internal") == 0)
|
||||||
str = "internal";
|
str = "internal";
|
||||||
}
|
}
|
||||||
|
|
@ -919,12 +919,12 @@ static const struct spa_loop_control_hooks impl_hooks = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_name(const struct pw_properties *properties)
|
get_name(const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
|
|
||||||
if (properties)
|
if (props)
|
||||||
name = pw_properties_get(properties, PW_KEY_CORE_NAME);
|
name = spa_dict_lookup(props, PW_KEY_CORE_NAME);
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
name = getenv("PIPEWIRE_CORE");
|
name = getenv("PIPEWIRE_CORE");
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
|
|
@ -935,7 +935,7 @@ get_name(const struct pw_properties *properties)
|
||||||
static struct server *
|
static struct server *
|
||||||
create_server(struct pw_protocol *protocol,
|
create_server(struct pw_protocol *protocol,
|
||||||
struct pw_impl_core *core,
|
struct pw_impl_core *core,
|
||||||
const struct pw_properties *properties)
|
const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
struct pw_protocol_server *this;
|
struct pw_protocol_server *this;
|
||||||
struct pw_context *context = protocol->context;
|
struct pw_context *context = protocol->context;
|
||||||
|
|
@ -964,19 +964,19 @@ create_server(struct pw_protocol *protocol,
|
||||||
static struct pw_protocol_server *
|
static struct pw_protocol_server *
|
||||||
impl_add_server(struct pw_protocol *protocol,
|
impl_add_server(struct pw_protocol *protocol,
|
||||||
struct pw_impl_core *core,
|
struct pw_impl_core *core,
|
||||||
const struct pw_properties *properties)
|
const struct spa_dict *props)
|
||||||
{
|
{
|
||||||
struct pw_protocol_server *this;
|
struct pw_protocol_server *this;
|
||||||
struct server *s;
|
struct server *s;
|
||||||
const char *name;
|
const char *name;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if ((s = create_server(protocol, core, properties)) == NULL)
|
if ((s = create_server(protocol, core, props)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
this = &s->this;
|
this = &s->this;
|
||||||
|
|
||||||
name = get_name(properties);
|
name = get_name(props);
|
||||||
|
|
||||||
if ((res = init_socket_name(s, name)) < 0)
|
if ((res = init_socket_name(s, name)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
@ -1082,6 +1082,18 @@ static const struct pw_impl_module_events module_events = {
|
||||||
.destroy = module_destroy,
|
.destroy = module_destroy,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int need_server(struct pw_context *context, const struct spa_dict *props)
|
||||||
|
{
|
||||||
|
const char *val;
|
||||||
|
|
||||||
|
val = getenv("PIPEWIRE_DAEMON");
|
||||||
|
if (val == NULL)
|
||||||
|
val = spa_dict_lookup(props, PW_KEY_CORE_DAEMON);
|
||||||
|
if (val && pw_properties_parse_bool(val))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
{
|
{
|
||||||
|
|
@ -1089,7 +1101,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
struct pw_protocol *this;
|
struct pw_protocol *this;
|
||||||
struct protocol_data *d;
|
struct protocol_data *d;
|
||||||
const struct pw_properties *props;
|
const struct pw_properties *props;
|
||||||
const char *val;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native) != NULL)
|
if (pw_context_find_protocol(context, PW_TYPE_INFO_PROTOCOL_Native) != NULL)
|
||||||
|
|
@ -1114,13 +1125,10 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
d->module = module;
|
d->module = module;
|
||||||
|
|
||||||
props = pw_context_get_properties(context);
|
props = pw_context_get_properties(context);
|
||||||
d->local = create_server(this, context->core, props);
|
d->local = create_server(this, context->core, &props->dict);
|
||||||
|
|
||||||
val = getenv("PIPEWIRE_DAEMON");
|
if (need_server(context, &props->dict)) {
|
||||||
if (val == NULL)
|
if (impl_add_server(this, context->core, &props->dict) == NULL) {
|
||||||
val = pw_properties_get(props, PW_KEY_CORE_DAEMON);
|
|
||||||
if (val && pw_properties_parse_bool(val)) {
|
|
||||||
if (impl_add_server(this, context->core, props) == NULL) {
|
|
||||||
res = -errno;
|
res = -errno;
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ struct pw_export_type {
|
||||||
struct spa_list link;
|
struct spa_list link;
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
struct pw_proxy * (*func) (struct pw_core *core,
|
struct pw_proxy * (*func) (struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *properties, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size);
|
size_t user_data_size);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -237,7 +237,7 @@ struct pw_proxy *pw_core_find_proxy(struct pw_core *core, uint32_t id)
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
struct pw_proxy *pw_core_export(struct pw_core *core,
|
struct pw_proxy *pw_core_export(struct pw_core *core,
|
||||||
uint32_t type, struct pw_properties *props, void *object,
|
uint32_t type, const struct spa_dict *props, void *object,
|
||||||
size_t user_data_size)
|
size_t user_data_size)
|
||||||
{
|
{
|
||||||
struct pw_proxy *proxy;
|
struct pw_proxy *proxy;
|
||||||
|
|
@ -259,13 +259,10 @@ struct pw_proxy *pw_core_export(struct pw_core *core,
|
||||||
|
|
||||||
error_export_type:
|
error_export_type:
|
||||||
pw_log_error(NAME" %p: can't export type %d: %s", core, type, spa_strerror(res));
|
pw_log_error(NAME" %p: can't export type %d: %s", core, type, spa_strerror(res));
|
||||||
goto exit_free;
|
goto exit;
|
||||||
error_proxy_failed:
|
error_proxy_failed:
|
||||||
pw_log_error(NAME" %p: failed to create proxy: %s", core, spa_strerror(res));
|
pw_log_error(NAME" %p: failed to create proxy: %s", core, spa_strerror(res));
|
||||||
goto exit;
|
goto exit;
|
||||||
exit_free:
|
|
||||||
if (props)
|
|
||||||
pw_properties_free(props);
|
|
||||||
exit:
|
exit:
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -316,7 +313,7 @@ static struct pw_core *core_new(struct pw_context *context,
|
||||||
goto error_protocol;
|
goto error_protocol;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->conn = pw_protocol_new_client(protocol, p, properties);
|
p->conn = pw_protocol_new_client(protocol, p, &properties->dict);
|
||||||
if (p->conn == NULL)
|
if (p->conn == NULL)
|
||||||
goto error_connection;
|
goto error_connection;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -551,7 +551,7 @@ struct pw_proxy *pw_core_find_proxy(struct pw_core *core, uint32_t id);
|
||||||
/** Export an object into the PipeWire instance associated with core */
|
/** Export an object into the PipeWire instance associated with core */
|
||||||
struct pw_proxy *pw_core_export(struct pw_core *core, /**< the core */
|
struct pw_proxy *pw_core_export(struct pw_core *core, /**< the core */
|
||||||
uint32_t type, /**< the type of object */
|
uint32_t type, /**< the type of object */
|
||||||
struct pw_properties *properties, /**< extra properties */
|
const struct spa_dict *props, /**< extra properties */
|
||||||
void *object, /**< object to export */
|
void *object, /**< object to export */
|
||||||
size_t user_data_size /**< extra user data */);
|
size_t user_data_size /**< extra user data */);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,10 @@ struct pw_protocol_implementaton {
|
||||||
|
|
||||||
struct pw_protocol_client * (*new_client) (struct pw_protocol *protocol,
|
struct pw_protocol_client * (*new_client) (struct pw_protocol *protocol,
|
||||||
struct pw_core *core,
|
struct pw_core *core,
|
||||||
const struct pw_properties *properties);
|
const struct spa_dict *props);
|
||||||
struct pw_protocol_server * (*add_server) (struct pw_protocol *protocol,
|
struct pw_protocol_server * (*add_server) (struct pw_protocol *protocol,
|
||||||
struct pw_impl_core *core,
|
struct pw_impl_core *core,
|
||||||
const struct pw_properties *properties);
|
const struct spa_dict *props);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_protocol_events {
|
struct pw_protocol_events {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue