Merge branch 'master' of git.linphone.org:linphone-private

This commit is contained in:
Jehan Monnier 2010-07-11 16:39:02 +02:00
commit c4852f9d65
19 changed files with 313 additions and 97 deletions

8
NEWS
View file

@ -1,3 +1,11 @@
linphone-3.3.2 -- July 1st, 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

@ -71,14 +71,16 @@ LOCAL_C_INCLUDES += \
LOCAL_LDLIBS += -llog
LOCAL_STATIC_LIBRARIES := \
libmsandroidsnd \
libmediastreamer2 \
libortp \
libspeex \
libeXosip2 \
libosip2 \
libgsm
# libmsilbc \
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ILBC=1
LOCAL_STATIC_LIBRARIES += libmsilbc
endif
LOCAL_MODULE_CLASS = SHARED_LIBRARIES
include $(BUILD_SHARED_LIBRARY)

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

@ -142,7 +142,11 @@ static void spawn_linphonec(int argc, char *argv[]){
}
args[j++]=NULL;
#ifdef __uClinux__
pid = vfork();
#else
pid = fork();
#endif
if (pid < 0){
fprintf(stderr,"Could not fork\n");
exit(-1);

View file

@ -271,7 +271,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
char *msg=(char*)details;
const char *msg=details;
LinphoneCall *call=lc->call;
if (sal_op_get_user_pointer(op)!=lc->call){
@ -281,11 +281,13 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
if (lc->vtable.show) lc->vtable.show(lc);
if (error==SalErrorNoResponse){
msg=_("No response.");
if (lc->vtable.display_status)
lc->vtable.display_status(lc,_("No response."));
lc->vtable.display_status(lc,msg);
}else if (error==SalErrorProtocol){
msg=details ? details : _("Protocol error.");
if (lc->vtable.display_status)
lc->vtable.display_status(lc, details ? details : _("Protocol error."));
lc->vtable.display_status(lc, msg);
}else if (error==SalErrorFailure){
switch(sr){
case SalReasonDeclined:
@ -336,7 +338,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
if (call!=NULL) {
linphone_call_destroy(call);
if (sr!=SalReasonDeclined) gstate_new_state(lc, GSTATE_CALL_ERROR, msg);
else gstate_new_state(lc, GSTATE_CALL_END, NULL);
else gstate_new_state(lc, GSTATE_CALL_END, msg);
lc->call=NULL;
}
}

View file

@ -620,8 +620,8 @@ static void sound_config_read(LinphoneCore *lc)
linphone_core_enable_agc(lc,
lp_config_get_int(lc->config,"sound","agc",0));
gain=lp_config_get_float(lc->config,"sound","soft_play_lev",0);
linphone_core_set_soft_play_level(lc,gain);
gain=lp_config_get_float(lc->config,"sound","playback_gain_db",0);
linphone_core_set_playback_gain_db (lc,gain);
}
static void sip_config_read(LinphoneCore *lc)
@ -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;
}
@ -2159,6 +2160,13 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){
return FALSE;
}
#ifdef TEST_EXT_RENDERER
static void rendercb(void *data, const MSPicture *local, const MSPicture *remote){
ms_message("rendercb, local buffer=%p, remote buffer=%p",
local ? local->planes[0] : NULL, remote? remote->planes[0] : NULL);
}
#endif
void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
SalMediaDescription *md=call->localdesc;
lc->audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc));
@ -2166,8 +2174,8 @@ void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
const char *type=lp_config_get_string(lc->config,"sound","el_type","mic");
if (strcasecmp(type,"mic")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlMic);
else if (strcasecmp(type,"speaker")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlSpeaker);
else if (strcasecmp(type,"full")==0)
audio_stream_enable_echo_limiter(lc->audiostream,ELControlFull);
}
audio_stream_enable_gain_control(lc->audiostream,TRUE);
if (linphone_core_echo_cancellation_enabled(lc)){
@ -2186,8 +2194,12 @@ void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
rtp_session_set_transports(lc->audiostream->session,lc->a_rtp,lc->a_rtcp);
#ifdef VIDEO_ENABLED
if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0)
if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0){
lc->videostream=video_stream_new(md->streams[1].port,linphone_core_ipv6_enabled(lc));
#ifdef TEST_EXT_RENDERER
video_stream_set_render_callback(lc->videostream,rendercb,NULL);
#endif
}
#else
lc->videostream=NULL;
#endif
@ -2229,46 +2241,53 @@ static void parametrize_equalizer(LinphoneCore *lc, AudioStream *st){
static void post_configure_audio_streams(LinphoneCore *lc){
AudioStream *st=lc->audiostream;
float gain=lp_config_get_float(lc->config,"sound","mic_gain",-1);
if (gain!=-1)
audio_stream_set_mic_gain(st,gain);
float mic_gain=lp_config_get_float(lc->config,"sound","mic_gain",1);
float thres = 0;
float recv_gain;
float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05);
float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0);
int dc_removal=lp_config_get_int(lc->config,"sound","dc_removal",0);
if (mic_gain!=-1)
audio_stream_set_mic_gain(st,mic_gain);
lc->audio_muted=FALSE;
float recv_gain = lc->sound_conf.soft_play_lev;
recv_gain = lc->sound_conf.soft_play_lev;
if (recv_gain != 0) {
linphone_core_set_soft_play_level(lc,recv_gain);
linphone_core_set_playback_gain_db (lc,recv_gain);
}
if (st->volsend){
ms_filter_call_method(st->volsend,MS_VOLUME_REMOVE_DC,&dc_removal);
}
if (linphone_core_echo_limiter_enabled(lc)){
float speed=lp_config_get_float(lc->config,"sound","el_speed",-1);
float thres=lp_config_get_float(lc->config,"sound","el_thres",-1);
thres=lp_config_get_float(lc->config,"sound","el_thres",-1);
float force=lp_config_get_float(lc->config,"sound","el_force",-1);
int sustain=lp_config_get_int(lc->config,"sound","el_sustain",-1);
MSFilter *f=NULL;
if (st->el_type==ELControlMic){
if (st->el_type!=ELInactive){
f=st->volsend;
if (speed==-1) speed=0.03;
if (force==-1) force=10;
}
else if (st->el_type==ELControlSpeaker){
f=st->volrecv;
if (speed==-1) speed=0.02;
if (force==-1) force=5;
}
if (speed!=-1)
if (force==-1) force=25;
ms_filter_call_method(f,MS_VOLUME_SET_EA_SPEED,&speed);
if (thres!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
if (force!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_FORCE,&force);
if (sustain!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
if (thres!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_THRESHOLD,&thres);
if (sustain!=-1)
ms_filter_call_method(f,MS_VOLUME_SET_EA_SUSTAIN,&sustain);
}
}
if (st->volsend){
float ng_thres=lp_config_get_float(lc->config,"sound","ng_thres",0.05);
float ng_floorgain=lp_config_get_float(lc->config,"sound","ng_floorgain",0);
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&ng_thres);
ms_filter_call_method(st->volsend,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&ng_floorgain);
}
if (st->volrecv){
/* parameters for a limited noise-gate effect, using echo limiter threshold */
float floorgain = 1/mic_gain;
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_THRESHOLD,&thres);
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_NOISE_GATE_FLOORGAIN,&floorgain);
}
parametrize_equalizer(lc,st);
if (lc->vtable.dtmf_received!=NULL){
/* replace by our default action*/
@ -2661,10 +2680,14 @@ void linphone_core_set_ring_level(LinphoneCore *lc, int level){
if (sndcard) ms_snd_card_set_level(sndcard,MS_SND_CARD_PLAYBACK,level);
}
void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){
float gain=level;
lc->sound_conf.soft_play_lev=level;
/**
* Allow to control play level before entering sound card: gain in db
*
* @ingroup media_parameters
**/
void linphone_core_set_playback_gain_db (LinphoneCore *lc, float gaindb){
float gain=gaindb;
lc->sound_conf.soft_play_lev=gaindb;
AudioStream *st=lc->audiostream;
if (!st) return; /*just return*/
@ -2672,11 +2695,17 @@ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){
ms_filter_call_method(st->volrecv,MS_VOLUME_SET_DB_GAIN,&gain);
}else ms_warning("Could not apply gain: gain control wasn't activated.");
}
float linphone_core_get_soft_play_level(LinphoneCore *lc) {
/**
* Get playback gain in db before entering sound card.
*
* @ingroup media_parameters
**/
float linphone_core_get_playback_gain_db(LinphoneCore *lc) {
float gain=0;
AudioStream *st=lc->audiostream;
if (st->volrecv){
ms_filter_call_method(st->volrecv,MS_VOLUME_GET,&gain);
ms_filter_call_method(st->volrecv,MS_VOLUME_GET_GAIN_DB,&gain);
}else ms_warning("Could not get gain: gain control wasn't activated.");
return gain;
@ -2985,7 +3014,7 @@ bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc){
void linphone_core_mute_mic(LinphoneCore *lc, bool_t val){
if (lc->audiostream!=NULL){
audio_stream_set_mic_gain(lc->audiostream,
(val==TRUE) ? 0 : 1.0);
(val==TRUE) ? 0 : 1.0); // REVISIT: take mic_gain value
if ( linphone_core_get_rtp_no_xmit_on_audio_mute(lc) ){
audio_stream_mute_rtp(lc->audiostream,val);
}
@ -3777,3 +3806,27 @@ void linphone_core_destroy(LinphoneCore *lc){
ms_free(lc);
}
static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) {
const MSList *elem;
for(elem=from;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && rate==pt->clock_rate) {
return pt;
}
}
return NULL;
}
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) {
PayloadType* result = find_payload_type_from_list(type, rate, linphone_core_get_audio_codecs(lc));
if (result) {
return result;
} else {
result = find_payload_type_from_list(type, rate, linphone_core_get_video_codecs(lc));
if (result) {
return result;
}
}
//not found
return NULL;
}

View file

@ -573,6 +573,14 @@ bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt);
int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);
/*
* get payload type from mime type an clock rate
* @ingroup media_parameters
* iterates both audio an video
* return NULL if not found
*/
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) ;
const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);
bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
@ -667,18 +675,10 @@ int linphone_core_get_play_level(LinphoneCore *lc);
int linphone_core_get_rec_level(LinphoneCore *lc);
void linphone_core_set_ring_level(LinphoneCore *lc, int level);
void linphone_core_set_play_level(LinphoneCore *lc, int level);
/**
* Allow to control play level before entering sound card: level in db
*
* @ingroup media_parameters
**/
void linphone_core_set_soft_play_level(LinphoneCore *lc, float level);
/**
* get play level before entering sound card: level in db
*
* @ingroup media_parameters
**/
float linphone_core_get_soft_play_level(LinphoneCore *lc);
void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level);
float linphone_core_get_playback_gain_db(LinphoneCore *lc);
void linphone_core_set_rec_level(LinphoneCore *lc, int level);
const char * linphone_core_get_ringer_device(LinphoneCore *lc);
const char * linphone_core_get_playback_device(LinphoneCore *lc);

View file

@ -83,7 +83,7 @@ public:
/*displayStatus(LinphoneCore lc,String message);*/
displayStatusId = env->GetMethodID(listernerClass,"displayStatus","(Lorg/linphone/core/LinphoneCore;Ljava/lang/String;)V");
/*void generalState(LinphoneCore lc,int state); */
generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;)V");
generalStateId = env->GetMethodID(listernerClass,"generalState","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$GeneralState;Ljava/lang/String;)V");
generalStateClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneCore$GeneralState"));
generalStateFromIntId = env->GetStaticMethodID(generalStateClass,"fromInt","(I)Lorg/linphone/core/LinphoneCore$GeneralState;");
@ -145,7 +145,8 @@ public:
env->CallVoidMethod(lcData->listener
,lcData->generalStateId
,lcData->core
,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state));
,env->CallStaticObjectMethod(lcData->generalStateClass,lcData->generalStateFromIntId,gstate->new_state),
gstate->message ? env->NewStringUTF(gstate->message) : NULL);
}
};
@ -161,9 +162,11 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv*
LinphoneCoreData* ldata = new LinphoneCoreData(env,thiz,jlistener,juserdata);
#ifdef ANDROID
ms_andsnd_register_card(jvm);
// requires an fpu libmsilbc_init();
#endif /*ANDROID*/
#ifdef HAVE_ILBC
libmsilbc_init(); // requires an fpu
#endif
jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable
,userConfig
,factoryConfig
@ -292,17 +295,17 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setNetworkStateReachable
linphone_core_set_network_reachable((LinphoneCore*)lc,isReachable);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSoftPlayLevel( JNIEnv* env
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPlaybackGain( JNIEnv* env
,jobject thiz
,jlong lc
,jfloat gain) {
linphone_core_set_soft_play_level((LinphoneCore*)lc,gain);
linphone_core_set_playback_gain_db((LinphoneCore*)lc,gain);
}
extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getSoftPlayLevel( JNIEnv* env
extern "C" float Java_org_linphone_core_LinphoneCoreImpl_getPlaybackGain( JNIEnv* env
,jobject thiz
,jlong lc) {
return linphone_core_get_soft_play_level((LinphoneCore*)lc);
return linphone_core_get_playback_gain_db((LinphoneCore*)lc);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_muteMic( JNIEnv* env
@ -337,7 +340,35 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isMicMuted( JNIEnv*
,jlong lc) {
return linphone_core_is_mic_muted((LinphoneCore*)lc);
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findPayloadType(JNIEnv* env
,jobject thiz
,jlong lc
,jstring jmime
,jint rate) {
const char* mime = env->GetStringUTFChars(jmime, NULL);
jlong result = (jlong)linphone_core_find_payload_type((LinphoneCore*)lc,mime,rate);
env->ReleaseStringUTFChars(jmime, mime);
return result;
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv* env
,jobject thiz
,jlong lc
,jlong pt
,jboolean enable) {
return linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
,jobject thiz
,jlong lc
,jboolean enable) {
linphone_core_enable_echo_cancellation((LinphoneCore*)lc,enable);
}
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEnabled(JNIEnv* env
,jobject thiz
,jlong lc
) {
return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
}
//ProxyConfig
@ -377,6 +408,20 @@ extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getProxy(JNIEn
return NULL;
}
}
extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_setRoute(JNIEnv* env,jobject thiz,jlong proxyCfg,jstring jroute) {
const char* route = env->GetStringUTFChars(jroute, NULL);
int err=linphone_proxy_config_set_route((LinphoneProxyConfig*)proxyCfg,route);
env->ReleaseStringUTFChars(jroute, route);
return err;
}
extern "C" jstring Java_org_linphone_core_LinphoneProxyConfigImpl_getRoute(JNIEnv* env,jobject thiz,jlong proxyCfg) {
const char* route = linphone_proxy_config_get_route((LinphoneProxyConfig*)proxyCfg);
if (route) {
return env->NewStringUTF(route);
} else {
return NULL;
}
}
extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_enableRegister(JNIEnv* env,jobject thiz,jlong proxyCfg,jboolean enableRegister) {
linphone_proxy_config_enable_register((LinphoneProxyConfig*)proxyCfg,enableRegister);
@ -531,9 +576,9 @@ extern "C" void Java_org_linphone_core_LinphoneAddressImpl_setDisplayName(JNIEnv
,jobject thiz
,jlong address
,jstring jdisplayName) {
const char* displayName = env->GetStringUTFChars(jdisplayName, NULL);
const char* displayName = jdisplayName!= NULL?env->GetStringUTFChars(jdisplayName, NULL):NULL;
linphone_address_set_display_name((LinphoneAddress*)address,displayName);
env->ReleaseStringUTFChars(jdisplayName, displayName);
if (displayName != NULL) env->ReleaseStringUTFChars(jdisplayName, displayName);
}
@ -553,3 +598,17 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCallLogImpl_isIncoming(JNIEnv
,jlong ptr) {
return ((LinphoneCallLog*)ptr)->dir==LinphoneCallIncoming?JNI_TRUE:JNI_FALSE;
}
extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env
,jobject thiz
,jlong ptr) {
PayloadType* pt = (PayloadType*)ptr;
char* value = ms_strdup_printf("[%s] clock [%s], bitrate [%s]"
,payload_type_get_mime(pt)
,payload_type_get_rate(pt)
,payload_type_get_bitrate(pt));
jstring jvalue =env->NewStringUTF(value);
ms_free(value);
return jvalue;
}

View file

@ -59,8 +59,8 @@ static MSList *match_payloads(const MSList *local, const MSList *remote){
matched=find_payload_type_best_match(local,p2);
if (matched){
matched=payload_type_clone(matched);
if (p2->recv_fmtp)
payload_type_set_send_fmtp(matched,p2->recv_fmtp);
if (p2->send_fmtp)
payload_type_set_send_fmtp(matched,p2->send_fmtp);
res=ms_list_append(res,matched);
payload_type_set_number(matched,payload_type_get_number(p2));
}else{

View file

@ -167,7 +167,12 @@ int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route)
ms_free(obj->reg_route);
obj->reg_route=NULL;
}
obj->reg_route=ms_strdup(route);
if (route!=NULL){
/*try to prepend 'sip:' */
if (strstr(route,"sip:")==NULL){
obj->reg_route=ms_strdup_printf("sip:%s",route);
}else obj->reg_route=ms_strdup(route);
}
return 0;
}

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

View file

@ -159,12 +159,12 @@ public interface LinphoneCore {
* Allow to control play level before entering sound card:
* @param level in db
*/
public void setSoftPlayLevel(float gain);
public void setPlaybackGain(float gain);
/**
* get play level before entering sound card:
* @return level in db
*/
public float getSoftPlayLevel();
public float getPlaybackGain();
/**
* Mutes or unmutes the local microphone.
* @param isMuted
@ -185,4 +185,19 @@ public interface LinphoneCore {
*
*/
public void clearCallLogs();
/***
* get payload type from mime type an clock rate
*
* return null if not found
*/
public PayloadType findPayloadType(String mime,int clockRate);
public void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException;
public void enableEchoCancellation(boolean enable);
public boolean isEchoCancellationEnabled();
}

View file

@ -47,5 +47,6 @@ public interface LinphoneCoreListener {
* @param state LinphoneCore.GeneralState
* @return
* */
public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state);
public void generalState(LinphoneCore lc,LinphoneCore.GeneralState state, String message);
}

View file

@ -72,4 +72,7 @@ public interface LinphoneProxyConfig {
public String getProxy();
public boolean registerEnabled();
public boolean isRegistered();
public void setRoute(String routeUri) throws LinphoneCoreException;
public String getRoute();
}

View file

@ -0,0 +1,23 @@
/*
PayloadType.java
Copyright (C) 2010 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone.core;
public interface PayloadType {
}

@ -1 +1 @@
Subproject commit a6484a8463b62a60d03ef8358b2e305408f3b011
Subproject commit 429baf423f2db8673ffa98f7f7d6cbac0c23bde9

2
oRTP

@ -1 +1 @@
Subproject commit 18eccd4f3af64f3bd5293d635a1a169dc77c92ad
Subproject commit d4868b64141773b38ba6e8afe3a371fa57525b2b

View file

@ -71,4 +71,4 @@ mediastreamer2/src/drawdib-display.c
mediastreamer2/src/audiomixer.c
mediastreamer2/src/chanadapt.c
mediastreamer2/src/itc.c
mediastreamer2/src/extdisplay.c