mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05: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
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue