module-rtp: Set receiving state on stream as a property

There isn't a good way to surface this information to the module owner
yet, so let's publish the information on the stream so we can try to
manage things in policy.
This commit is contained in:
Arun Raghavan 2024-06-19 10:22:08 -04:00
parent 41691f8bc9
commit 2c7272a13a

View file

@ -165,6 +165,7 @@ struct impl {
struct spa_source *source;
unsigned receiving:1;
unsigned last_receiving:1;
};
static void
@ -427,6 +428,15 @@ static void on_timer_event(void *data, uint64_t expirations)
{
struct impl *impl = data;
if (impl->receiving != impl->last_receiving) {
struct spa_dict_item item[1];
impl->last_receiving = impl->receiving;
item[0] = SPA_DICT_ITEM_INIT("rtp.receiving", impl->receiving ? "true" : "false");
rtp_stream_update_properties(impl->stream, &SPA_DICT_INIT(item, 1));
}
if (!impl->receiving) {
pw_log_info("timeout, inactive RTP source");
//pw_impl_module_schedule_destroy(impl->module);