Merge branch 'master' of git.savannah.nongnu.org:/srv/git/linphone

This commit is contained in:
Jehan Monnier 2011-06-15 13:01:30 +02:00
commit d60ebd8c6b
6 changed files with 74 additions and 7 deletions

View file

@ -669,6 +669,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){
int enabled=lp_config_get_int(lc->config,"sound","noisegate",0);
audio_stream_enable_noise_gate(audiostream,enabled);
}
if (lc->a_rtp)
rtp_session_set_transports(audiostream->session,lc->a_rtp,lc->a_rtcp);
@ -853,6 +854,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
const SalStreamDescription *vstream=sal_media_description_find_stream(call->resultdesc,
SalProtoRtpAvp,SalVideo);
#endif
bool_t use_arc=linphone_core_adaptive_rate_control_enabled(lc);
if(call->audiostream == NULL)
{
@ -876,7 +878,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
const char *playfile=lc->play_file;
const char *recfile=lc->rec_file;
call->audio_profile=make_profile(call,call->resultdesc,stream,&used_pt);
bool_t use_ec;
bool_t use_ec,use_arc_audio=use_arc;
if (used_pt!=-1){
if (playcard==NULL) {
@ -907,11 +909,17 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
playcard=NULL;
}
use_ec=captcard==NULL ? FALSE : linphone_core_echo_cancellation_enabled(lc);
#if defined(VIDEO_ENABLED) && defined(ANDROID)
/*On android we have to disable the echo canceller to preserve CPU for video codecs */
if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL)
#if defined(VIDEO_ENABLED)
if (vstream && vstream->dir!=SalStreamInactive && vstream->payloads!=NULL){
/*when video is used, do not make adaptive rate control on audio, it is stupid.*/
use_arc_audio=FALSE;
#if defined(ANDROID)
/*On android we have to disable the echo canceller to preserve CPU for video codecs */
use_ec=FALSE;
#endif
}
#endif
audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc_audio);
audio_stream_start_full(
call->audiostream,
call->audio_profile,

View file

@ -782,6 +782,26 @@ static void autoreplier_config_init(LinphoneCore *lc)
}
*/
/**
* Enable adaptive rate control (experimental feature, audio-only).
*
* Adaptive rate control consists in using RTCP feedback provided information to dynamically
* control the output bitrate of the encoders, so that we can adapt to the network conditions and
* available bandwidth.
**/
void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled){
lp_config_set_int(lc->config,"net","adaptive_rate_control",(int)enabled);
}
/**
* Returns whether adaptive rate control is enabled.
*
* See linphone_core_enable_adaptive_rate_control().
**/
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){
return lp_config_get_int(lc->config,"net","adaptive_rate_control",FALSE);
}
/**
* Sets maximum available download bandwidth
*

View file

@ -705,14 +705,17 @@ void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled);
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc);
/**
* set audio packetization time linphone expect to received from peer
* set audio packetization time linphone expect to receive from peer
* @ingroup media_parameters
*
*/
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
/**
* get audio packetization time linphone expect to received from peer, 0 means unspecified
* get audio packetization time linphone expect to receive from peer, 0 means unspecified
* @ingroup media_parameters
*/
int linphone_core_get_download_ptime(LinphoneCore *lc);

View file

@ -1023,6 +1023,18 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getReplacedCall( JNIEnv
return (jlong)linphone_call_get_replaced_call((LinphoneCall*)ptr);
}
extern "C" jfloat Java_org_linphone_core_LinphoneCallImpl_getCurrentQuality( JNIEnv* env
,jobject thiz
,jlong ptr) {
return (jfloat)linphone_call_get_current_quality((LinphoneCall*)ptr);
}
extern "C" jfloat Java_org_linphone_core_LinphoneCallImpl_getAverageQuality( JNIEnv* env
,jobject thiz
,jlong ptr) {
return (jfloat)linphone_call_get_average_quality((LinphoneCall*)ptr);
}
//LinphoneFriend
extern "C" long Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env

View file

@ -190,4 +190,28 @@ public interface LinphoneCall {
* @return call duration computed from media start
*/
int getDuration();
/**
* Obtain real-time quality rating of the call
*
* Based on local RTP statistics and RTCP feedback, a quality rating is computed and updated
* during all the duration of the call. This function returns its value at the time of the function call.
* It is expected that the rating is updated at least every 5 seconds or so.
* The rating is a floating point number comprised between 0 and 5.
*
* 4-5 = good quality <br>
* 3-4 = average quality <br>
* 2-3 = poor quality <br>
* 1-2 = very poor quality <br>
* 0-1 = can't be worse, mostly unusable <br>
*
* @returns The function returns -1 if no quality measurement is available, for example if no
* active audio stream exist. Otherwise it returns the quality rating.
*/
float getCurrentQuality();
/**
* Returns call quality averaged over all the duration of the call.
*
* See getCurrentQuality() for more details about quality measurement.
*/
float getAverageQuality();
}

@ -1 +1 @@
Subproject commit 79cbc5277d3fae8a70ae42a4e958042484ca2725
Subproject commit fd74240c297e33c7e96d14dc5f7ed5d3dbdb8dc0