2 LinPhoneCallStatsImpl.java
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;
22 class LinphoneCallStatsImpl implements LinphoneCallStats {
23 private int mediaType;
25 private float downloadBandwidth;
26 private float uploadBandwidth;
27 private float senderLossRate;
28 private float receiverLossRate;
29 private float senderInterarrivalJitter;
30 private float receiverInterarrivalJitter;
31 private float roundTripDelay;
32 private long latePacketsCumulativeNumber;
33 private float jitterBufferSize;
35 private native int getMediaType(long nativeStatsPtr);
36 private native int getIceState(long nativeStatsPtr);
37 private native float getDownloadBandwidth(long nativeStatsPtr);
38 private native float getUploadBandwidth(long nativeStatsPtr);
39 private native float getSenderLossRate(long nativeStatsPtr);
40 private native float getReceiverLossRate(long nativeStatsPtr);
41 private native float getSenderInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
42 private native float getReceiverInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
43 private native float getRoundTripDelay(long nativeStatsPtr);
44 private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr);
45 private native float getJitterBufferSize(long nativeStatsPtr);
47 protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) {
48 mediaType = getMediaType(nativeStatsPtr);
49 iceState = getIceState(nativeStatsPtr);
50 downloadBandwidth = getDownloadBandwidth(nativeStatsPtr);
51 uploadBandwidth = getUploadBandwidth(nativeStatsPtr);
52 senderLossRate = getSenderLossRate(nativeStatsPtr);
53 receiverLossRate = getReceiverLossRate(nativeStatsPtr);
54 senderInterarrivalJitter = getSenderInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
55 receiverInterarrivalJitter = getReceiverInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
56 roundTripDelay = getRoundTripDelay(nativeStatsPtr);
57 latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr);
58 jitterBufferSize = getJitterBufferSize(nativeStatsPtr);
61 public MediaType getMediaType() {
62 return MediaType.fromInt(mediaType);
65 public IceState getIceState() {
66 return IceState.fromInt(iceState);
69 public float getDownloadBandwidth() {
70 return downloadBandwidth;
73 public float getUploadBandwidth() {
74 return uploadBandwidth;
77 public float getSenderLossRate() {
78 return senderLossRate;
81 public float getReceiverLossRate() {
82 return receiverLossRate;
85 public float getSenderInterarrivalJitter() {
86 return senderInterarrivalJitter;
89 public float getReceiverInterarrivalJitter() {
90 return receiverInterarrivalJitter;
93 public float getRoundTripDelay() {
94 return roundTripDelay;
97 public long getLatePacketsCumulativeNumber() {
98 return latePacketsCumulativeNumber;
101 public float getJitterBufferSize() {
102 return jitterBufferSize;