public abstract class RTPDataStream extends java.lang.Object implements PushBufferStream, RTPControl
Modifier and Type | Field and Description |
---|---|
protected int |
bitsPerSecond |
protected int |
bytesProcessed |
protected double |
clockRate |
protected java.lang.Object[] |
controls |
protected Format |
format |
protected BufferTransferHandler |
handler |
protected RTPBuffer |
itsRTPBuffer |
protected long |
jitter |
protected long |
lastTimestamp |
protected int |
packetSize |
protected RTPReceptionStats |
receptionStats |
protected int |
rtpbufferlen |
protected long |
rtpbufferlenMS |
protected long |
ssrc |
protected long |
threshold |
LENGTH_UNKNOWN
Constructor and Description |
---|
RTPDataStream(long ssrc,
Format format)
Creates a new RTPDataStream
|
Modifier and Type | Method and Description |
---|---|
void |
addFormat(Format fmt,
int payload)
Add the specified format as corresponding to the specified payload.
|
protected abstract void |
addPacket(RTPHeader header,
byte[] data,
int offset,
int length)
Add an RTP packet to this datastream.
|
protected void |
calculateJitter(long rtpTimestamp)
Performs jitter calculations
(Conforming to RFC-3550 6.4.1)
|
boolean |
endOfStream()
Indicates if we're reached the end of stream.
|
ContentDescriptor |
getContentDescriptor()
Returns the content descriptor of this stream.
|
long |
getContentLength()
Returns the content's length.
|
java.lang.Object |
getControl(java.lang.String controlType)
Returns the control specific to this content type.
|
java.awt.Component |
getControlComponent()
Returns the control component.
|
java.lang.Object[] |
getControls()
Returns all the possible controls of this datastream.
|
Format |
getFormat()
Returns the format carried by this datastream.
|
Format |
getFormat(int payload)
Returns the format corresponding to this payload type.
|
Format[] |
getFormatList()
Returns the list of formats supported.
|
GlobalReceptionStats |
getGlobalStats()
Returns the global stats.
|
long |
getJitter()
Returns the current jitter calculated.
|
long |
getJitterBufferItemCount() |
long |
getJitterBufferSize() |
ReceptionStats |
getReceptionStats()
Returns the reception stats.
|
abstract void |
read(Buffer buffer)
Reads the data available into the buffer.
|
void |
setTransferHandler(BufferTransferHandler transferHandler)
Sets the handler responsible for treating the incoming data.
|
protected Format format
protected double clockRate
protected int packetSize
protected BufferTransferHandler handler
protected long ssrc
protected long threshold
protected java.lang.Object[] controls
protected RTPReceptionStats receptionStats
protected long jitter
protected RTPBuffer itsRTPBuffer
protected int rtpbufferlen
protected long rtpbufferlenMS
protected long lastTimestamp
protected int bytesProcessed
protected int bitsPerSecond
public RTPDataStream(long ssrc, Format format)
ssrc
- the SSRC associated with this datastreamformat
- The format of the streamprotected abstract void addPacket(RTPHeader header, byte[] data, int offset, int length)
header
- the RTP headerdata
- the dataoffset
- the offsetlength
- the lengthpublic Format getFormat()
getFormat
in interface PushBufferStream
getFormat
in interface RTPControl
public void setTransferHandler(BufferTransferHandler transferHandler)
setTransferHandler
in interface PushBufferStream
transferHandler
- the object handling the datapublic ContentDescriptor getContentDescriptor()
getContentDescriptor
in interface SourceStream
public long getContentLength()
getContentLength
in interface SourceStream
public boolean endOfStream()
endOfStream
in interface SourceStream
public java.lang.Object[] getControls()
getControls
in interface Controls
public java.lang.Object getControl(java.lang.String controlType)
getControl
in interface Controls
controlType
- the control typepublic abstract void read(Buffer buffer) throws java.io.IOException
read
in interface PushBufferStream
buffer
- the buffer in which to put the read datajava.io.IOException
- I/O Exceptionpublic void addFormat(Format fmt, int payload)
addFormat
in interface RTPControl
fmt
- formatpayload
- payload typepublic ReceptionStats getReceptionStats()
getReceptionStats
in interface RTPControl
public GlobalReceptionStats getGlobalStats()
getGlobalStats
in interface RTPControl
public Format[] getFormatList()
getFormatList
in interface RTPControl
public Format getFormat(int payload)
getFormat
in interface RTPControl
payload
- the payload typepublic java.awt.Component getControlComponent()
getControlComponent
in interface Control
protected void calculateJitter(long rtpTimestamp)
rtpTimestamp
- the RTP timestamp present in the packetpublic long getJitter()
public long getJitterBufferSize()
public long getJitterBufferItemCount()