MT#61630 call: add new func `call_ml_sendonly()`

Add a function to check if any audio medias
are putting the call on sendonly state.

Change-Id: I9667c8e2b65378596183e05ba22e551ae17e158b
pull/1897/head
Donat Zenichev 5 months ago
parent 6b2a034395
commit 9c7bb1076c

@ -3449,6 +3449,23 @@ struct media_subscription *call_ml_get_top_ms(struct call_monologue *ml) {
return NULL;
}
/**
* Checks if any present audio medias put this monologue into sendonly state.
* Should only be used when medias are already initialized with flags.
*/
bool call_ml_sendonly(struct call_monologue *ml) {
for (int i = 0; i < ml->medias->len; i++)
{
struct call_media * media = ml->medias->pdata[i];
if (!media || media->type_id != MT_AUDIO)
continue;
/* sendonly media means it can receive packets, but doesn't send */
if (!MEDIA_ISSET(media, SEND) && MEDIA_ISSET(media, RECV))
return true;
}
return false;
}
/* called with call->master_lock held in W */
__attribute__((nonnull(1, 2, 3)))
int monologue_publish(struct call_monologue *ml, sdp_streams_q *streams, sdp_ng_flags *flags) {

@ -810,6 +810,7 @@ struct packet_stream *__packet_stream_new(call_t *call);
void __add_media_subscription(struct call_media * which, struct call_media * to,
const struct sink_attrs *attrs);
struct media_subscription *call_ml_get_top_ms(struct call_monologue *ml);
bool call_ml_sendonly(struct call_monologue *ml);
struct media_subscription *call_media_get_top_ms(struct call_media * cm);
struct media_subscription *call_get_media_subscription(subscription_ht ht, struct call_media * cm);
struct call_monologue * ml_medias_subscribed_to_single_ml(struct call_monologue *ml);

Loading…
Cancel
Save