diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 6da4d2343..6ec9acc9f 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -3116,6 +3116,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){ @@ -3164,7 +3165,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; } @@ -3208,12 +3209,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; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a91ccbb53..05d68cf52 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1163,6 +1163,8 @@ static PayloadType* find_payload_type_from_list(const char* type, int rate, int static bool_t linphone_core_codec_supported(LinphoneCore *lc, SalStreamType type, const char *mime){ if (type == SalVideo && lp_config_get_int(lc->config, "video", "rtp_io", FALSE)){ return TRUE; /*in rtp io mode, we don't transcode video, thus we can support a format for which we have no encoder nor decoder.*/ + } else if (type == SalAudio && lp_config_get_int(lc->config, "sound", "rtp_io", FALSE)){ + return TRUE; /*in rtp io mode, we don't transcode video, thus we can support a format for which we have no encoder nor decoder.*/ } else if (type == SalText) { return TRUE; } @@ -6112,6 +6114,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 ){ @@ -6123,7 +6126,7 @@ void linphone_core_soundcard_hint_check( LinphoneCore* lc){ the_calls = the_calls->next; } /* 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); } diff --git a/daemon/commands/video.cc b/daemon/commands/video.cc index c1486ccad..55d2eb01e 100644 --- a/daemon/commands/video.cc +++ b/daemon/commands/video.cc @@ -164,8 +164,12 @@ AutoVideo::AutoVideo(): void AutoVideo::exec(Daemon* app, const std::string& args) { - bool enable = (args.compare("on") == 0); + bool enable = (args.compare("on") == 0); + LinphoneCore *lc = app->getCore(); + LinphoneVideoPolicy vpol = {TRUE, TRUE}; + + linphone_core_set_video_policy(lc, &vpol); app->setAutoVideo(enable); app->sendResponse(Response(enable?"Auto video ON": "Auto video OFF", Response::Ok)); } diff --git a/daemon/daemon.cc b/daemon/daemon.cc index e02c4cf3f..3cefb1d1d 100644 --- a/daemon/daemon.cc +++ b/daemon/daemon.cc @@ -958,6 +958,9 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[i], "--enable-lsd") == 0) { lsd_enabled = true; } + else{ + fprintf(stderr, "Unrecognized option : %s", argv[i]); + } } Daemon app(config_path, factory_config_path, log_file, pipe_name, display_video, capture_video); app.enableStatsEvents(stats_enabled);