src/jlibrtp/RTCPAppIntf.java
changeset 823 2036ebfaccda
equal deleted inserted replaced
536:537ddd8aa407 823:2036ebfaccda
       
     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  * This is the callback interface for RTCP packets.
       
    24  * 
       
    25  * It is optional, you do not have to register it.
       
    26  * 
       
    27  * If there are specific events you wish to ignore, you can simply implement
       
    28  * empty functions.
       
    29  * 
       
    30  * These are all syncrhonous, make sure to return quickly or do the handling in
       
    31  * a new thread.
       
    32  * 
       
    33  * @author Arne Kepp
       
    34  */
       
    35 public interface RTCPAppIntf {
       
    36 
       
    37 	/**
       
    38 	 * This function is called whenever a Sender Report (SR) packet is received
       
    39 	 * and returns unmodified values.
       
    40 	 * 
       
    41 	 * A sender report may optionally include Receiver Reports (RR), which are
       
    42 	 * returned as arrays. Index i corresponds to the same report throughout all
       
    43 	 * of the arrays.
       
    44 	 * 
       
    45 	 * @param ssrc
       
    46 	 *            the (SR) SSRC of the sender
       
    47 	 * @param ntpHighOrder
       
    48 	 *            (SR) NTP high order
       
    49 	 * @param ntpLowOrder
       
    50 	 *            (SR) NTP low order
       
    51 	 * @param rtpTimestamp
       
    52 	 *            (SR) RTP timestamp corresponding to the NTP timestamp
       
    53 	 * @param packetCount
       
    54 	 *            (SR) Packets sent since start of session
       
    55 	 * @param octetCount
       
    56 	 *            (SR) Octets sent since start of session
       
    57 	 * @param reporteeSsrc
       
    58 	 *            (RR) SSRC of sender the receiver is reporting in
       
    59 	 * @param lossFraction
       
    60 	 *            (RR) Loss fraction, see RFC 3550
       
    61 	 * @param cumulPacketsLost
       
    62 	 *            (RR) Cumulative number of packets lost
       
    63 	 * @param extHighSeq
       
    64 	 *            (RR) Extended highest sequence RTP packet received
       
    65 	 * @param interArrivalJitter
       
    66 	 *            (RR) Interarrival jitter, see RFC 3550
       
    67 	 * @param lastSRTimeStamp
       
    68 	 *            (RR) RTP timestamp when last SR was received
       
    69 	 * @param delayLastSR
       
    70 	 *            (RR) Delay, in RTP, since last SR was received
       
    71 	 */
       
    72 	public void SRPktReceived(long ssrc, long ntpHighOrder, long ntpLowOrder,
       
    73 			long rtpTimestamp, long packetCount,
       
    74 			long octetCount,
       
    75 			// Get the receiver reports, if any
       
    76 			long[] reporteeSsrc, int[] lossFraction, int[] cumulPacketsLost,
       
    77 			long[] extHighSeq, long[] interArrivalJitter,
       
    78 			long[] lastSRTimeStamp, long[] delayLastSR);
       
    79 
       
    80 	/**
       
    81 	 * This function is called whenever a Receiver Report (SR) packet is
       
    82 	 * received and returns unmodified values.
       
    83 	 * 
       
    84 	 * A receiver report may optionally include report blocks, which are
       
    85 	 * returned as arrays. Index i corresponds to the same report throughout all
       
    86 	 * of the arrays.
       
    87 	 * 
       
    88 	 * @param reporterSsrc
       
    89 	 *            SSRC of the receiver reporting
       
    90 	 * @param reporteeSsrc
       
    91 	 *            (RR) SSRC of sender the receiver is reporting in
       
    92 	 * @param lossFraction
       
    93 	 *            (RR) Loss fraction, see RFC 3550
       
    94 	 * @param cumulPacketsLost
       
    95 	 *            (RR) Cumulative number of packets lost
       
    96 	 * @param extHighSeq
       
    97 	 *            (RR) Extended highest sequence RTP packet received
       
    98 	 * @param interArrivalJitter
       
    99 	 *            (RR) Interarrival jitter, see RFC 3550
       
   100 	 * @param lastSRTimeStamp
       
   101 	 *            (RR) RTP timestamp when last SR was received
       
   102 	 * @param delayLastSR
       
   103 	 *            (RR) Delay, in RTP, since last SR was received
       
   104 	 */
       
   105 	public void RRPktReceived(long reporterSsrc, long[] reporteeSsrc,
       
   106 			int[] lossFraction, int[] cumulPacketsLost, long[] extHighSeq,
       
   107 			long[] interArrivalJitter, long[] lastSRTimeStamp,
       
   108 			long[] delayLastSR);
       
   109 
       
   110 	/**
       
   111 	 * This function is called whenever a Source Description (SDES) packet is
       
   112 	 * received.
       
   113 	 * 
       
   114 	 * It currently returns the updated participants AFTER they have been
       
   115 	 * updated.
       
   116 	 * 
       
   117 	 * @param relevantParticipants
       
   118 	 *            participants mentioned in the SDES packet
       
   119 	 */
       
   120 	public void SDESPktReceived(Participant[] relevantParticipants);
       
   121 
       
   122 	/**
       
   123 	 * This function is called whenever a Bye (BYE) packet is received.
       
   124 	 * 
       
   125 	 * The participants will automatically be deleted from the participant
       
   126 	 * database after some time, but in the mean time the application may still
       
   127 	 * receive RTP packets from this source.
       
   128 	 * 
       
   129 	 * @param relevantParticipants
       
   130 	 *            participants whose SSRC was in the packet
       
   131 	 * @param reason
       
   132 	 *            the reason provided in the packet
       
   133 	 */
       
   134 	public void BYEPktReceived(Participant[] relevantParticipants, String reason);
       
   135 
       
   136 	/**
       
   137 	 * This function is called whenever an Application (APP) packet is received.
       
   138 	 * 
       
   139 	 * @param part
       
   140 	 *            the participant associated with the SSRC
       
   141 	 * @param subtype
       
   142 	 *            specified in the packet
       
   143 	 * @param name
       
   144 	 *            ASCII description of packet
       
   145 	 * @param data
       
   146 	 *            in the packet
       
   147 	 */
       
   148 	public void APPPktReceived(Participant part, int subtype, byte[] name,
       
   149 			byte[] data);
       
   150 }