mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 21:28:08 +00:00
Reflect real media directions in the current call params.
This commit is contained in:
parent
6e898ccb0d
commit
90678a34b1
1 changed files with 21 additions and 15 deletions
|
|
@ -688,24 +688,30 @@ void linphone_call_update_biggest_desc(LinphoneCall *call, SalMediaDescription *
|
|||
static void force_streams_dir_according_to_state(LinphoneCall *call, SalMediaDescription *md){
|
||||
int i;
|
||||
|
||||
switch (call->state){
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i=0; i<SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){
|
||||
SalStreamDescription *sd = &md->streams[i];
|
||||
if (sd->dir != SalStreamInactive) {
|
||||
sd->dir = SalStreamSendOnly;
|
||||
if (sd->type == SalVideo){
|
||||
if (lp_config_get_int(call->core->config, "sip", "inactive_video_on_pause", 0)) {
|
||||
sd->dir = SalStreamInactive;
|
||||
|
||||
switch (call->state){
|
||||
case LinphoneCallPausing:
|
||||
case LinphoneCallPaused:
|
||||
if (sd->dir != SalStreamInactive) {
|
||||
sd->dir = SalStreamSendOnly;
|
||||
if (sd->type == SalVideo){
|
||||
if (lp_config_get_int(call->core->config, "sip", "inactive_video_on_pause", 0)) {
|
||||
sd->dir = SalStreamInactive;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Reflect the stream directions in the call params */
|
||||
if (i == call->main_audio_stream_index) {
|
||||
linphone_call_params_set_audio_direction(call->current_params, media_direction_from_sal_stream_dir(sd->dir));
|
||||
} else if (i == call->main_video_stream_index) {
|
||||
linphone_call_params_set_video_direction(call->current_params, media_direction_from_sal_stream_dir(sd->dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue