mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-15 21:44:17 -04:00
Ensure all globals have PW_KEY_OBJECT_SERIAL prop
This avoids the caller having to set this property.
This commit is contained in:
parent
ac28abbadf
commit
30419c37df
17 changed files with 9 additions and 69 deletions
|
|
@ -54,6 +54,7 @@ pw_global_new(struct pw_context *context,
|
|||
{
|
||||
struct impl *impl;
|
||||
struct pw_global *this;
|
||||
uint64_t serial;
|
||||
int res;
|
||||
|
||||
if (properties == NULL)
|
||||
|
|
@ -87,6 +88,14 @@ pw_global_new(struct pw_context *context,
|
|||
spa_list_init(&this->resource_list);
|
||||
spa_hook_list_init(&this->listener_list);
|
||||
|
||||
serial = pw_global_get_serial(this);
|
||||
res = pw_properties_setf(properties, PW_KEY_OBJECT_SERIAL, "%" PRIu64, serial);
|
||||
if (res < 0) {
|
||||
pw_global_destroy(this);
|
||||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pw_log_debug("%p: new %s %d", this, this->type, this->id);
|
||||
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -519,7 +519,6 @@ int pw_impl_client_register(struct pw_impl_client *client,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_PROTOCOL,
|
||||
PW_KEY_SEC_PID,
|
||||
|
|
|
|||
|
|
@ -573,7 +573,6 @@ int pw_impl_core_register(struct pw_impl_core *core,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_USER_NAME,
|
||||
PW_KEY_HOST_NAME,
|
||||
PW_KEY_CORE_NAME,
|
||||
|
|
|
|||
|
|
@ -538,7 +538,6 @@ int pw_impl_device_register(struct pw_impl_device *device,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_OBJECT_PATH,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_FACTORY_ID,
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ int pw_impl_factory_register(struct pw_impl_factory *factory,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_FACTORY_NAME,
|
||||
PW_KEY_FACTORY_TYPE_NAME,
|
||||
|
|
|
|||
|
|
@ -1496,7 +1496,6 @@ int pw_impl_link_register(struct pw_impl_link *link,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_OBJECT_PATH,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_FACTORY_ID,
|
||||
|
|
|
|||
|
|
@ -506,7 +506,6 @@ int pw_impl_metadata_register(struct pw_impl_metadata *metadata,
|
|||
{
|
||||
struct pw_context *context = metadata->context;
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_FACTORY_ID,
|
||||
PW_KEY_METADATA_NAME,
|
||||
|
|
|
|||
|
|
@ -149,7 +149,6 @@ pw_context_load_module(struct pw_context *context,
|
|||
size_t len;
|
||||
char path_part[PATH_MAX];
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_MODULE_NAME,
|
||||
NULL
|
||||
};
|
||||
|
|
|
|||
|
|
@ -739,7 +739,6 @@ int pw_impl_node_register(struct pw_impl_node *this,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_OBJECT_PATH,
|
||||
PW_KEY_MODULE_ID,
|
||||
PW_KEY_FACTORY_ID,
|
||||
|
|
|
|||
|
|
@ -1014,7 +1014,6 @@ int pw_impl_port_register(struct pw_impl_port *port,
|
|||
struct pw_properties *properties)
|
||||
{
|
||||
static const char * const keys[] = {
|
||||
PW_KEY_OBJECT_SERIAL,
|
||||
PW_KEY_OBJECT_PATH,
|
||||
PW_KEY_FORMAT_DSP,
|
||||
PW_KEY_NODE_ID,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue