]> sjero.net Git - linphone/blobdiff - java/common/org/linphone/core/LinphoneCallStats.java
add jni and java accessors for realtime late and loss rates
[linphone] / java / common / org / linphone / core / LinphoneCallStats.java
index f391b2a91cf28469329f7224e0842cab33edcd2f..295c99484105b96e51e76dd5ad2618ac3938c03f 100644 (file)
@@ -23,7 +23,7 @@ import java.util.Vector;
 
 public interface LinphoneCallStats {
        static public class MediaType {
-               static private Vector values = new Vector();
+               static private Vector<MediaType> values = new Vector<MediaType>();
                /**
                 * Audio
                 */
@@ -51,6 +51,51 @@ public interface LinphoneCallStats {
                        return mStringValue;
                }
        }
+       static public class IceState {
+               static private Vector<IceState> values = new Vector<IceState>();
+               /**
+                * Not activated
+                */
+               static public IceState NotActivated = new IceState(0, "Not activated");
+               /**
+                * Failed
+                */
+               static public IceState Failed = new IceState(1, "Failed");
+               /**
+                * In progress
+                */
+               static public IceState InProgress = new IceState(2, "In progress");
+               /**
+                * Host connection
+                */
+               static public IceState HostConnection = new IceState(3, "Host connection");
+               /**
+                * Reflexive connection
+                */
+               static public IceState ReflexiveConnection = new IceState(4, "Reflexive connection");
+               /**
+                * Relay connection
+                */
+               static public IceState RelayConnection = new IceState(5, "Relay connection");
+               protected final int mValue;
+               private final String mStringValue;
+
+               private IceState(int value, String stringValue) {
+                       mValue = value;
+                       values.addElement(this);
+                       mStringValue = stringValue;
+               }
+               public static IceState fromInt(int value) {
+                       for (int i = 0; i < values.size(); i++) {
+                               IceState mstate = (IceState) values.elementAt(i);
+                               if (mstate.mValue == value) return mstate;
+                       }
+                       throw new RuntimeException("IceState not found [" + value + "]");
+               }
+               public String toString() {
+                       return mStringValue;
+               }
+       }
 
        /**
         * Get the stats media type
@@ -59,25 +104,42 @@ public interface LinphoneCallStats {
        public MediaType getMediaType();
 
        /**
-        * Get the sender loss rate since last report
+        * Get the ICE state
+        */
+       public IceState getIceState();
+
+       /**
+        * Get the download bandwidth in kbit/s
+        * @return The download bandwidth
+        */
+       public float getDownloadBandwidth();
+
+       /**
+        * Get the upload bandwidth in kbit/s
+        * @return The upload bandwidth
+        */
+       public float getUploadBandwidth();
+
+       /**
+        * 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();
@@ -99,4 +161,16 @@ public interface LinphoneCallStats {
         * @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();
 }