From 96f5278f71a477eb67ad2f986d7666554986b0d7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 Jun 2011 19:04:09 +0200 Subject: [PATCH] add jni glue and java interface for call quality indicator --- coreapi/linphonecore_jni.cc | 12 ++++++++++ .../org/linphone/core/LinphoneCall.java | 24 +++++++++++++++++++ mediastreamer2 | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 4e201c845..2492e8f61 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -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 diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 9f029b053..e0f7cde34 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -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
+ * 3-4 = average quality
+ * 2-3 = poor quality
+ * 1-2 = very poor quality
+ * 0-1 = can't be worse, mostly unusable
+ * + * @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(); } diff --git a/mediastreamer2 b/mediastreamer2 index 79cbc5277..13dd93a64 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 79cbc5277d3fae8a70ae42a4e958042484ca2725 +Subproject commit 13dd93a64be54e9b015d38e6cd72695b3dff5e19