return (jfloat)((LinphoneCallStats *)stats_ptr)->jitter_stats.jitter_buffer_size_ms;
}
+extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getLocalLossRate(JNIEnv *env, jobject thiz,jlong stats_ptr) {
+ const LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
+ return stats->local_loss_rate;
+}
+
+extern "C" jfloat Java_org_linphone_core_LinphoneCallStatsImpl_getLocalLateRate(JNIEnv *env, jobject thiz, jlong stats_ptr) {
+ const LinphoneCallStats *stats = (LinphoneCallStats *)stats_ptr;
+ return stats->local_late_rate;
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCallStatsImpl_updateStats(JNIEnv *env, jobject thiz, jlong call_ptr, jint mediatype) {
+ if (mediatype==LINPHONE_CALL_STATS_AUDIO)
+ linphone_call_get_audio_stats((LinphoneCall*)call_ptr);
+ else
+ linphone_call_get_video_stats((LinphoneCall*)call_ptr);
+}
+
/*payloadType*/
extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env,jobject thiz,jlong ptr) {
PayloadType* pt = (PayloadType*)ptr;
return (jfloat)linphone_call_get_average_quality((LinphoneCall*)ptr);
}
-
//LinphoneFriend
extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env
,jobject thiz
public float getUploadBandwidth();
/**
- * Get the sender loss rate since last report
+ * Get the local loss rate since last report
* @return The sender loss rate
*/
public float getSenderLossRate();
/**
- * Get the receiver loss rate since last report
+ * Get the remote reported loss rate since last report
* @return The receiver loss rate
*/
public float getReceiverLossRate();
/**
- * Get the sender interarrival jitter
+ * Get the local interarrival jitter
* @return The interarrival jitter at last emitted sender report
*/
public float getSenderInterarrivalJitter();
/**
- * Get the receiver interarrival jitter
+ * Get the remote reported interarrival jitter
* @return The interarrival jitter at last received receiver report
*/
public float getReceiverInterarrivalJitter();
* @return The jitter buffer size in milliseconds
*/
public float getJitterBufferSize();
+
+ /**
+ * Get the local loss rate. Unlike getSenderLossRate() that returns this loss rate "since last emitted RTCP report", the value returned here is updated every second.
+ * @return The local loss rate percentage.
+ **/
+ public float getLocalLossRate();
+
+ /**
+ * Get the local late packets rate. The value returned here is updated every second.
+ * @return The local late rate percentage.
+ **/
+ public float getLocalLateRate();
}
videoStats = stats;
}
public LinphoneCallStats getAudioStats() {
+ if (audioStats!=null) ((LinphoneCallStatsImpl)audioStats).updateRealTimeStats(this);
return audioStats;
}
public LinphoneCallStats getVideoStats() {
+ if (videoStats!=null) ((LinphoneCallStatsImpl)videoStats).updateRealTimeStats(this);
return videoStats;
}
public CallDirection getDirection() {
private float roundTripDelay;
private long latePacketsCumulativeNumber;
private float jitterBufferSize;
+ private float localLossRate;
+ private float localLateRate;
+ private long nativePtr;
private native int getMediaType(long nativeStatsPtr);
private native int getIceState(long nativeStatsPtr);
private native float getRoundTripDelay(long nativeStatsPtr);
private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr);
private native float getJitterBufferSize(long nativeStatsPtr);
+ private native float getLocalLossRate(long nativeStatsPtr);
+ private native float getLocalLateRate(long nativeStatsPtr);
+ private native void updateStats(long nativeCallPtr, int mediaType);
protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) {
+ nativePtr=nativeStatsPtr;
mediaType = getMediaType(nativeStatsPtr);
iceState = getIceState(nativeStatsPtr);
downloadBandwidth = getDownloadBandwidth(nativeStatsPtr);
roundTripDelay = getRoundTripDelay(nativeStatsPtr);
latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr);
jitterBufferSize = getJitterBufferSize(nativeStatsPtr);
+
+ }
+
+ protected void updateRealTimeStats(LinphoneCall call){
+ updateStats( ((LinphoneCallImpl)call).nativePtr, mediaType);
+ localLossRate=getLocalLossRate(nativePtr);
+ localLateRate=getLocalLateRate(nativePtr);
}
public MediaType getMediaType() {
public float getJitterBufferSize() {
return jitterBufferSize;
}
+
+ public float getLocalLossRate(){
+ return localLossRate;
+ }
+
+ public float getLocalLateRate(){
+ return localLateRate;
+ }
}
-Subproject commit abf2a7ec461ac411703233e3554e985d62fa0b9c
+Subproject commit 4f93003c1eade1442fdedd8dee10f18c98ec47c3