net.sf.fmj.media.rtp
Class RTPDataStream

java.lang.Object
  extended by net.sf.fmj.media.rtp.RTPDataStream
All Implemented Interfaces:
Control, Controls, PushBufferStream, SourceStream, RTPControl
Direct Known Subclasses:
RTPAudioDataStream, RTPVideoDataStream

public abstract class RTPDataStream
extends java.lang.Object
implements PushBufferStream, RTPControl

A generic RTP Data Stream

Version:
1-1-alpha3
Author:
Andrew G D Rowley

Field Summary
protected  double clockRate
           
protected  java.lang.Object[] controls
           
protected  long firstSequence
           
protected  Format format
           
protected  BufferTransferHandler handler
           
protected  long jitter
           
protected  long lastSequence
           
protected  RTPReceptionStats receptionStats
           
protected  long ssrc
           
protected  int threshold
           
protected  java.util.Timer timer
           
 
Fields inherited from interface javax.media.protocol.SourceStream
LENGTH_UNKNOWN
 
Constructor Summary
RTPDataStream(long ssrc, Format format)
          Creates a new RTPDataStream
 
Method Summary
 void addFormat(Format fmt, int payload)
           
protected abstract  void addPacket(RTPHeader header, byte[] data, int offset, int length)
           
protected  void calculateJitter(long rtpTimestamp)
          Performs jitter calculations
 boolean endOfStream()
           
 ContentDescriptor getContentDescriptor()
           
 long getContentLength()
           
 java.lang.Object getControl(java.lang.String controlType)
           
 java.awt.Component getControlComponent()
           
 java.lang.Object[] getControls()
           
 long getFirstSequence()
          Returns the first sequence number seen
 Format getFormat()
           
 Format getFormat(int payload)
           
 Format[] getFormatList()
           
 GlobalReceptionStats getGlobalStats()
           
 long getJitter()
          Returns the jitter calculation
 long getLastSequence()
          Returns the last sequence number seen
 ReceptionStats getReceptionStats()
           
abstract  void read(Buffer buffer)
           
 void setTransferHandler(BufferTransferHandler transferHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

format

protected Format format

clockRate

protected double clockRate

handler

protected BufferTransferHandler handler

timer

protected final java.util.Timer timer

ssrc

protected long ssrc

threshold

protected int threshold

controls

protected java.lang.Object[] controls

receptionStats

protected RTPReceptionStats receptionStats

jitter

protected long jitter

firstSequence

protected long firstSequence

lastSequence

protected long lastSequence
Constructor Detail

RTPDataStream

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

Parameters:
format - The format of the stream
Method Detail

addPacket

protected abstract void addPacket(RTPHeader header,
                                  byte[] data,
                                  int offset,
                                  int length)

getFormat

public Format getFormat()
Specified by:
getFormat in interface PushBufferStream
Specified by:
getFormat in interface RTPControl

setTransferHandler

public void setTransferHandler(BufferTransferHandler transferHandler)
Specified by:
setTransferHandler in interface PushBufferStream

getContentDescriptor

public ContentDescriptor getContentDescriptor()
Specified by:
getContentDescriptor in interface SourceStream

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface SourceStream

endOfStream

public boolean endOfStream()
Specified by:
endOfStream in interface SourceStream

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls

getControl

public java.lang.Object getControl(java.lang.String controlType)
Specified by:
getControl in interface Controls

read

public abstract void read(Buffer buffer)
                   throws java.io.IOException
Specified by:
read in interface PushBufferStream
Throws:
java.io.IOException

addFormat

public void addFormat(Format fmt,
                      int payload)
Specified by:
addFormat in interface RTPControl

getReceptionStats

public ReceptionStats getReceptionStats()
Specified by:
getReceptionStats in interface RTPControl

getGlobalStats

public GlobalReceptionStats getGlobalStats()
Specified by:
getGlobalStats in interface RTPControl

getFormatList

public Format[] getFormatList()
Specified by:
getFormatList in interface RTPControl

getFormat

public Format getFormat(int payload)
Specified by:
getFormat in interface RTPControl

getControlComponent

public java.awt.Component getControlComponent()
Specified by:
getControlComponent in interface Control

calculateJitter

protected void calculateJitter(long rtpTimestamp)
Performs jitter calculations


getJitter

public long getJitter()
Returns the jitter calculation


getLastSequence

public long getLastSequence()
Returns the last sequence number seen


getFirstSequence

public long getFirstSequence()
Returns the first sequence number seen