module-rtp: allow dynamically enable or disable announcements

This commit is contained in:
Martin Geier 2026-01-26 15:54:32 +01:00 committed by Carlos Rafael Giani
parent f935eb255c
commit 7f7fc2f77a
2 changed files with 10 additions and 0 deletions

View file

@ -1376,6 +1376,9 @@ static int rule_matched(void *data, const char *location, const char *action,
session_new_announce(i->impl, i->node, props);
}
else if (i->node && i->node->session && spa_streq(action, "deannounce-stream")) {
session_free(i->node->session);
}
return res;
}

View file

@ -404,6 +404,13 @@ static void stream_props_changed(struct impl *impl, uint32_t id, const struct sp
}
pw_properties_setf(impl->stream_props, key, "%d", value_int);
items[n_items++] = SPA_DICT_ITEM_INIT(key, pw_properties_get(impl->stream_props, key));
} else if (spa_streq(key, "sess.sap.announce")) {
if (!value_str) {
pw_log_error("invalid sess.sap.announce");
break;
}
pw_properties_setf(impl->stream_props, key, "%s", value_str);
items[n_items++] = SPA_DICT_ITEM_INIT(key, pw_properties_get(impl->stream_props, key));
}
}