mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
global: don't reuse ids
This commit is contained in:
parent
60818886ed
commit
bae0d16e09
18 changed files with 19 additions and 77 deletions
|
|
@ -304,8 +304,6 @@ int endpoint_stream_init(struct endpoint_stream *this,
|
||||||
|
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
||||||
pw_global_get_id(this->global));
|
pw_global_get_id(this->global));
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
|
|
||||||
this->info.version = PW_VERSION_ENDPOINT_STREAM_INFO;
|
this->info.version = PW_VERSION_ENDPOINT_STREAM_INFO;
|
||||||
this->info.id = pw_global_get_id(this->global);
|
this->info.id = pw_global_get_id(this->global);
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,6 @@ int endpoint_init(struct endpoint *this,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_FACTORY_ID,
|
PW_KEY_FACTORY_ID,
|
||||||
PW_KEY_CLIENT_ID,
|
PW_KEY_CLIENT_ID,
|
||||||
PW_KEY_DEVICE_ID,
|
PW_KEY_DEVICE_ID,
|
||||||
|
|
@ -334,8 +333,6 @@ int endpoint_init(struct endpoint *this,
|
||||||
|
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
||||||
pw_global_get_id(this->global));
|
pw_global_get_id(this->global));
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
|
|
||||||
this->info.version = PW_VERSION_ENDPOINT_INFO;
|
this->info.version = PW_VERSION_ENDPOINT_INFO;
|
||||||
this->info.id = pw_global_get_id(this->global);
|
this->info.id = pw_global_get_id(this->global);
|
||||||
|
|
|
||||||
|
|
@ -322,8 +322,6 @@ int endpoint_link_init(struct endpoint_link *this,
|
||||||
|
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
||||||
pw_global_get_id(this->global));
|
pw_global_get_id(this->global));
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
|
|
||||||
this->info.version = PW_VERSION_ENDPOINT_LINK_INFO;
|
this->info.version = PW_VERSION_ENDPOINT_LINK_INFO;
|
||||||
this->info.id = pw_global_get_id(this->global);
|
this->info.id = pw_global_get_id(this->global);
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,6 @@ int session_init(struct session *this,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_FACTORY_ID,
|
PW_KEY_FACTORY_ID,
|
||||||
PW_KEY_CLIENT_ID,
|
PW_KEY_CLIENT_ID,
|
||||||
NULL
|
NULL
|
||||||
|
|
@ -296,8 +295,6 @@ int session_init(struct session *this,
|
||||||
|
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
pw_properties_setf(this->props, PW_KEY_OBJECT_ID, "%u",
|
||||||
pw_global_get_id(this->global));
|
pw_global_get_id(this->global));
|
||||||
pw_properties_setf(this->props, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
|
|
||||||
this->info.version = PW_VERSION_SESSION_INFO;
|
this->info.version = PW_VERSION_SESSION_INFO;
|
||||||
this->info.id = pw_global_get_id(this->global);
|
this->info.id = pw_global_get_id(this->global);
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,6 @@ struct pw_context *pw_context_new(struct pw_loop *main_loop,
|
||||||
|
|
||||||
pw_array_init(&this->factory_lib, 32);
|
pw_array_init(&this->factory_lib, 32);
|
||||||
pw_array_init(&this->objects, 32);
|
pw_array_init(&this->objects, 32);
|
||||||
pw_map_init(&this->globals, 128, 32);
|
|
||||||
|
|
||||||
spa_list_init(&this->core_impl_list);
|
spa_list_init(&this->core_impl_list);
|
||||||
spa_list_init(&this->protocol_list);
|
spa_list_init(&this->protocol_list);
|
||||||
|
|
@ -482,8 +481,6 @@ void pw_context_destroy(struct pw_context *context)
|
||||||
|
|
||||||
pw_array_clear(&context->objects);
|
pw_array_clear(&context->objects);
|
||||||
|
|
||||||
pw_map_clear(&context->globals);
|
|
||||||
|
|
||||||
spa_hook_list_clean(&context->listener_list);
|
spa_hook_list_clean(&context->listener_list);
|
||||||
spa_hook_list_clean(&context->driver_listener_list);
|
spa_hook_list_clean(&context->driver_listener_list);
|
||||||
|
|
||||||
|
|
@ -581,12 +578,23 @@ int pw_context_for_each_global(struct pw_context *context,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct pw_global *find_global(struct pw_context *context, uint32_t id)
|
||||||
|
{
|
||||||
|
struct pw_global *g;
|
||||||
|
spa_list_for_each(g, &context->global_list, link) {
|
||||||
|
if (g->id == id)
|
||||||
|
return g;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
struct pw_global *pw_context_find_global(struct pw_context *context, uint32_t id)
|
struct pw_global *pw_context_find_global(struct pw_context *context, uint32_t id)
|
||||||
{
|
{
|
||||||
struct pw_global *global;
|
struct pw_global *global;
|
||||||
|
|
||||||
global = pw_map_lookup(&context->globals, id);
|
|
||||||
|
global = find_global(context, id);
|
||||||
if (global == NULL || !global->registered) {
|
if (global == NULL || !global->registered) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -96,13 +96,9 @@ pw_global_new(struct pw_context *context,
|
||||||
this->func = func;
|
this->func = func;
|
||||||
this->object = object;
|
this->object = object;
|
||||||
this->properties = properties;
|
this->properties = properties;
|
||||||
this->id = pw_map_insert_new(&context->globals, this);
|
this->id = serial++;
|
||||||
if (this->id == SPA_ID_INVALID) {
|
if ((uint32_t)this->id == SPA_ID_INVALID)
|
||||||
res = -errno;
|
this->id = serial++;
|
||||||
pw_log_error("%p: can't allocate new id: %m", this);
|
|
||||||
goto error_free;
|
|
||||||
}
|
|
||||||
this->serial = SPA_ID_INVALID;
|
|
||||||
|
|
||||||
spa_list_init(&this->resource_list);
|
spa_list_init(&this->resource_list);
|
||||||
spa_hook_list_init(&this->listener_list);
|
spa_hook_list_init(&this->listener_list);
|
||||||
|
|
@ -111,24 +107,12 @@ pw_global_new(struct pw_context *context,
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
error_free:
|
|
||||||
free(impl);
|
|
||||||
error_cleanup:
|
error_cleanup:
|
||||||
pw_properties_free(properties);
|
pw_properties_free(properties);
|
||||||
errno = -res;
|
errno = -res;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SPA_EXPORT
|
|
||||||
uint64_t pw_global_get_serial(struct pw_global *global)
|
|
||||||
{
|
|
||||||
if (global->serial == SPA_ID_INVALID)
|
|
||||||
global->serial = serial++;
|
|
||||||
if ((uint32_t)serial == SPA_ID_INVALID)
|
|
||||||
serial++;
|
|
||||||
return global->serial;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** register a global to the context registry
|
/** register a global to the context registry
|
||||||
*
|
*
|
||||||
* \param global a global to add
|
* \param global a global to add
|
||||||
|
|
@ -149,8 +133,8 @@ int pw_global_register(struct pw_global *global)
|
||||||
|
|
||||||
spa_list_for_each(registry, &context->registry_resource_list, link) {
|
spa_list_for_each(registry, &context->registry_resource_list, link) {
|
||||||
uint32_t permissions = pw_global_get_permissions(global, registry->client);
|
uint32_t permissions = pw_global_get_permissions(global, registry->client);
|
||||||
pw_log_debug("registry %p: global %d %08x serial:%"PRIu64,
|
pw_log_debug("registry %p: global %d %08x",
|
||||||
registry, global->id, permissions, global->serial);
|
registry, global->id, permissions);
|
||||||
if (PW_PERM_IS_R(permissions))
|
if (PW_PERM_IS_R(permissions))
|
||||||
pw_registry_resource_global(registry,
|
pw_registry_resource_global(registry,
|
||||||
global->id,
|
global->id,
|
||||||
|
|
@ -183,7 +167,6 @@ static int global_unregister(struct pw_global *global)
|
||||||
|
|
||||||
spa_list_remove(&global->link);
|
spa_list_remove(&global->link);
|
||||||
global->registered = false;
|
global->registered = false;
|
||||||
global->serial = SPA_ID_INVALID;
|
|
||||||
|
|
||||||
pw_log_debug("%p: unregistered %u", global, global->id);
|
pw_log_debug("%p: unregistered %u", global, global->id);
|
||||||
pw_context_emit_global_removed(context, global);
|
pw_context_emit_global_removed(context, global);
|
||||||
|
|
@ -352,9 +335,8 @@ int pw_global_update_permissions(struct pw_global *global, struct pw_impl_client
|
||||||
pw_registry_resource_global_remove(resource, global->id);
|
pw_registry_resource_global_remove(resource, global->id);
|
||||||
}
|
}
|
||||||
else if (do_show) {
|
else if (do_show) {
|
||||||
pw_log_debug("client %p: resource %p show global %d serial:%"PRIu64,
|
pw_log_debug("client %p: resource %p show global %d",
|
||||||
client, resource, global->id,
|
client, resource, global->id);
|
||||||
global->serial);
|
|
||||||
pw_registry_resource_global(resource,
|
pw_registry_resource_global(resource,
|
||||||
global->id,
|
global->id,
|
||||||
new_permissions,
|
new_permissions,
|
||||||
|
|
@ -386,7 +368,6 @@ SPA_EXPORT
|
||||||
void pw_global_destroy(struct pw_global *global)
|
void pw_global_destroy(struct pw_global *global)
|
||||||
{
|
{
|
||||||
struct pw_resource *resource;
|
struct pw_resource *resource;
|
||||||
struct pw_context *context = global->context;
|
|
||||||
|
|
||||||
global->destroyed = true;
|
global->destroyed = true;
|
||||||
|
|
||||||
|
|
@ -401,7 +382,6 @@ void pw_global_destroy(struct pw_global *global)
|
||||||
pw_log_debug("%p: free", global);
|
pw_log_debug("%p: free", global);
|
||||||
pw_global_emit_free(global);
|
pw_global_emit_free(global);
|
||||||
|
|
||||||
pw_map_remove(&context->globals, global->id);
|
|
||||||
spa_hook_list_clean(&global->listener_list);
|
spa_hook_list_clean(&global->listener_list);
|
||||||
|
|
||||||
pw_properties_free(global->properties);
|
pw_properties_free(global->properties);
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,6 @@ void *pw_global_get_object(struct pw_global *global);
|
||||||
/** Get the unique id of the global */
|
/** Get the unique id of the global */
|
||||||
uint32_t pw_global_get_id(struct pw_global *global);
|
uint32_t pw_global_get_id(struct pw_global *global);
|
||||||
|
|
||||||
/** Get the serial number of the global */
|
|
||||||
uint64_t pw_global_get_serial(struct pw_global *global);
|
|
||||||
|
|
||||||
/** Add a resource to a global */
|
/** Add a resource to a global */
|
||||||
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource);
|
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,6 @@ int pw_impl_client_register(struct pw_impl_client *client,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_MODULE_ID,
|
PW_KEY_MODULE_ID,
|
||||||
PW_KEY_PROTOCOL,
|
PW_KEY_PROTOCOL,
|
||||||
PW_KEY_SEC_PID,
|
PW_KEY_SEC_PID,
|
||||||
|
|
@ -506,8 +505,6 @@ int pw_impl_client_register(struct pw_impl_client *client,
|
||||||
|
|
||||||
client->info.id = client->global->id;
|
client->info.id = client->global->id;
|
||||||
pw_properties_setf(client->properties, PW_KEY_OBJECT_ID, "%d", client->info.id);
|
pw_properties_setf(client->properties, PW_KEY_OBJECT_ID, "%d", client->info.id);
|
||||||
pw_properties_setf(client->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(client->global));
|
|
||||||
client->info.props = &client->properties->dict;
|
client->info.props = &client->properties->dict;
|
||||||
pw_global_add_listener(client->global, &client->global_listener, &global_events, client);
|
pw_global_add_listener(client->global, &client->global_listener, &global_events, client);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -583,7 +583,6 @@ int pw_impl_core_register(struct pw_impl_core *core,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_USER_NAME,
|
PW_KEY_USER_NAME,
|
||||||
PW_KEY_HOST_NAME,
|
PW_KEY_HOST_NAME,
|
||||||
PW_KEY_CORE_NAME,
|
PW_KEY_CORE_NAME,
|
||||||
|
|
@ -611,8 +610,6 @@ int pw_impl_core_register(struct pw_impl_core *core,
|
||||||
|
|
||||||
core->info.id = core->global->id;
|
core->info.id = core->global->id;
|
||||||
pw_properties_setf(core->properties, PW_KEY_OBJECT_ID, "%d", core->info.id);
|
pw_properties_setf(core->properties, PW_KEY_OBJECT_ID, "%d", core->info.id);
|
||||||
pw_properties_setf(core->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(core->global));
|
|
||||||
core->info.props = &core->properties->dict;
|
core->info.props = &core->properties->dict;
|
||||||
|
|
||||||
pw_global_update_keys(core->global, core->info.props, keys);
|
pw_global_update_keys(core->global, core->info.props, keys);
|
||||||
|
|
|
||||||
|
|
@ -556,7 +556,6 @@ int pw_impl_device_register(struct pw_impl_device *device,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_OBJECT_PATH,
|
PW_KEY_OBJECT_PATH,
|
||||||
PW_KEY_MODULE_ID,
|
PW_KEY_MODULE_ID,
|
||||||
PW_KEY_FACTORY_ID,
|
PW_KEY_FACTORY_ID,
|
||||||
|
|
@ -589,8 +588,6 @@ int pw_impl_device_register(struct pw_impl_device *device,
|
||||||
|
|
||||||
device->info.id = device->global->id;
|
device->info.id = device->global->id;
|
||||||
pw_properties_setf(device->properties, PW_KEY_OBJECT_ID, "%d", device->info.id);
|
pw_properties_setf(device->properties, PW_KEY_OBJECT_ID, "%d", device->info.id);
|
||||||
pw_properties_setf(device->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(device->global));
|
|
||||||
device->info.props = &device->properties->dict;
|
device->info.props = &device->properties->dict;
|
||||||
|
|
||||||
pw_global_update_keys(device->global, device->info.props, keys);
|
pw_global_update_keys(device->global, device->info.props, keys);
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,6 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_MODULE_ID,
|
PW_KEY_MODULE_ID,
|
||||||
PW_KEY_FACTORY_NAME,
|
PW_KEY_FACTORY_NAME,
|
||||||
PW_KEY_FACTORY_TYPE_NAME,
|
PW_KEY_FACTORY_TYPE_NAME,
|
||||||
|
|
@ -205,8 +204,6 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
|
||||||
|
|
||||||
factory->info.id = factory->global->id;
|
factory->info.id = factory->global->id;
|
||||||
pw_properties_setf(factory->properties, PW_KEY_OBJECT_ID, "%d", factory->info.id);
|
pw_properties_setf(factory->properties, PW_KEY_OBJECT_ID, "%d", factory->info.id);
|
||||||
pw_properties_setf(factory->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(factory->global));
|
|
||||||
pw_properties_set(factory->properties, PW_KEY_FACTORY_NAME, factory->info.name);
|
pw_properties_set(factory->properties, PW_KEY_FACTORY_NAME, factory->info.name);
|
||||||
pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_NAME, "%s", factory->info.type);
|
pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_NAME, "%s", factory->info.type);
|
||||||
pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_VERSION, "%d", factory->info.version);
|
pw_properties_setf(factory->properties, PW_KEY_FACTORY_TYPE_VERSION, "%d", factory->info.version);
|
||||||
|
|
|
||||||
|
|
@ -1346,7 +1346,6 @@ int pw_impl_link_register(struct pw_impl_link *link,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_OBJECT_PATH,
|
PW_KEY_OBJECT_PATH,
|
||||||
PW_KEY_MODULE_ID,
|
PW_KEY_MODULE_ID,
|
||||||
PW_KEY_FACTORY_ID,
|
PW_KEY_FACTORY_ID,
|
||||||
|
|
@ -1386,8 +1385,6 @@ int pw_impl_link_register(struct pw_impl_link *link,
|
||||||
|
|
||||||
link->info.id = link->global->id;
|
link->info.id = link->global->id;
|
||||||
pw_properties_setf(link->properties, PW_KEY_OBJECT_ID, "%d", link->info.id);
|
pw_properties_setf(link->properties, PW_KEY_OBJECT_ID, "%d", link->info.id);
|
||||||
pw_properties_setf(link->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(link->global));
|
|
||||||
pw_properties_setf(link->properties, PW_KEY_LINK_OUTPUT_NODE, "%u", link->info.output_node_id);
|
pw_properties_setf(link->properties, PW_KEY_LINK_OUTPUT_NODE, "%u", link->info.output_node_id);
|
||||||
pw_properties_setf(link->properties, PW_KEY_LINK_OUTPUT_PORT, "%u", link->info.output_port_id);
|
pw_properties_setf(link->properties, PW_KEY_LINK_OUTPUT_PORT, "%u", link->info.output_port_id);
|
||||||
pw_properties_setf(link->properties, PW_KEY_LINK_INPUT_NODE, "%u", link->info.input_node_id);
|
pw_properties_setf(link->properties, PW_KEY_LINK_INPUT_NODE, "%u", link->info.input_node_id);
|
||||||
|
|
|
||||||
|
|
@ -546,9 +546,6 @@ int pw_impl_metadata_register(struct pw_impl_metadata *metadata,
|
||||||
spa_list_append(&context->metadata_list, &metadata->link);
|
spa_list_append(&context->metadata_list, &metadata->link);
|
||||||
metadata->registered = true;
|
metadata->registered = true;
|
||||||
|
|
||||||
pw_properties_setf(metadata->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(metadata->global));
|
|
||||||
|
|
||||||
pw_global_update_keys(metadata->global, &metadata->properties->dict, keys);
|
pw_global_update_keys(metadata->global, &metadata->properties->dict, keys);
|
||||||
|
|
||||||
pw_global_add_listener(metadata->global, &metadata->global_listener, &global_events, metadata);
|
pw_global_add_listener(metadata->global, &metadata->global_listener, &global_events, metadata);
|
||||||
|
|
|
||||||
|
|
@ -247,8 +247,6 @@ pw_context_load_module(struct pw_context *context,
|
||||||
|
|
||||||
this->info.id = this->global->id;
|
this->info.id = this->global->id;
|
||||||
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
|
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
|
||||||
pw_properties_setf(this->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
this->info.props = &this->properties->dict;
|
this->info.props = &this->properties->dict;
|
||||||
|
|
||||||
pw_impl_module_emit_initialized(this);
|
pw_impl_module_emit_initialized(this);
|
||||||
|
|
|
||||||
|
|
@ -678,7 +678,6 @@ int pw_impl_node_register(struct pw_impl_node *this,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_OBJECT_PATH,
|
PW_KEY_OBJECT_PATH,
|
||||||
PW_KEY_MODULE_ID,
|
PW_KEY_MODULE_ID,
|
||||||
PW_KEY_FACTORY_ID,
|
PW_KEY_FACTORY_ID,
|
||||||
|
|
@ -724,8 +723,6 @@ int pw_impl_node_register(struct pw_impl_node *this,
|
||||||
|
|
||||||
this->info.id = this->global->id;
|
this->info.id = this->global->id;
|
||||||
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
|
pw_properties_setf(this->properties, PW_KEY_OBJECT_ID, "%d", this->info.id);
|
||||||
pw_properties_setf(this->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(this->global));
|
|
||||||
this->info.props = &this->properties->dict;
|
this->info.props = &this->properties->dict;
|
||||||
|
|
||||||
pw_global_update_keys(this->global, &this->properties->dict, keys);
|
pw_global_update_keys(this->global, &this->properties->dict, keys);
|
||||||
|
|
|
||||||
|
|
@ -889,7 +889,6 @@ int pw_impl_port_register(struct pw_impl_port *port,
|
||||||
struct pw_properties *properties)
|
struct pw_properties *properties)
|
||||||
{
|
{
|
||||||
static const char * const keys[] = {
|
static const char * const keys[] = {
|
||||||
PW_KEY_OBJECT_SERIAL,
|
|
||||||
PW_KEY_OBJECT_PATH,
|
PW_KEY_OBJECT_PATH,
|
||||||
PW_KEY_FORMAT_DSP,
|
PW_KEY_FORMAT_DSP,
|
||||||
PW_KEY_NODE_ID,
|
PW_KEY_NODE_ID,
|
||||||
|
|
@ -925,8 +924,6 @@ int pw_impl_port_register(struct pw_impl_port *port,
|
||||||
port->info.id = port->global->id;
|
port->info.id = port->global->id;
|
||||||
pw_properties_setf(port->properties, PW_KEY_NODE_ID, "%d", node->global->id);
|
pw_properties_setf(port->properties, PW_KEY_NODE_ID, "%d", node->global->id);
|
||||||
pw_properties_setf(port->properties, PW_KEY_OBJECT_ID, "%d", port->info.id);
|
pw_properties_setf(port->properties, PW_KEY_OBJECT_ID, "%d", port->info.id);
|
||||||
pw_properties_setf(port->properties, PW_KEY_OBJECT_SERIAL, "%"PRIu64,
|
|
||||||
pw_global_get_serial(port->global));
|
|
||||||
port->info.props = &port->properties->dict;
|
port->info.props = &port->properties->dict;
|
||||||
|
|
||||||
pw_global_update_keys(port->global, &port->properties->dict, keys);
|
pw_global_update_keys(port->global, &port->properties->dict, keys);
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,6 @@ extern "C" {
|
||||||
/** object properties */
|
/** object properties */
|
||||||
#define PW_KEY_OBJECT_PATH "object.path" /**< unique path to construct the object */
|
#define PW_KEY_OBJECT_PATH "object.path" /**< unique path to construct the object */
|
||||||
#define PW_KEY_OBJECT_ID "object.id" /**< a global object id */
|
#define PW_KEY_OBJECT_ID "object.id" /**< a global object id */
|
||||||
#define PW_KEY_OBJECT_SERIAL "object.serial" /**< a 64 bit object serial number. This is a number
|
|
||||||
* incremented for each object that is created.
|
|
||||||
* The lower 32 bits are guaranteed to never be
|
|
||||||
* SPA_ID_INVALID. */
|
|
||||||
#define PW_KEY_OBJECT_LINGER "object.linger" /**< the object lives on even after the client
|
#define PW_KEY_OBJECT_LINGER "object.linger" /**< the object lives on even after the client
|
||||||
* that created it has been destroyed */
|
* that created it has been destroyed */
|
||||||
#define PW_KEY_OBJECT_REGISTER "object.register" /**< If the object should be registered. */
|
#define PW_KEY_OBJECT_REGISTER "object.register" /**< If the object should be registered. */
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,6 @@ struct pw_global {
|
||||||
|
|
||||||
pw_global_bind_func_t func; /**< bind function */
|
pw_global_bind_func_t func; /**< bind function */
|
||||||
void *object; /**< object associated with the interface */
|
void *object; /**< object associated with the interface */
|
||||||
uint64_t serial; /**< increasing serial number */
|
|
||||||
|
|
||||||
struct spa_list resource_list; /**< The list of resources of this global */
|
struct spa_list resource_list; /**< The list of resources of this global */
|
||||||
|
|
||||||
|
|
@ -422,8 +421,6 @@ struct pw_context {
|
||||||
|
|
||||||
struct pw_mempool *pool; /**< global memory pool */
|
struct pw_mempool *pool; /**< global memory pool */
|
||||||
|
|
||||||
struct pw_map globals; /**< map of globals */
|
|
||||||
|
|
||||||
struct spa_list core_impl_list; /**< list of core_imp */
|
struct spa_list core_impl_list; /**< list of core_imp */
|
||||||
struct spa_list protocol_list; /**< list of protocols */
|
struct spa_list protocol_list; /**< list of protocols */
|
||||||
struct spa_list core_list; /**< list of core connections */
|
struct spa_list core_list; /**< list of core connections */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue