net.sf.fmj.media.rtp
Class RTPSendStream

java.lang.Object
  extended by net.sf.fmj.media.rtp.RTPSendStream
All Implemented Interfaces:
BufferTransferHandler, SourceTransferHandler, RTPStream, SendStream

public class RTPSendStream
extends java.lang.Object
implements SendStream, SourceTransferHandler, BufferTransferHandler

Represnts an RTP sending stream

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

Constructor Summary
RTPSendStream(long ssrc, DataSource dataSource, OutputDataStream rtpDataStream, int index, RTPLocalParticipant participant, int format, double clockRate, RTPSessionMgr rtpMgr)
          Creates a new RTPSendStream
 
Method Summary
 void addSourceDescription(SourceDescription sdes)
          Adds a source description to this send stream
 void close()
          Closes this RTP stream.
 double getClockRate()
          Returns the clockRate used for sampling.
 DataSource getDataSource()
          Returns the source sending data to this stream.
 long getInitialSendTime()
          Returns the last time a packet was sent.
 long getInitialTimestamp()
          Returns the initial timestamp base.
 long getLastSendTime()
          Returns the last time a packet was sent.
 long getLastTimestamp()
          Returns the last timestamp of a packet sent.
 Participant getParticipant()
          Returns the participant associated with this RTP stream.
 int getSdesSize()
          Returns the number of bytes of sdes that this participant requires
 SenderReport getSenderReport()
          Returns the last RTCP SR.
 java.util.Vector getSourceDescription()
          Returns the source description for this source
 TransmissionStats getSourceTransmissionStats()
          Returns the datasource transmission stats.
 long getSSRC()
          Returns the SSRC used in this stream.
 int setBitRate(int bitRate)
          Set the birate of this stream's samples.
 void setSourceDescription(SourceDescription[] sourceDesc)
          Add an RTP Source Description (SDES) refering to this stream.
 void start()
          Starts this RTP stream.
 void stop()
          Stops this RTP stream.
 void transferData(PushBufferStream stream)
          Method used to transfer data to the RTP stream.
 void transferData(PushSourceStream stream)
          Method used to transfer data to the RTP stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTPSendStream

public RTPSendStream(long ssrc,
                     DataSource dataSource,
                     OutputDataStream rtpDataStream,
                     int index,
                     RTPLocalParticipant participant,
                     int format,
                     double clockRate,
                     RTPSessionMgr rtpMgr)
Creates a new RTPSendStream

Parameters:
index - the index of the stream in the datasource's stream table
participant - the participant at the other end of this stream
format - the format used in this stream
clockRate - the encoding clockrate
rtpMgr - the RTP session manager
ssrc - The ssrc of the stream
dataSource - The datasource of the stream
rtpDataStream - The rtp output
Method Detail

addSourceDescription

public void addSourceDescription(SourceDescription sdes)
Adds a source description to this send stream

Parameters:
sdes - The description to add

setSourceDescription

public void setSourceDescription(SourceDescription[] sourceDesc)
Add an RTP Source Description (SDES) refering to this stream.

Specified by:
setSourceDescription in interface SendStream
Parameters:
sourceDesc - an RTP Source Description (SDES) refering to this stream

close

public void close()
Closes this RTP stream.

Specified by:
close in interface SendStream

stop

public void stop()
          throws java.io.IOException
Stops this RTP stream.

Specified by:
stop in interface SendStream
Throws:
java.io.IOException - I/O Exception

start

public void start()
           throws java.io.IOException
Starts this RTP stream.

Specified by:
start in interface SendStream
Throws:
java.io.IOException - I/O Exception

setBitRate

public int setBitRate(int bitRate)
Set the birate of this stream's samples. DUMMY.

Specified by:
setBitRate in interface SendStream
Parameters:
bitRate - the bitrate used
Returns:
-1

getSourceTransmissionStats

public TransmissionStats getSourceTransmissionStats()
Returns the datasource transmission stats.

Specified by:
getSourceTransmissionStats in interface SendStream
Returns:
the datasource transmission stats

getParticipant

public Participant getParticipant()
Returns the participant associated with this RTP stream.

Specified by:
getParticipant in interface RTPStream
Returns:
the participant associated with this RTP stream

getSenderReport

public SenderReport getSenderReport()
Returns the last RTCP SR. DUMMY.

Specified by:
getSenderReport in interface RTPStream
Returns:
null

getSSRC

public long getSSRC()
Returns the SSRC used in this stream.

Specified by:
getSSRC in interface RTPStream
Returns:
the SSRC of this stream

getDataSource

public DataSource getDataSource()
Returns the source sending data to this stream.

Specified by:
getDataSource in interface RTPStream
Returns:
the source sending data to this stream

transferData

public void transferData(PushSourceStream stream)
Method used to transfer data to the RTP stream.

Specified by:
transferData in interface SourceTransferHandler
Parameters:
stream - stream used to read data from

transferData

public void transferData(PushBufferStream stream)
Method used to transfer data to the RTP stream.

Specified by:
transferData in interface BufferTransferHandler
Parameters:
stream - stream to read data from

getSourceDescription

public java.util.Vector getSourceDescription()
Returns the source description for this source

Returns:
The source description objects

getSdesSize

public int getSdesSize()
Returns the number of bytes of sdes that this participant requires

Returns:
the number of bytes of sdes that this participant requires

getLastSendTime

public long getLastSendTime()
Returns the last time a packet was sent.

Returns:
the last time a packet was sent

getInitialSendTime

public long getInitialSendTime()
Returns the last time a packet was sent.

Returns:
the last time a packet was sent

getLastTimestamp

public long getLastTimestamp()
Returns the last timestamp of a packet sent.

Returns:
the last timestamp of a packet sent

getInitialTimestamp

public long getInitialTimestamp()
Returns the initial timestamp base.

Returns:
the initial timestamp base

getClockRate

public double getClockRate()
Returns the clockRate used for sampling.

Returns:
the clockRate used by this stream