From f342c26cd83951e319a029f7c3c06091d086d442 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 23 Jun 2010 16:34:12 +0200 Subject: [PATCH] merge patch to parametrize video codecs in linphonec. fix unterminated calls in some rare cases --- NEWS | 8 ++++ configure.in | 2 +- console/commands.c | 84 ++++++++++++++++++++++++++++++------------ coreapi/linphonecore.c | 3 +- coreapi/sal_eXosip2.c | 3 ++ mediastreamer2 | 2 +- 6 files changed, 76 insertions(+), 26 deletions(-) diff --git a/NEWS b/NEWS index 05b7a5ac6..826dbc65b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +linphone-3.3.2 -- June 23, 2010 + * fix crash when setting firewall address in gtk interface + * fix crash while closing video window on windows + * fix un-sent BYE message in some rare cases. + Requires: + mediastreamer2-2.6.0 + ortp-0.16.3 + linphone-3.3.1 -- June 3, 2010 * fix bugs when carrying non ascii displaynames in SIP messages * fix crash when codecs are incompatible diff --git a/configure.in b/configure.in index 10af6c770..e7edf835e 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([linphone],[3.3.1],[linphone-developers@nongnu.org]) +AC_INIT([linphone],[3.3.2],[linphone-developers@nongnu.org]) AC_CANONICAL_SYSTEM dnl Source packaging numbers diff --git a/console/commands.c b/console/commands.c index 967e03578..b46edc194 100644 --- a/console/commands.c +++ b/console/commands.c @@ -41,6 +41,9 @@ #include #endif +#define AUDIO 0 +#define VIDEO 1 + /*************************************************************************** * * Forward declarations @@ -76,7 +79,9 @@ static int lpc_cmd_duration(LinphoneCore *lc, char *args); static int lpc_cmd_status(LinphoneCore *lc, char *args); static int lpc_cmd_ports(LinphoneCore *lc, char *args); static int lpc_cmd_speak(LinphoneCore *lc, char *args); -static int lpc_cmd_codec(LinphoneCore *lc, char *args); +static int lpc_cmd_acodec(LinphoneCore *lc, char *args); +static int lpc_cmd_vcodec(LinphoneCore *lc, char *args); +static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args); static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args); static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args); static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args); @@ -98,9 +103,9 @@ static int linphonec_friend_add(LinphoneCore *lc, const char *name, const char * #endif static int linphonec_friend_delete(LinphoneCore *lc, int num); static int linphonec_friend_delete(LinphoneCore *lc, int num); -static void linphonec_codec_list(LinphoneCore *lc); -static void linphonec_codec_enable(LinphoneCore *lc, int index); -static void linphonec_codec_disable(LinphoneCore *lc, int index); +static void linphonec_codec_list(int type, LinphoneCore *lc); +static void linphonec_codec_enable(int type, LinphoneCore *lc, int index); +static void linphonec_codec_disable(int type, LinphoneCore *lc, int index); @@ -218,10 +223,14 @@ LPC_COMMAND commands[] = { "'speak ' : speak a text using the specified espeak voice.\n" "Example for english voice: 'speak default Hello my friend !'" }, - { "codec", lpc_cmd_codec, "Codec configuration", - "'codec list' : list codecs\n" - "'codec enable ' : enable available codec\n" - "'codec disable ' : disable codecs" }, + { "codec", lpc_cmd_acodec, "Audio codec configuration", + "'codec list' : list audio codecs\n" + "'codec enable ' : enable available audio codec\n" + "'codec disable ' : disable audio codec" }, + { "vcodec", lpc_cmd_vcodec, "Video codec configuration", + "'vcodec list' : list video codecs\n" + "'vcodec enable ' : enable available video codec\n" + "'vcodec disable ' : disable video codec" }, { "ec", lpc_cmd_echocancellation, "Echo cancellation", "'ec on [] [] []' : turn EC on with given delay, tail length and framesize\n" "'ec off' : turn echo cancellation (EC) off\n" @@ -1690,7 +1699,15 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){ return 1; } -static int lpc_cmd_codec(LinphoneCore *lc, char *args){ +static int lpc_cmd_acodec(LinphoneCore *lc, char *args){ + return lpc_cmd_codec(AUDIO, lc, args); +} + +static int lpc_cmd_vcodec(LinphoneCore *lc, char *args){ + return lpc_cmd_codec(VIDEO, lc, args); +} + +static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args){ char *arg1 = args; char *arg2 = NULL; char *ptr = args; @@ -1711,20 +1728,20 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){ #ifdef HAVE_READLINE rl_inhibit_completion=1; #endif - if (!strcmp(arg2,"all")) linphonec_codec_enable(lc,-1); - else linphonec_codec_enable(lc,atoi(arg2)); + if (!strcmp(arg2,"all")) linphonec_codec_enable(type,lc,-1); + else linphonec_codec_enable(type,lc,atoi(arg2)); #ifdef HAVE_READLINE rl_inhibit_completion=0; #endif } else if (strcmp(arg1,"list")==0) { - linphonec_codec_list(lc); + linphonec_codec_list(type,lc); } else if (strcmp(arg1,"disable")==0) { - if (!strcmp(arg2,"all")) linphonec_codec_disable(lc,-1); - else linphonec_codec_disable(lc,atoi(arg2)); + if (!strcmp(arg2,"all")) linphonec_codec_disable(type,lc,-1); + else linphonec_codec_disable(type,lc,atoi(arg2)); } else { @@ -1734,12 +1751,19 @@ static int lpc_cmd_codec(LinphoneCore *lc, char *args){ return 1; } -static void linphonec_codec_list(LinphoneCore *lc){ +static void linphonec_codec_list(int type, LinphoneCore *lc){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ pt=(PayloadType*)(node->data); linphonec_out("%2d: %s (%d) %s\n", index, pt->mime_type, pt->clock_rate, linphone_core_payload_type_enabled(lc,pt) ? "enabled" : "disabled"); @@ -1747,12 +1771,19 @@ static void linphonec_codec_list(LinphoneCore *lc){ } } -static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){ +static void linphonec_codec_enable(int type, LinphoneCore *lc, int sel_index){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ if (index == sel_index || sel_index == -1) { pt=(PayloadType*)(node->data); pt->flags|=PAYLOAD_TYPE_ENABLED; @@ -1762,12 +1793,19 @@ static void linphonec_codec_enable(LinphoneCore *lc, int sel_index){ } } -static void linphonec_codec_disable(LinphoneCore *lc, int sel_index){ +static void linphonec_codec_disable(int type, LinphoneCore *lc, int sel_index){ PayloadType *pt; codecs_config_t *config=&lc->codecs_conf; int index=0; - MSList *node; - for(node=config->audio_codecs;node!=NULL;node=ms_list_next(node)){ + MSList *node=NULL; + + if (type == AUDIO) { + node=config->audio_codecs; + } else if(type==VIDEO) { + node=config->video_codecs; + } + + for(;node!=NULL;node=ms_list_next(node)){ if (index == sel_index || sel_index == -1) { pt=(PayloadType*)(node->data); pt->flags&=~PAYLOAD_TYPE_ENABLED; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a6911b301..ccc40a810 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1207,7 +1207,8 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact) /*result must be an array of chars at least LINPHONE_IPADDR_SIZE */ void linphone_core_get_local_ip(LinphoneCore *lc, const char *dest, char *result){ - if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS){ + if (linphone_core_get_firewall_policy(lc)==LINPHONE_POLICY_USE_NAT_ADDRESS + && linphone_core_get_nat_address(lc)!=NULL){ strncpy(result,linphone_core_get_nat_address(lc),LINPHONE_IPADDR_SIZE); return; } diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index bd3e7e664..19e3a2196 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -889,6 +889,9 @@ static void call_accepted(Sal *sal, eXosip_event_t *ev){ ms_error("A closed call is accepted ?"); return; } + + op->did=ev->did; + sdp=eXosip_get_sdp_info(ev->response); if (sdp){ op->base.remote_media=sal_media_description_new(); diff --git a/mediastreamer2 b/mediastreamer2 index bc6cdb650..0401519a5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812 +Subproject commit 0401519a5946e9216c836ef6271bb2b3bf688179