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

@ -380,6 +380,15 @@ 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) {
@ -398,6 +407,10 @@ 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 */