diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 7beedbc78..550c0fb29 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -753,17 +753,17 @@ void linphone_call_make_local_media_description(LinphoneCall *call) { md->streams[call->main_video_stream_index].rtcp_mux = rtcp_mux; strncpy(md->streams[call->main_video_stream_index].name,"Video",sizeof(md->streams[call->main_video_stream_index].name)-1); - codec_hints.bandwidth_limit=0; - codec_hints.max_codecs=-1; - codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; - l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); + codec_hints.bandwidth_limit=0; + codec_hints.max_codecs=-1; + codec_hints.previously_used=old_md ? old_md->streams[call->main_video_stream_index].already_assigned_payloads : NULL; + l=make_codec_list(lc, &codec_hints, SalVideo, lc->codecs_conf.video_codecs); - if (params->has_video && l != NULL){ + if (params->has_video && l != NULL){ strncpy(md->streams[call->main_video_stream_index].rtp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtp_addr)); strncpy(md->streams[call->main_video_stream_index].rtcp_addr,linphone_call_get_public_ip_for_stream(call,call->main_video_stream_index),sizeof(md->streams[call->main_video_stream_index].rtcp_addr)); md->streams[call->main_video_stream_index].rtp_port=call->media_ports[call->main_video_stream_index].rtp_port; md->streams[call->main_video_stream_index].rtcp_port=call->media_ports[call->main_video_stream_index].rtcp_port; - md->streams[call->main_video_stream_index].payloads=l; + md->streams[call->main_video_stream_index].payloads=l; if (call->videostream && call->videostream->ms.sessions.rtp_session) { char* me = linphone_address_as_string_uri_only(call->me); md->streams[call->main_video_stream_index].rtp_ssrc=rtp_session_get_send_ssrc(call->videostream->ms.sessions.rtp_session); diff --git a/tester/call_tester.c b/tester/call_tester.c index 8c3c2aecc..c0e5858c7 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -717,80 +717,80 @@ static void disable_all_codecs(const MSList* elem, LinphoneCoreManager* call){ ***/ static void call_with_no_audio_codec(void){ - LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); - LinphoneCall* out_call ; - - const MSList* elem =linphone_core_get_audio_codecs(caller->lc); - - disable_all_codecs(elem, caller); - - - out_call = linphone_core_invite_address(caller->lc,callee->identity); - linphone_call_ref(out_call); - BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); - - - BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); - BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); - BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); - - linphone_call_unref(out_call); - linphone_core_manager_destroy(callee); - linphone_core_manager_destroy(caller); + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + + const MSList* elem =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem, caller); + + + out_call = linphone_core_invite_address(caller->lc,callee->identity); + linphone_call_ref(out_call); + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); } static void video_call_with_no_audio_and_no_video_codec(void){ - - LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); - LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); - LinphoneCall* out_call ; - LinphoneVideoPolicy callee_policy, caller_policy; - LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; - - const MSList* elem_video =linphone_core_get_video_codecs(caller->lc); - - const MSList* elem_audio =linphone_core_get_audio_codecs(caller->lc); - - disable_all_codecs(elem_audio, caller); - disable_all_codecs(elem_video, caller); - - callee_policy.automatically_initiate=FALSE; - callee_policy.automatically_accept=TRUE; - caller_policy.automatically_initiate=TRUE; - caller_policy.automatically_accept=FALSE; - - linphone_core_set_video_policy(callee->lc,&callee_policy); - linphone_core_set_video_policy(caller->lc,&caller_policy); - - - linphone_core_enable_video_display(callee->lc, TRUE); - linphone_core_enable_video_capture(callee->lc, TRUE); - - linphone_core_enable_video_display(caller->lc, TRUE); - linphone_core_enable_video_capture(caller->lc, TRUE); - - /* Create call params */ - caller_test_params.base = linphone_core_create_call_params(caller->lc, NULL); - - - out_call = linphone_core_invite_address_with_params(caller->lc, callee->identity,caller_test_params.base); - linphone_call_ref(out_call); - - linphone_call_params_destroy(caller_test_params.base); - if (callee_test_params.base) linphone_call_params_destroy(callee_test_params.base); - - - BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); - - BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); - BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); - BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); - - linphone_call_unref(out_call); - linphone_core_manager_destroy(callee); - linphone_core_manager_destroy(caller); + + LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCall* out_call ; + LinphoneVideoPolicy callee_policy, caller_policy; + LinphoneCallTestParams caller_test_params = {0}, callee_test_params = {0}; + + const MSList* elem_video =linphone_core_get_video_codecs(caller->lc); + + const MSList* elem_audio =linphone_core_get_audio_codecs(caller->lc); + + disable_all_codecs(elem_audio, caller); + disable_all_codecs(elem_video, caller); + + callee_policy.automatically_initiate=FALSE; + callee_policy.automatically_accept=TRUE; + caller_policy.automatically_initiate=TRUE; + caller_policy.automatically_accept=FALSE; + + linphone_core_set_video_policy(callee->lc,&callee_policy); + linphone_core_set_video_policy(caller->lc,&caller_policy); + + + linphone_core_enable_video_display(callee->lc, TRUE); + linphone_core_enable_video_capture(callee->lc, TRUE); + + linphone_core_enable_video_display(caller->lc, TRUE); + linphone_core_enable_video_capture(caller->lc, TRUE); + + /* Create call params */ + caller_test_params.base = linphone_core_create_call_params(caller->lc, NULL); + + + out_call = linphone_core_invite_address_with_params(caller->lc, callee->identity,caller_test_params.base); + linphone_call_ref(out_call); + + linphone_call_params_destroy(caller_test_params.base); + if (callee_test_params.base) linphone_call_params_destroy(callee_test_params.base); + + + BC_ASSERT_TRUE(wait_for(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallOutgoingInit, 1)); + + BC_ASSERT_TRUE(wait_for_until(caller->lc, callee->lc, &caller->stat.number_of_LinphoneCallError, 1, 6000)); + BC_ASSERT_EQUAL(linphone_call_get_reason(out_call), LinphoneReasonNotAcceptable, int, "%d"); + BC_ASSERT_EQUAL(callee->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + linphone_call_unref(out_call); + linphone_core_manager_destroy(callee); + linphone_core_manager_destroy(caller); }