src/jlibrtp/RTCPAppIntf.java
author Da Risk <darisk972@gmail.com>
Tue, 14 Apr 2009 16:56:20 +0200
changeset 105 c6e4728ac9f7
parent 13 e684f11070d5
permissions -rw-r--r--
Passage sous cupcake :) Peu de modification de code, il faut juste creer des fichier aidl pour les classes parcelables. Sinon les fichier de build.xml ont ete completement modifiés, j'ai remplacé par les nouveaux. (il doit y avoir un manque de precision dans le fichier build.properties)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     1
/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     2
 * Java RTP Library (jlibrtp)
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     3
 * Copyright (C) 2006 Arne Kepp
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     4
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     5
 * This library is free software; you can redistribute it and/or
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     6
 * modify it under the terms of the GNU Lesser General Public
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     7
 * License as published by the Free Software Foundation; either
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     8
 * version 2.1 of the License, or (at your option) any later version.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
     9
 *
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    10
 * This library is distributed in the hope that it will be useful,
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    13
 * Lesser General Public License for more details.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    14
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    15
 * You should have received a copy of the GNU Lesser General Public
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    16
 * License along with this library; if not, write to the Free Software
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    18
 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    19
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    20
package jlibrtp;
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    21
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    22
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    23
/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    24
 * This is the callback interface for RTCP packets.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    25
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    26
 * It is optional, you do not have to register it.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    27
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    28
 * If there are specific events you wish to ignore,
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    29
 * you can simply implement empty functions.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    30
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    31
 * These are all syncrhonous, make sure to return quickly
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    32
 * or do the handling in a new thread.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    33
 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    34
 * @author Arne Kepp
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    35
 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    36
public interface RTCPAppIntf {
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    37
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    38
	/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    39
	 * This function is called whenever a Sender Report (SR) packet is received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    40
	 * and returns unmodified values.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    41
	 *  
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    42
	 * A sender report may optionally include Receiver Reports (RR), 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    43
	 * which are returned as arrays. Index i corresponds to the same report
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    44
	 * throughout all of the arrays.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    45
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    46
	 * @param ssrc the (SR) SSRC of the sender
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    47
	 * @param ntpHighOrder (SR) NTP high order
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    48
	 * @param ntpLowOrder (SR) NTP low order
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    49
	 * @param rtpTimestamp (SR) RTP timestamp corresponding to the NTP timestamp
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    50
	 * @param packetCount (SR) Packets sent since start of session
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    51
	 * @param octetCount (SR) Octets sent since start of session
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    52
	 * @param reporteeSsrc (RR) SSRC of sender the receiver is reporting in
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    53
	 * @param lossFraction (RR) Loss fraction, see RFC 3550
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    54
	 * @param cumulPacketsLost (RR) Cumulative number of packets lost
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    55
	 * @param extHighSeq (RR) Extended highest sequence RTP packet received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    56
	 * @param interArrivalJitter (RR) Interarrival jitter, see RFC 3550
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    57
	 * @param lastSRTimeStamp (RR) RTP timestamp when last SR was received 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    58
	 * @param delayLastSR (RR) Delay, in RTP, since last SR was received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    59
	 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    60
	public void SRPktReceived(long ssrc, long ntpHighOrder, long ntpLowOrder, 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    61
			long rtpTimestamp, long packetCount, long octetCount,
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    62
			// Get the receiver reports, if any
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    63
			long[] reporteeSsrc, int[] lossFraction, int[] cumulPacketsLost, long[] extHighSeq, 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    64
			long[] interArrivalJitter, long[] lastSRTimeStamp, long[] delayLastSR);
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    65
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    66
	/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    67
	 * This function is called whenever a Receiver Report (SR) packet is received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    68
	 * and returns unmodified values.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    69
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    70
	 * A receiver report may optionally include report blocks, 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    71
	 * which are returned as arrays. Index i corresponds to the same report
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    72
	 * throughout all of the arrays.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    73
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    74
	 * @param reporterSsrc SSRC of the receiver reporting
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    75
	 * @param reporteeSsrc (RR) SSRC of sender the receiver is reporting in
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    76
	 * @param lossFraction (RR) Loss fraction, see RFC 3550
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    77
	 * @param cumulPacketsLost (RR) Cumulative number of packets lost
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    78
	 * @param extHighSeq (RR) Extended highest sequence RTP packet received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    79
	 * @param interArrivalJitter (RR) Interarrival jitter, see RFC 3550
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    80
	 * @param lastSRTimeStamp (RR) RTP timestamp when last SR was received 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    81
	 * @param delayLastSR (RR) Delay, in RTP, since last SR was received
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    82
	 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    83
	public void RRPktReceived(long reporterSsrc, long[] reporteeSsrc, 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    84
			int[] lossFraction, int[] cumulPacketsLost, long[] extHighSeq, 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    85
			long[] interArrivalJitter, long[] lastSRTimeStamp, long[] delayLastSR);
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    86
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    87
	/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    88
	 * This function is called whenever a Source Description (SDES) packet is received.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    89
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    90
	 * It currently returns the updated participants AFTER they have been updated.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    91
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    92
	 * @param relevantParticipants participants mentioned in the SDES packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    93
	 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    94
	public void SDESPktReceived(Participant[] relevantParticipants);
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    95
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    96
	/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    97
	 * This function is called whenever a Bye (BYE) packet is received.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    98
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
    99
	 * The participants will automatically be deleted from the participant
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   100
	 * database after some time, but in the mean time the application may 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   101
	 * still receive RTP  packets from this source.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   102
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   103
	 * @param relevantParticipants participants whose SSRC was in the packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   104
	 * @param reason the reason provided in the packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   105
	 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   106
	public void BYEPktReceived(Participant[] relevantParticipants, String reason);
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   107
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   108
	
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   109
	/**
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   110
	 * This function is called whenever an Application (APP) packet is received.
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   111
	 * 
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   112
	 * @param part the participant associated with the SSRC
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   113
	 * @param subtype specified in the packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   114
	 * @param name ASCII description of packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   115
	 * @param data in the packet
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   116
	 */
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   117
	public void APPPktReceived(Participant part, int subtype, byte[] name, byte[] data);
e684f11070d5 ajout de jlibrtp
nikita@nikita-rack
parents:
diff changeset
   118
}