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 RTP packets. |
|
24 * |
|
25 * It is mandatory, but you can inore the data if you like. |
|
26 * |
|
27 * @author Arne Kepp |
|
28 */ |
|
29 public interface RTPAppIntf { |
|
30 |
|
31 /** |
|
32 * The callback method through which the application will receive data from |
|
33 * jlibrtp. These calls are synchronous, so you will not receive any new |
|
34 * packets until this call returns. |
|
35 * |
|
36 * @param frame |
|
37 * the frame containing the data |
|
38 * @param participant |
|
39 * the participant from which the data came |
|
40 */ |
|
41 public void receiveData(DataFrame frame, Participant participant); |
|
42 |
|
43 /** |
|
44 * The callback method through which the application will receive |
|
45 * notifications about user updates, additions and byes. Types: 1 - Bye 2 - |
|
46 * New through RTP, check .getRtpSendSock() 3 - New through RTCP, check |
|
47 * .getRtcpSendSock() 4 - SDES packet received, check the getCname() etc |
|
48 * methods 5 - Matched SSRC to ip-address provided by application |
|
49 * |
|
50 * @param type |
|
51 * the type of event |
|
52 * @param participant |
|
53 * the participants in question |
|
54 */ |
|
55 public void userEvent(int type, Participant[] participant); |
|
56 |
|
57 /** |
|
58 * The callback method through which the application can specify the number |
|
59 * of packets that make up a frame for a given payload type. |
|
60 * |
|
61 * A negative value denotes frames of variable length, so jlibrtp will |
|
62 * return whatever it has at the time. |
|
63 * |
|
64 * In most applications, this function can simply return 1. |
|
65 * |
|
66 * This should be implemented as something fast, such as an integer array |
|
67 * with the indeces being the payload type. |
|
68 * |
|
69 * @param payloadType |
|
70 * the payload type specified in the RTP packet |
|
71 * @return the number of packets that make up a frame |
|
72 */ |
|
73 public int frameSize(int payloadType); |
|
74 } |
|