net.sf.fmj.media.rtp
Class RTPDataSource

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PushBufferDataSource
          extended by net.sf.fmj.media.rtp.RTPDataSource
All Implemented Interfaces:
Controls, Duration

public class RTPDataSource
extends PushBufferDataSource

Represents an RTP Data Source

Version:
1-1-alpha3
Author:
Andrew G D Rowley, Christian Vincenot

Field Summary
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
RTPDataSource(long ssrc, Format format)
          Creates a new RTPDataSource
 
Method Summary
 void connect()
          Connect the datasource
 void disconnect()
          Disconnect the datasource
 java.lang.String getContentType()
          Returns the content type of this datasource.
 java.lang.Object getControl(java.lang.String arg0)
          Returns the control associated with the supplied content-type of this datasource's stream.
 java.lang.Object[] getControls()
          Returns all the controls of this datasource's stream.
 Time getDuration()
          Returns the duration of this datasource.
 long getJitter()
          Returns this datasource's current jitter value.
 ReceptionStats getSourceReceptionStats()
          Returns the reception statistics of the source.
 PushBufferStream[] getStreams()
          Returns the stream associated with this datasource.
 void handleRTPPacket(RTPHeader header, byte[] data, int offset, int length)
          Handles an RTP data packet
 void start()
          Start using this datasource.
 void stop()
          Stop using this datasource.
 
Methods inherited from class javax.media.protocol.DataSource
getLocator, initCheck, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPDataSource

public RTPDataSource(long ssrc,
                     Format format)
Creates a new RTPDataSource

Parameters:
ssrc - the SSRC of this datasource
format - The format of the data
Method Detail

getStreams

public PushBufferStream[] getStreams()
Returns the stream associated with this datasource.

Specified by:
getStreams in class PushBufferDataSource
Returns:
the stream associated with this datasource

getContentType

public java.lang.String getContentType()
Returns the content type of this datasource.

Specified by:
getContentType in class DataSource
Returns:
the content type of this datasource ("raw" if connected, null else)

connect

public void connect()
Connect the datasource

Specified by:
connect in class DataSource

disconnect

public void disconnect()
Disconnect the datasource

Specified by:
disconnect in class DataSource

start

public void start()
Start using this datasource. The data will start being sent after this call.

Specified by:
start in class DataSource

stop

public void stop()
Stop using this datasource. The data won't be sent anymore after this call.

Specified by:
stop in class DataSource

getControl

public java.lang.Object getControl(java.lang.String arg0)
Returns the control associated with the supplied content-type of this datasource's stream.

Specified by:
getControl in interface Controls
Specified by:
getControl in class DataSource
Parameters:
arg0 - the content-type
Returns:
the control associated with the supplied content-type of this datasource's stream

getControls

public java.lang.Object[] getControls()
Returns all the controls of this datasource's stream.

Specified by:
getControls in interface Controls
Specified by:
getControls in class DataSource
Returns:
all the controls of this datasource's stream

getDuration

public Time getDuration()
Returns the duration of this datasource. DUMMY

Specified by:
getDuration in interface Duration
Specified by:
getDuration in class DataSource
Returns:
always returns DURATION_UNBOUNDED

handleRTPPacket

public void handleRTPPacket(RTPHeader header,
                            byte[] data,
                            int offset,
                            int length)
Handles an RTP data packet

Parameters:
header - The RTP header
data - The RTP data
offset - The offset in the data
length - The length of the data

getJitter

public long getJitter()
Returns this datasource's current jitter value.

Returns:
this datasource's current jitter value

getSourceReceptionStats

public ReceptionStats getSourceReceptionStats()
Returns the reception statistics of the source.

Returns:
the reception statistics of the source