mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-07 13:30:09 -05:00
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:
parent
41691f8bc9
commit
2c7272a13a
1 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue