Ensure all globals have PW_KEY_OBJECT_SERIAL prop

This avoids the caller having to set this property.
This commit is contained in:
Demi Marie Obenour 2024-01-16 13:25:39 -05:00 committed by Wim Taymans
parent ac28abbadf
commit 30419c37df
17 changed files with 9 additions and 69 deletions

View file

@ -441,10 +441,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
struct pw_context *context = pw_impl_module_get_context(module);
struct pw_properties *props;
struct impl *impl;
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
NULL
};
PW_LOG_TOPIC_INIT(mod_topic);
@ -483,8 +479,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
impl->flush_event = pw_loop_add_event(impl->main_loop, do_flush_event, impl);
pw_global_update_keys(impl->global, &impl->properties->dict, keys);
pw_impl_module_add_listener(module, &impl->module_listener, &module_events, impl);
pw_impl_module_update_properties(module, &SPA_DICT_INIT_ARRAY(module_props));

View file

@ -299,7 +299,6 @@ int endpoint_init(struct endpoint *this,
struct pw_properties *properties)
{
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
PW_KEY_FACTORY_ID,
PW_KEY_CLIENT_ID,
PW_KEY_DEVICE_ID,

View file

@ -269,7 +269,6 @@ int session_init(struct session *this,
struct pw_properties *properties)
{
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
PW_KEY_FACTORY_ID,
PW_KEY_CLIENT_ID,
NULL

View file

@ -371,15 +371,6 @@ static void *link_new(struct pw_context *context,
struct pw_properties *properties)
{
struct impl *impl;
char serial_str[32];
struct spa_dict_item items[1] = {
SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_SERIAL, serial_str),
};
struct spa_dict extra_props = SPA_DICT_INIT_ARRAY(items);
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
NULL
};
impl = calloc(1, sizeof(*impl));
if (impl == NULL) {
@ -399,10 +390,6 @@ static void *link_new(struct pw_context *context,
}
impl->resource = resource;
spa_scnprintf(serial_str, sizeof(serial_str), "%"PRIu64,
pw_global_get_serial(impl->global));
pw_global_update_keys(impl->global, &extra_props, keys);
spa_list_init(&impl->cached_params);
/* handle destroy events */

View file

@ -362,15 +362,6 @@ static void *stream_new(struct pw_context *context,
struct pw_properties *properties)
{
struct impl *impl;
char serial_str[32];
struct spa_dict_item items[1] = {
SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_SERIAL, serial_str),
};
struct spa_dict extra_props = SPA_DICT_INIT_ARRAY(items);
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
NULL
};
impl = calloc(1, sizeof(*impl));
if (impl == NULL) {
@ -390,10 +381,6 @@ static void *stream_new(struct pw_context *context,
}
impl->resource = resource;
spa_scnprintf(serial_str, sizeof(serial_str), "%"PRIu64,
pw_global_get_serial(impl->global));
pw_global_update_keys(impl->global, &extra_props, keys);
spa_list_init(&impl->cached_params);
/* handle destroy events */

View file

@ -371,15 +371,6 @@ static void *endpoint_new(struct pw_context *context,
struct pw_properties *properties)
{
struct impl *impl;
char serial_str[32];
struct spa_dict_item items[1] = {
SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_SERIAL, serial_str),
};
struct spa_dict extra_props = SPA_DICT_INIT_ARRAY(items);
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
NULL
};
impl = calloc(1, sizeof(*impl));
if (impl == NULL) {
@ -399,10 +390,6 @@ static void *endpoint_new(struct pw_context *context,
}
impl->resource = resource;
spa_scnprintf(serial_str, sizeof(serial_str), "%"PRIu64,
pw_global_get_serial(impl->global));
pw_global_update_keys(impl->global, &extra_props, keys);
spa_list_init(&impl->cached_params);
/* handle destroy events */

View file

@ -360,15 +360,6 @@ static void *session_new(struct pw_context *context,
struct pw_properties *properties)
{
struct impl *impl;
char serial_str[32];
struct spa_dict_item items[1] = {
SPA_DICT_ITEM_INIT(PW_KEY_OBJECT_SERIAL, serial_str),
};
struct spa_dict extra_props = SPA_DICT_INIT_ARRAY(items);
static const char * const keys[] = {
PW_KEY_OBJECT_SERIAL,
NULL
};
impl = calloc(1, sizeof(*impl));
if (impl == NULL) {
@ -388,10 +379,6 @@ static void *session_new(struct pw_context *context,
}
impl->resource = resource;
spa_scnprintf(serial_str, sizeof(serial_str), "%"PRIu64,
pw_global_get_serial(impl->global));
pw_global_update_keys(impl->global, &extra_props, keys);
spa_list_init(&impl->cached_params);
/* handle destroy events */