jlibrtpDemos
Class SoundReceiverDemo
java.lang.Object
jlibrtpDemos.SoundReceiverDemo
- All Implemented Interfaces:
- RTPAppIntf
public class SoundReceiverDemo
- extends java.lang.Object
- implements RTPAppIntf
- Author:
- Arne Kepp
Method Summary |
void |
doStuff()
|
int |
frameSize(int payloadType)
The callback method through which the application can specify
the number of packets that make up a frame for a given payload type. |
static void |
main(java.lang.String[] args)
|
void |
receiveData(DataFrame frame,
Participant p)
The callback method through which the application will receive
data from jlibrtp. |
void |
userEvent(int type,
Participant[] participant)
The callback method through which the application will receive
notifications about user updates, additions and byes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rtpSession
RTPSession rtpSession
curPosition
private SoundReceiverDemo.Position curPosition
abData
byte[] abData
nBytesRead
int nBytesRead
pktCount
int pktCount
dataCount
int dataCount
offsetCount
int offsetCount
auline
javax.sound.sampled.SourceDataLine auline
SoundReceiverDemo
public SoundReceiverDemo(int rtpPort,
int rtcpPort)
receiveData
public void receiveData(DataFrame frame,
Participant p)
- Description copied from interface:
RTPAppIntf
- The callback method through which the application will receive
data from jlibrtp. These calls are synchronous, so you will not
receive any new packets until this call returns.
- Specified by:
receiveData
in interface RTPAppIntf
- Parameters:
frame
- the frame containing the datap
- the participant from which the data came
userEvent
public void userEvent(int type,
Participant[] participant)
- Description copied from interface:
RTPAppIntf
- The callback method through which the application will receive
notifications about user updates, additions and byes.
Types:
1 - Bye
2 - New through RTP, check .getRtpSendSock()
3 - New through RTCP, check .getRtcpSendSock()
4 - SDES packet received, check the getCname() etc methods
5 - Matched SSRC to ip-address provided by application
- Specified by:
userEvent
in interface RTPAppIntf
- Parameters:
type
- the type of eventparticipant
- the participants in question
frameSize
public int frameSize(int payloadType)
- Description copied from interface:
RTPAppIntf
- The callback method through which the application can specify
the number of packets that make up a frame for a given payload type.
A negative value denotes frames of variable length, so jlibrtp
will return whatever it has at the time.
In most applications, this function can simply return 1.
This should be implemented as something fast, such as an
integer array with the indeces being the payload type.
- Specified by:
frameSize
in interface RTPAppIntf
- Parameters:
payloadType
- the payload type specified in the RTP packet
- Returns:
- the number of packets that make up a frame
main
public static void main(java.lang.String[] args)
- Parameters:
args
-
doStuff
public void doStuff()