merge patch to parametrize video codecs in linphonec.

fix unterminated calls in some rare cases
This commit is contained in:
Simon Morlat 2010-06-23 16:34:12 +02:00
parent b98b1073cd
commit f342c26cd8
6 changed files with 76 additions and 26 deletions

8
NEWS
View file

@ -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

View file

@ -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

View file

@ -41,6 +41,9 @@
#include <sys/wait.h>
#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 <voice name> <sentence>' : 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 <index>' : enable available codec\n"
"'codec disable <index>' : disable codecs" },
{ "codec", lpc_cmd_acodec, "Audio codec configuration",
"'codec list' : list audio codecs\n"
"'codec enable <index>' : enable available audio codec\n"
"'codec disable <index>' : disable audio codec" },
{ "vcodec", lpc_cmd_vcodec, "Video codec configuration",
"'vcodec list' : list video codecs\n"
"'vcodec enable <index>' : enable available video codec\n"
"'vcodec disable <index>' : disable video codec" },
{ "ec", lpc_cmd_echocancellation, "Echo cancellation",
"'ec on [<delay>] [<tail>] [<framesize>]' : 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;

View file

@ -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;
}

View file

@ -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();

@ -1 +1 @@
Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812
Subproject commit 0401519a5946e9216c836ef6271bb2b3bf688179