diff --git a/src/pipewire/global.c b/src/pipewire/global.c index f85205e65..aca3cfaaa 100644 --- a/src/pipewire/global.c +++ b/src/pipewire/global.c @@ -36,6 +36,8 @@ PW_LOG_TOPIC_EXTERN(log_global); #define PW_LOG_TOPIC_DEFAULT log_global +static uint64_t serial = 0; + /** \cond */ struct impl { struct pw_global this; @@ -133,10 +135,12 @@ int pw_global_register(struct pw_global *global) spa_list_append(&context->global_list, &global->link); global->registered = true; + global->serial = ++serial; spa_list_for_each(registry, &context->registry_resource_list, link) { uint32_t permissions = pw_global_get_permissions(global, registry->client); - pw_log_debug("registry %p: global %d %08x", registry, global->id, permissions); + pw_log_debug("registry %p: global %d %08x serial:%"PRIu64, + registry, global->id, permissions, global->serial); if (PW_PERM_IS_R(permissions)) pw_registry_resource_global(registry, global->id, @@ -337,8 +341,9 @@ int pw_global_update_permissions(struct pw_global *global, struct pw_impl_client pw_registry_resource_global_remove(resource, global->id); } else if (do_show) { - pw_log_debug("client %p: resource %p show global %d", - client, resource, global->id); + pw_log_debug("client %p: resource %p show global %d serial:%"PRIu64, + client, resource, global->id, + global->serial); pw_registry_resource_global(resource, global->id, new_permissions, diff --git a/src/pipewire/private.h b/src/pipewire/private.h index a9033eba6..388ca6bc8 100644 --- a/src/pipewire/private.h +++ b/src/pipewire/private.h @@ -330,6 +330,7 @@ struct pw_global { pw_global_bind_func_t func; /**< bind function */ 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 */