From 101cc3bb6c12f286ac1c531c7ce2a43f4614c8c4 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 1 Sep 2023 15:59:20 +0200 Subject: [PATCH] MT#57719 Introduce the `media_unconfirm()` function Introduce `media_unconfirm()` to do a selective handling of medias to unkernelize the correlated to it streams. This is analogue of the of the `__monologue_unconfirm()` but for medias. Change-Id: Id8ede0fc56412021c301e97764fd5dd070b7d484 --- daemon/call.c | 12 ++++++++++++ include/call.h | 1 + 2 files changed, 13 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index c25111637..b0220f7ba 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4210,6 +4210,18 @@ void __monologue_unkernelize(struct call_monologue *monologue, const char *reaso } } } +/* must be called with call->master_lock held in W */ +void __media_unconfirm(struct call_media *media, const char *reason) { + if (!media) + return; + + for (GList *m = media->streams.head; m; m = m->next) { + struct packet_stream *stream = m->data; + __stream_unconfirm(stream, reason); + __unconfirm_sinks(&stream->rtp_sinks, reason); + __unconfirm_sinks(&stream->rtcp_sinks, reason); + } +} void dialogue_unkernelize(struct call_monologue *ml, const char *reason) { __monologue_unkernelize(ml, reason); diff --git a/include/call.h b/include/call.h index 60d39fa1b..918bb6360 100644 --- a/include/call.h +++ b/include/call.h @@ -764,6 +764,7 @@ void call_media_state_machine(struct call_media *m); void call_media_unkernelize(struct call_media *media, const char *); void dialogue_unkernelize(struct call_monologue *ml, const char *); void __monologue_unkernelize(struct call_monologue *monologue, const char *); +void __media_unconfirm(struct call_media *media, const char *); void update_init_subscribers(struct call_monologue *ml, enum call_opmode opmode); int call_stream_address46(char *o, struct packet_stream *ps, enum stream_address_format format,