Commit 0435a021 authored by Sandrine Avakian's avatar Sandrine Avakian
Browse files

Adding option in linphonerc rtp_io_enable_local_output

to enable using local speaker in rtp_io mode. Option checked in [sound] section only.
parent f6f72cc5
......@@ -3133,6 +3133,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallSta
int crypto_idx;
MSMediaStreamIO io = MS_MEDIA_STREAM_IO_INITIALIZER;
bool_t use_rtp_io = lp_config_get_int(lc->config, "sound", "rtp_io", FALSE);
bool_t use_rtp_io_enable_local_output = lp_config_get_int(lc->config, "sound", "rtp_io_enable_local_output", FALSE);
stream = sal_media_description_find_best_stream(call->resultdesc, SalAudio);
if (stream && stream->dir!=SalStreamInactive && stream->rtp_port!=0){
......@@ -3181,7 +3182,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallSta
}
}
/*if playfile are supplied don't use soundcards*/
if (lc->use_files || use_rtp_io) {
if (lc->use_files || (use_rtp_io && !use_rtp_io_enable_local_output)) {
captcard=NULL;
playcard=NULL;
}
......@@ -3225,12 +3226,27 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, LinphoneCallSta
rtp_session_set_multicast_ttl(call->audiostream->ms.sessions.rtp_session,stream->ttl);
if (use_rtp_io) {
io.input.type = io.output.type = MSResourceRtp;
io.input.session = io.output.session = create_audio_rtp_io_session(call);
if(use_rtp_io_enable_local_output){
io.input.type = MSResourceRtp;
io.input.session = create_audio_rtp_io_session(call);
if (playcard){
io.output.type = MSResourceSoundcard;
io.output.soundcard = playcard;
}else{
io.output.type = MSResourceFile;
io.output.file = recfile;
}
}
else {
io.input.type = io.output.type = MSResourceRtp;
io.input.session = io.output.session = create_audio_rtp_io_session(call);
}
if (io.input.session == NULL) {
ok = FALSE;
}
}else {
}else {
if (playcard){
io.output.type = MSResourceSoundcard;
io.output.soundcard = playcard;
......
......@@ -6937,6 +6937,7 @@ void linphone_core_soundcard_hint_check( LinphoneCore* lc){
LinphoneCall* call = NULL;
bool_t dont_need_sound = TRUE;
bool_t use_rtp_io = lp_config_get_int(lc->config, "sound", "rtp_io", FALSE);
bool_t use_rtp_io_enable_local_output = lp_config_get_int(lc->config, "sound", "rtp_io_enable_local_output", FALSE);
/* check if the remaining calls are paused */
while( the_calls ){
......@@ -6949,7 +6950,7 @@ void linphone_core_soundcard_hint_check( LinphoneCore* lc){
}
/* if no more calls or all calls are paused, we can free the soundcard */
if ( (lc->calls==NULL || dont_need_sound) && !lc->use_files && !use_rtp_io){
if ( (lc->calls==NULL || dont_need_sound) && !lc->use_files && (!use_rtp_io || (use_rtp_io && use_rtp_io_enable_local_output))){
ms_message("Notifying soundcard that we don't need it anymore for calls.");
notify_soundcard_usage(lc,FALSE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment