1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-28 23:05:32 +00:00

sip: media-pipeline: Take srtp into account when determing pipeline state

If we're using srtp we should also consider the state of srtpenc and srtpdec
elements when determining the state of the whole pipeline.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-04-07 15:29:39 +02:00
parent bfda8f6a3e
commit 47d4164a09

View file

@ -206,22 +206,25 @@ set_state (CallsSipMediaPipeline *self,
static void static void
check_element_maps (CallsSipMediaPipeline *self) check_element_maps (CallsSipMediaPipeline *self)
{ {
uint all_rtp_elements;
g_assert (CALLS_IS_SIP_MEDIA_PIPELINE (self)); g_assert (CALLS_IS_SIP_MEDIA_PIPELINE (self));
/* TODO take encryption into account */ all_rtp_elements = self->use_srtp ? EL_ALL_SRTP : EL_ALL_RTP;
if (self->element_map_playing == EL_ALL_RTP) {
if (self->element_map_playing == all_rtp_elements) {
g_debug ("All pipeline elements are playing"); g_debug ("All pipeline elements are playing");
set_state (self, CALLS_MEDIA_PIPELINE_STATE_PLAYING); set_state (self, CALLS_MEDIA_PIPELINE_STATE_PLAYING);
return; return;
} }
if (self->element_map_paused == EL_ALL_RTP) { if (self->element_map_paused == all_rtp_elements) {
g_debug ("All pipeline elements are paused"); g_debug ("All pipeline elements are paused");
set_state (self, CALLS_MEDIA_PIPELINE_STATE_PAUSED); set_state (self, CALLS_MEDIA_PIPELINE_STATE_PAUSED);
return; return;
} }
if (self->element_map_stopped == EL_ALL_RTP) { if (self->element_map_stopped == all_rtp_elements) {
g_debug ("All pipeline elements are stopped"); g_debug ("All pipeline elements are stopped");
set_state (self, CALLS_MEDIA_PIPELINE_STATE_STOPPED); set_state (self, CALLS_MEDIA_PIPELINE_STATE_STOPPED);
return; return;
@ -319,13 +322,10 @@ on_bus_message (GstBus *bus,
else if (message->src == GST_OBJECT (self->rtcp_sink)) else if (message->src == GST_OBJECT (self->rtcp_sink))
element_id = EL_RTCP_SINK; element_id = EL_RTCP_SINK;
/* TODO srtp encryption else if (message->src == GST_OBJECT (self->srtpenc))
else if (message->src == GST_OBJECT (self->srtpenc)) element_id = EL_SRTP_ENCODER;
element_id = EL_SRTP_ENCODER; else if (message->src == GST_OBJECT (self->srtpdec))
else if (message->src == GST_OBJECT (self->srtpdec)) element_id = EL_SRTP_DECODER;
element_id = EL_SRTP_DECODER;
*/
else if (message->src == GST_OBJECT (self->audio_src)) else if (message->src == GST_OBJECT (self->audio_src))
element_id = EL_AUDIO_SRC; element_id = EL_AUDIO_SRC;