SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media
Class RTPConnectorImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.media.RTPConnectorImpl
All Implemented Interfaces:
javax.media.rtp.RTPConnector
Direct Known Subclasses:
TransformConnector

public class RTPConnectorImpl
extends Object
implements javax.media.rtp.RTPConnector

Author:
Bing SU (nova.su@gmail.com), Lubomir Marinov

Field Summary
protected  DatagramSocket controlSocket
          UDP Socket we used to send and receive RTCP packets.
protected  DatagramSocket dataSocket
          UDP Socket we used to send and receive RTP packets.
 
Constructor Summary
RTPConnectorImpl(javax.media.rtp.SessionAddress localAddr)
          Initializes a new RTPConnectorImpl on a specific local RTP session address.
 
Method Summary
 void addTarget(javax.media.rtp.SessionAddress target)
          Add a stream target.
 void close()
           
protected  RTPConnectorInputStream createControlInputStream()
          Creates the RTCP packet input stream to be used by RTPManager.
protected  RTPConnectorOutputStream createControlOutputStream()
          Creates the RTCP packet output stream to be used by RTPManager.
protected  RTPConnectorInputStream createDataInputStream()
          Creates the RTP packet input stream to be used by RTPManager.
protected  RTPConnectorOutputStream createDataOutputStream()
          Creates the RTP packet output stream to be used by RTPManager.
 RTPConnectorInputStream getControlInputStream()
           
 RTPConnectorOutputStream getControlOutputStream()
           
 RTPConnectorInputStream getDataInputStream()
           
 RTPConnectorOutputStream getDataOutputStream()
           
 int getReceiveBufferSize()
           
 double getRTCPBandwidthFraction()
           
 double getRTCPSenderBandwidthFraction()
           
 int getSendBufferSize()
           
 void removeTarget(javax.media.rtp.SessionAddress target)
          Removes a target from our session.
 void removeTargets()
          Remove all stream targets.
 void setReceiveBufferSize(int size)
           
 void setSendBufferSize(int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controlSocket

protected final DatagramSocket controlSocket
UDP Socket we used to send and receive RTCP packets.


dataSocket

protected final DatagramSocket dataSocket
UDP Socket we used to send and receive RTP packets.

Constructor Detail

RTPConnectorImpl

public RTPConnectorImpl(javax.media.rtp.SessionAddress localAddr)
                 throws javax.media.rtp.InvalidSessionAddressException
Initializes a new RTPConnectorImpl on a specific local RTP session address.

Parameters:
localAddr - the local listen address of the new RTP session
Throws:
javax.media.rtp.InvalidSessionAddressException - if the specified local RTP session address is invalid
Method Detail

addTarget

public void addTarget(javax.media.rtp.SessionAddress target)
               throws IOException
Add a stream target. A stream target is the destination address which this RTP session will send its data to. For a single session, we can add multiple SessionAddresses, and for each address, one copy of data will be sent to.

Parameters:
target - Destination target address
Throws:
IOException - if there was a socket-related error while adding the specified target

close

public void close()
Specified by:
close in interface javax.media.rtp.RTPConnector

createControlInputStream

protected RTPConnectorInputStream createControlInputStream()
                                                    throws IOException
Creates the RTCP packet input stream to be used by RTPManager.

Returns:
a new RTCP packet input stream to be used by RTPManager
Throws:
IOException - if an error occurs during the creation of the RTCP packet input stream

createControlOutputStream

protected RTPConnectorOutputStream createControlOutputStream()
                                                      throws IOException
Creates the RTCP packet output stream to be used by RTPManager.

Returns:
a new RTCP packet output stream to be used by RTPManager
Throws:
IOException - if an error occurs during the creation of the RTCP packet output stream

createDataInputStream

protected RTPConnectorInputStream createDataInputStream()
                                                 throws IOException
Creates the RTP packet input stream to be used by RTPManager.

Returns:
a new RTP packet input stream to be used by RTPManager
Throws:
IOException - if an error occurs during the creation of the RTP packet input stream

createDataOutputStream

protected RTPConnectorOutputStream createDataOutputStream()
                                                   throws IOException
Creates the RTP packet output stream to be used by RTPManager.

Returns:
a new RTP packet output stream to be used by RTPManager
Throws:
IOException - if an error occurs during the creation of the RTP packet output stream

getControlInputStream

public RTPConnectorInputStream getControlInputStream()
                                              throws IOException
Specified by:
getControlInputStream in interface javax.media.rtp.RTPConnector
Throws:
IOException

getControlOutputStream

public RTPConnectorOutputStream getControlOutputStream()
                                                throws IOException
Specified by:
getControlOutputStream in interface javax.media.rtp.RTPConnector
Throws:
IOException

getDataInputStream

public RTPConnectorInputStream getDataInputStream()
                                           throws IOException
Specified by:
getDataInputStream in interface javax.media.rtp.RTPConnector
Throws:
IOException

getDataOutputStream

public RTPConnectorOutputStream getDataOutputStream()
                                             throws IOException
Specified by:
getDataOutputStream in interface javax.media.rtp.RTPConnector
Throws:
IOException

getReceiveBufferSize

public int getReceiveBufferSize()
Specified by:
getReceiveBufferSize in interface javax.media.rtp.RTPConnector

getRTCPBandwidthFraction

public double getRTCPBandwidthFraction()
Specified by:
getRTCPBandwidthFraction in interface javax.media.rtp.RTPConnector

getRTCPSenderBandwidthFraction

public double getRTCPSenderBandwidthFraction()
Specified by:
getRTCPSenderBandwidthFraction in interface javax.media.rtp.RTPConnector

getSendBufferSize

public int getSendBufferSize()
Specified by:
getSendBufferSize in interface javax.media.rtp.RTPConnector

removeTarget

public void removeTarget(javax.media.rtp.SessionAddress target)
Removes a target from our session. If a target is removed, there will be no data sent to that address.

Parameters:
target - Destination target to be removed

removeTargets

public void removeTargets()
Remove all stream targets. After this operation is done. There will be no targets receiving data, so no data will be sent.


setReceiveBufferSize

public void setReceiveBufferSize(int size)
                          throws IOException
Specified by:
setReceiveBufferSize in interface javax.media.rtp.RTPConnector
Throws:
IOException

setSendBufferSize

public void setSendBufferSize(int size)
                       throws IOException
Specified by:
setSendBufferSize in interface javax.media.rtp.RTPConnector
Throws:
IOException

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.