3 Copyright (C) 2010 Belledonne Communications, Grenoble, France
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package org.linphone.core;
21 import java.util.Vector;
24 public interface LinphoneCallStats {
25 static public class MediaType {
26 static private Vector<MediaType> values = new Vector<MediaType>();
30 static public MediaType Audio = new MediaType(0, "Audio");
34 static public MediaType Video = new MediaType(1, "Video");
35 protected final int mValue;
36 private final String mStringValue;
38 private MediaType(int value, String stringValue) {
40 values.addElement(this);
41 mStringValue = stringValue;
43 public static MediaType fromInt(int value) {
44 for (int i = 0; i < values.size(); i++) {
45 MediaType mtype = (MediaType) values.elementAt(i);
46 if (mtype.mValue == value) return mtype;
48 throw new RuntimeException("MediaType not found [" + value + "]");
50 public String toString() {
54 static public class IceState {
55 static private Vector<IceState> values = new Vector<IceState>();
59 static public IceState NotActivated = new IceState(0, "Not activated");
63 static public IceState Failed = new IceState(1, "Failed");
67 static public IceState InProgress = new IceState(2, "In progress");
71 static public IceState HostConnection = new IceState(3, "Host connection");
73 * Reflexive connection
75 static public IceState ReflexiveConnection = new IceState(4, "Reflexive connection");
79 static public IceState RelayConnection = new IceState(5, "Relay connection");
80 protected final int mValue;
81 private final String mStringValue;
83 private IceState(int value, String stringValue) {
85 values.addElement(this);
86 mStringValue = stringValue;
88 public static IceState fromInt(int value) {
89 for (int i = 0; i < values.size(); i++) {
90 IceState mstate = (IceState) values.elementAt(i);
91 if (mstate.mValue == value) return mstate;
93 throw new RuntimeException("IceState not found [" + value + "]");
95 public String toString() {
101 * Get the stats media type
104 public MediaType getMediaType();
109 public IceState getIceState();
112 * Get the download bandwidth in kbit/s
113 * @return The download bandwidth
115 public float getDownloadBandwidth();
118 * Get the upload bandwidth in kbit/s
119 * @return The upload bandwidth
121 public float getUploadBandwidth();
124 * Get the local loss rate since last report
125 * @return The sender loss rate
127 public float getSenderLossRate();
130 * Get the remote reported loss rate since last report
131 * @return The receiver loss rate
133 public float getReceiverLossRate();
136 * Get the local interarrival jitter
137 * @return The interarrival jitter at last emitted sender report
139 public float getSenderInterarrivalJitter();
142 * Get the remote reported interarrival jitter
143 * @return The interarrival jitter at last received receiver report
145 public float getReceiverInterarrivalJitter();
148 * Get the round trip delay
149 * @return The round trip delay in seconds, -1 if the information is not available
151 public float getRoundTripDelay();
154 * Get the cumulative number of late packets
155 * @return The cumulative number of late packets
157 public long getLatePacketsCumulativeNumber();
160 * Get the jitter buffer size
161 * @return The jitter buffer size in milliseconds
163 public float getJitterBufferSize();
166 * 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.
167 * @return The local loss rate percentage.
169 public float getLocalLossRate();
172 * Get the local late packets rate. The value returned here is updated every second.
173 * @return The local late rate percentage.
175 public float getLocalLateRate();