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

net.java.sip.communicator.impl.media.transform
Class TransformConnector

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

public class TransformConnector
extends RTPConnectorImpl

TransformConnector implements the RTPConnector interface. RTPConnector is originally designed for programmers to abstract the underlying transport mechanism for RTP control and data from the RTPManager. However, it provides the possibility to modify / transform the RTP and RTCP packets before they are sent to network, or after the have been received from the network. The RTPConnector interface is very powerful. But just to perform packets transformation, we do not need all the flexibility. So, we designed this TransformConnector, which uses UDP to transfer RTP/RTCP packets just like normal RTP stack, and then provides the TransformInputStream interface for people to define their own transformation. With TransformConnector, people can implement RTP/RTCP packets transformation and/or manipulation by implementing the TransformEngine interface.

Author:
Bing SU (nova.su@gmail.com), Lubomir Marinov
See Also:
TransformEngine, RTPConnector, RTPManager

Field Summary
protected  TransformEngine engine
          The customized TransformEngine object, which contains the concrete transform logic.
 
Fields inherited from class net.java.sip.communicator.impl.media.RTPConnectorImpl
controlSocket, dataSocket
 
Constructor Summary
TransformConnector(javax.media.rtp.SessionAddress localAddr, TransformEngine engine)
          Construct a TransformConnector based on the given local RTP session address and a customized TransformEngine.
 
Method Summary
protected  TransformInputStream createControlInputStream()
          Creates the RTCP packet input stream to be used by RTPManager.
protected  TransformOutputStream createControlOutputStream()
          Creates the RTCP packet output stream to be used by RTPManager.
protected  TransformInputStream createDataInputStream()
          Creates the RTP packet input stream to be used by RTPManager.
protected  TransformOutputStream createDataOutputStream()
          Creates the RTP packet output stream to be used by RTPManager.
 TransformEngine getEngine()
          Getter to use in derived classes.
 
Methods inherited from class net.java.sip.communicator.impl.media.RTPConnectorImpl
addTarget, close, getControlInputStream, getControlOutputStream, getDataInputStream, getDataOutputStream, getReceiveBufferSize, getRTCPBandwidthFraction, getRTCPSenderBandwidthFraction, getSendBufferSize, removeTarget, removeTargets, setReceiveBufferSize, setSendBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

protected final TransformEngine engine
The customized TransformEngine object, which contains the concrete transform logic.

Constructor Detail

TransformConnector

public TransformConnector(javax.media.rtp.SessionAddress localAddr,
                          TransformEngine engine)
                   throws javax.media.rtp.InvalidSessionAddressException
Construct a TransformConnector based on the given local RTP session address and a customized TransformEngine.

Parameters:
localAddr - The local listen address of this RTP session
engine - TransformEngine object which contains your transformation logic
Throws:
javax.media.rtp.InvalidSessionAddressException - if session address is invalid,
Method Detail

createControlInputStream

protected TransformInputStream createControlInputStream()
                                                 throws IOException
Description copied from class: RTPConnectorImpl
Creates the RTCP packet input stream to be used by RTPManager.

Overrides:
createControlInputStream in class RTPConnectorImpl
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 TransformOutputStream createControlOutputStream()
                                                   throws IOException
Description copied from class: RTPConnectorImpl
Creates the RTCP packet output stream to be used by RTPManager.

Overrides:
createControlOutputStream in class RTPConnectorImpl
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 TransformInputStream createDataInputStream()
                                              throws IOException
Description copied from class: RTPConnectorImpl
Creates the RTP packet input stream to be used by RTPManager.

Overrides:
createDataInputStream in class RTPConnectorImpl
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 TransformOutputStream createDataOutputStream()
                                                throws IOException
Description copied from class: RTPConnectorImpl
Creates the RTP packet output stream to be used by RTPManager.

Overrides:
createDataOutputStream in class RTPConnectorImpl
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

getEngine

public TransformEngine getEngine()
Getter to use in derived classes. (Could modify the member variable to protected instead for direct access)

Returns:
the engine

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

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