module-session-manager: set object.serial on session objects

Session, endpoint, link, and stream objects should also set
object.serial.
This commit is contained in:
Pauli Virtanen 2022-02-27 20:44:21 +02:00
parent 3b94345bbe
commit ab353a8057
4 changed files with 52 additions and 0 deletions

View file

@ -389,6 +389,15 @@ static void *link_new(struct pw_context *context,
struct pw_properties *properties) struct pw_properties *properties)
{ {
struct impl *impl; 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)); impl = calloc(1, sizeof(*impl));
if (impl == NULL) { if (impl == NULL) {
@ -407,6 +416,10 @@ static void *link_new(struct pw_context *context,
} }
impl->resource = resource; 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); spa_list_init(&impl->cached_params);
/* handle destroy events */ /* handle destroy events */

View file

@ -380,6 +380,15 @@ static void *stream_new(struct pw_context *context,
struct pw_properties *properties) struct pw_properties *properties)
{ {
struct impl *impl; 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)); impl = calloc(1, sizeof(*impl));
if (impl == NULL) { if (impl == NULL) {
@ -398,6 +407,10 @@ static void *stream_new(struct pw_context *context,
} }
impl->resource = resource; 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); spa_list_init(&impl->cached_params);
/* handle destroy events */ /* handle destroy events */

View file

@ -389,6 +389,15 @@ static void *endpoint_new(struct pw_context *context,
struct pw_properties *properties) struct pw_properties *properties)
{ {
struct impl *impl; 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)); impl = calloc(1, sizeof(*impl));
if (impl == NULL) { if (impl == NULL) {
@ -407,6 +416,10 @@ static void *endpoint_new(struct pw_context *context,
} }
impl->resource = resource; 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); spa_list_init(&impl->cached_params);
/* handle destroy events */ /* handle destroy events */

View file

@ -378,6 +378,15 @@ static void *session_new(struct pw_context *context,
struct pw_properties *properties) struct pw_properties *properties)
{ {
struct impl *impl; 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)); impl = calloc(1, sizeof(*impl));
if (impl == NULL) { if (impl == NULL) {
@ -396,6 +405,10 @@ static void *session_new(struct pw_context *context,
} }
impl->resource = resource; 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); spa_list_init(&impl->cached_params);
/* handle destroy events */ /* handle destroy events */