13
|
1 |
/**
|
|
2 |
* Java RTP Library (jlibrtp)
|
|
3 |
* Copyright (C) 2006 Arne Kepp
|
|
4 |
*
|
|
5 |
* This library is free software; you can redistribute it and/or
|
|
6 |
* modify it under the terms of the GNU Lesser General Public
|
|
7 |
* License as published by the Free Software Foundation; either
|
|
8 |
* version 2.1 of the License, or (at your option) any later version.
|
|
9 |
*
|
|
10 |
* This library 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 GNU
|
|
13 |
* Lesser General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU Lesser General Public
|
|
16 |
* License along with this library; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
|
|
20 |
package jlibrtp;
|
|
21 |
|
|
22 |
|
|
23 |
/**
|
|
24 |
* This is the callback interface for RTCP packets.
|
|
25 |
*
|
|
26 |
* It is optional, you do not have to register it.
|
|
27 |
*
|
|
28 |
* If there are specific events you wish to ignore,
|
|
29 |
* you can simply implement empty functions.
|
|
30 |
*
|
|
31 |
* These are all syncrhonous, make sure to return quickly
|
|
32 |
* or do the handling in a new thread.
|
|
33 |
*
|
|
34 |
* @author Arne Kepp
|
|
35 |
*/
|
|
36 |
public interface RTCPAppIntf {
|
|
37 |
|
|
38 |
/**
|
|
39 |
* This function is called whenever a Sender Report (SR) packet is received
|
|
40 |
* and returns unmodified values.
|
|
41 |
*
|
|
42 |
* A sender report may optionally include Receiver Reports (RR),
|
|
43 |
* which are returned as arrays. Index i corresponds to the same report
|
|
44 |
* throughout all of the arrays.
|
|
45 |
*
|
|
46 |
* @param ssrc the (SR) SSRC of the sender
|
|
47 |
* @param ntpHighOrder (SR) NTP high order
|
|
48 |
* @param ntpLowOrder (SR) NTP low order
|
|
49 |
* @param rtpTimestamp (SR) RTP timestamp corresponding to the NTP timestamp
|
|
50 |
* @param packetCount (SR) Packets sent since start of session
|
|
51 |
* @param octetCount (SR) Octets sent since start of session
|
|
52 |
* @param reporteeSsrc (RR) SSRC of sender the receiver is reporting in
|
|
53 |
* @param lossFraction (RR) Loss fraction, see RFC 3550
|
|
54 |
* @param cumulPacketsLost (RR) Cumulative number of packets lost
|
|
55 |
* @param extHighSeq (RR) Extended highest sequence RTP packet received
|
|
56 |
* @param interArrivalJitter (RR) Interarrival jitter, see RFC 3550
|
|
57 |
* @param lastSRTimeStamp (RR) RTP timestamp when last SR was received
|
|
58 |
* @param delayLastSR (RR) Delay, in RTP, since last SR was received
|
|
59 |
*/
|
|
60 |
public void SRPktReceived(long ssrc, long ntpHighOrder, long ntpLowOrder,
|
|
61 |
long rtpTimestamp, long packetCount, long octetCount,
|
|
62 |
// Get the receiver reports, if any
|
|
63 |
long[] reporteeSsrc, int[] lossFraction, int[] cumulPacketsLost, long[] extHighSeq,
|
|
64 |
long[] interArrivalJitter, long[] lastSRTimeStamp, long[] delayLastSR);
|
|
65 |
|
|
66 |
/**
|
|
67 |
* This function is called whenever a Receiver Report (SR) packet is received
|
|
68 |
* and returns unmodified values.
|
|
69 |
*
|
|
70 |
* A receiver report may optionally include report blocks,
|
|
71 |
* which are returned as arrays. Index i corresponds to the same report
|
|
72 |
* throughout all of the arrays.
|
|
73 |
*
|
|
74 |
* @param reporterSsrc SSRC of the receiver reporting
|
|
75 |
* @param reporteeSsrc (RR) SSRC of sender the receiver is reporting in
|
|
76 |
* @param lossFraction (RR) Loss fraction, see RFC 3550
|
|
77 |
* @param cumulPacketsLost (RR) Cumulative number of packets lost
|
|
78 |
* @param extHighSeq (RR) Extended highest sequence RTP packet received
|
|
79 |
* @param interArrivalJitter (RR) Interarrival jitter, see RFC 3550
|
|
80 |
* @param lastSRTimeStamp (RR) RTP timestamp when last SR was received
|
|
81 |
* @param delayLastSR (RR) Delay, in RTP, since last SR was received
|
|
82 |
*/
|
|
83 |
public void RRPktReceived(long reporterSsrc, long[] reporteeSsrc,
|
|
84 |
int[] lossFraction, int[] cumulPacketsLost, long[] extHighSeq,
|
|
85 |
long[] interArrivalJitter, long[] lastSRTimeStamp, long[] delayLastSR);
|
|
86 |
|
|
87 |
/**
|
|
88 |
* This function is called whenever a Source Description (SDES) packet is received.
|
|
89 |
*
|
|
90 |
* It currently returns the updated participants AFTER they have been updated.
|
|
91 |
*
|
|
92 |
* @param relevantParticipants participants mentioned in the SDES packet
|
|
93 |
*/
|
|
94 |
public void SDESPktReceived(Participant[] relevantParticipants);
|
|
95 |
|
|
96 |
/**
|
|
97 |
* This function is called whenever a Bye (BYE) packet is received.
|
|
98 |
*
|
|
99 |
* The participants will automatically be deleted from the participant
|
|
100 |
* database after some time, but in the mean time the application may
|
|
101 |
* still receive RTP packets from this source.
|
|
102 |
*
|
|
103 |
* @param relevantParticipants participants whose SSRC was in the packet
|
|
104 |
* @param reason the reason provided in the packet
|
|
105 |
*/
|
|
106 |
public void BYEPktReceived(Participant[] relevantParticipants, String reason);
|
|
107 |
|
|
108 |
|
|
109 |
/**
|
|
110 |
* This function is called whenever an Application (APP) packet is received.
|
|
111 |
*
|
|
112 |
* @param part the participant associated with the SSRC
|
|
113 |
* @param subtype specified in the packet
|
|
114 |
* @param name ASCII description of packet
|
|
115 |
* @param data in the packet
|
|
116 |
*/
|
|
117 |
public void APPPktReceived(Participant part, int subtype, byte[] name, byte[] data);
|
|
118 |
} |