|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.neomedia.RTPConnectorInputStream
public abstract class RTPConnectorInputStream
| Field Summary | |
|---|---|
protected boolean |
closed
Whether this stream is closed. |
protected boolean |
ioError
Caught an IO exception during read from socket |
protected RawPacket |
pkt
The packet data to be read out of this instance through its read(byte[], int, int) method. |
protected Thread |
receiverThread
The Thread receiving packets. |
| Fields inherited from interface javax.media.protocol.SourceStream |
|---|
LENGTH_UNKNOWN |
| Constructor Summary | |
|---|---|
RTPConnectorInputStream()
Initializes a new RTPConnectorInputStream which is to receive packet data from a specific UDP socket. |
|
| Method Summary | |
|---|---|
void |
addDatagramPacketFilter(org.ice4j.socket.DatagramPacketFilter datagramPacketFilter)
Adds a DatagramPacketFilter which allows dropping DatagramPackets before they are converted into RawPackets. |
void |
close()
Close this stream, stops the worker thread. |
protected RawPacket |
createRawPacket(DatagramPacket datagramPacket)
Creates a new RawPacket from a specific DatagramPacket in order to have this instance receive its packet data through its read(byte[], int, int) method. |
protected abstract void |
doLogPacket(DatagramPacket packet)
Log the packet. |
boolean |
endOfStream()
Provides a dummy implementation to endOfStream() that always returns
false. |
javax.media.protocol.ContentDescriptor |
getContentDescriptor()
Provides a dummy implementation to getContentDescriptor() that always returns
null. |
long |
getContentLength()
Provides a dummy implementation to getContentLength() that always returns
LENGTH_UNKNOWN. |
Object |
getControl(String controlType)
Provides a dummy implementation to getControl(String) that always returns
null. |
Object[] |
getControls()
Provides a dummy implementation to getControls() that always returns
EMPTY_CONTROLS. |
org.ice4j.socket.DatagramPacketFilter[] |
getDatagramPacketFilters()
Gets the DatagramPacketFilters which allow dropping DatagramPackets before they are converted into RawPackets. |
int |
getMinimumTransferSize()
Provides a dummy implementation to getMinimumTransferSize() that always returns
2 * 1024. |
int |
read(byte[] buffer,
int offset,
int length)
Copies the content of the most recently received packet into buffer. |
protected abstract void |
receivePacket(DatagramPacket p)
Receive packet. |
void |
run()
Listens for incoming datagrams, stores them for reading by the read method and notifies the local transferHandler that there's data to be read. |
void |
setPriority(int priority)
Changes current thread priority. |
void |
setTransferHandler(javax.media.protocol.SourceTransferHandler transferHandler)
Sets the transferHandler that this connector should be notifying when new data is available for reading. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean closed
protected boolean ioError
protected RawPacket pkt
read(byte[], int, int) method.
protected Thread receiverThread
| Constructor Detail |
|---|
public RTPConnectorInputStream()
| Method Detail |
|---|
public void close()
protected RawPacket createRawPacket(DatagramPacket datagramPacket)
read(byte[], int, int) method. Allows extenders to intercept the
packet data and possibly filter and/or modify it.
datagramPacket - the DatagramPacket containing the packet
data
read(byte[], int, int) methodpublic boolean endOfStream()
endOfStream() that always returns
false.
endOfStream in interface javax.media.protocol.SourceStreampublic javax.media.protocol.ContentDescriptor getContentDescriptor()
getContentDescriptor() that always returns
null.
getContentDescriptor in interface javax.media.protocol.SourceStreampublic long getContentLength()
getContentLength() that always returns
LENGTH_UNKNOWN.
getContentLength in interface javax.media.protocol.SourceStreampublic Object getControl(String controlType)
getControl(String) that always returns
null.
getControl in interface javax.media.ControlscontrolType - ignored.
public Object[] getControls()
getControls() that always returns
EMPTY_CONTROLS.
getControls in interface javax.media.Controlspublic int getMinimumTransferSize()
getMinimumTransferSize() that always returns
2 * 1024.
getMinimumTransferSize in interface javax.media.protocol.PushSourceStream
public int read(byte[] buffer,
int offset,
int length)
throws IOException
read in interface javax.media.protocol.PushSourceStreambuffer - the byte[] that we'd like to copy the content of
the packet to.offset - the position where we are supposed to start writing in
buffer.length - the number of bytes available for writing in
buffer.
IOException - if length is less than the size of the
packet.protected abstract void doLogPacket(DatagramPacket packet)
packet - packet to log
protected abstract void receivePacket(DatagramPacket p)
throws IOException
p - packet for receiving
IOException - if something goes wrong during receivingpublic void run()
run in interface Runnablepublic void setTransferHandler(javax.media.protocol.SourceTransferHandler transferHandler)
setTransferHandler in interface javax.media.protocol.PushSourceStreamtransferHandler - the transferHandler that this connector
should be notifying when new data is available for reading.public void setPriority(int priority)
priority - the new priority.public org.ice4j.socket.DatagramPacketFilter[] getDatagramPacketFilters()
public void addDatagramPacketFilter(org.ice4j.socket.DatagramPacketFilter datagramPacketFilter)
datagramPacketFilter - the DatagramPacketFilter which
allows dropping DatagramPackets before they are converted into
RawPackets
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||