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;
24 private float senderLossRate;
25 private float receiverLossRate;
26 private float senderInterarrivalJitter;
27 private float receiverInterarrivalJitter;
28 private float roundTripDelay;
29 private long latePacketsCumulativeNumber;
30 private float jitterBufferSize;
32 private native int getMediaType(long nativeStatsPtr);
33 private native float getSenderLossRate(long nativeStatsPtr);
34 private native float getReceiverLossRate(long nativeStatsPtr);
35 private native float getSenderInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
36 private native float getReceiverInterarrivalJitter(long nativeStatsPtr, long nativeCallPtr);
37 private native float getRoundTripDelay(long nativeStatsPtr);
38 private native long getLatePacketsCumulativeNumber(long nativeStatsPtr, long nativeCallPtr);
39 private native float getJitterBufferSize(long nativeStatsPtr);
41 protected LinphoneCallStatsImpl(long nativeCallPtr, long nativeStatsPtr) {
42 mediaType = getMediaType(nativeStatsPtr);
43 senderLossRate = getSenderLossRate(nativeStatsPtr);
44 receiverLossRate = getReceiverLossRate(nativeStatsPtr);
45 senderInterarrivalJitter = getSenderInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
46 receiverInterarrivalJitter = getReceiverInterarrivalJitter(nativeStatsPtr, nativeCallPtr);
47 roundTripDelay = getRoundTripDelay(nativeStatsPtr);
48 latePacketsCumulativeNumber = getLatePacketsCumulativeNumber(nativeStatsPtr, nativeCallPtr);
49 jitterBufferSize = getJitterBufferSize(nativeStatsPtr);
52 public MediaType getMediaType() {
53 return MediaType.fromInt(mediaType);
56 public float getSenderLossRate() {
57 return senderLossRate;
60 public float getReceiverLossRate() {
61 return receiverLossRate;
64 public float getSenderInterarrivalJitter() {
65 return senderInterarrivalJitter;
68 public float getReceiverInterarrivalJitter() {
69 return receiverInterarrivalJitter;
72 public float getRoundTripDelay() {
73 return roundTripDelay;
76 public long getLatePacketsCumulativeNumber() {
77 return latePacketsCumulativeNumber;
80 public float getJitterBufferSize() {
81 return jitterBufferSize;