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

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

java.lang.Object
  extended by net.java.sip.communicator.impl.media.RtpFlowImpl
All Implemented Interfaces:
EventListener, javax.media.ControllerListener, javax.media.rtp.ReceiveStreamListener, javax.media.rtp.SessionListener, RtpFlow

public class RtpFlowImpl
extends Object
implements RtpFlow, javax.media.rtp.ReceiveStreamListener, javax.media.rtp.SessionListener, javax.media.ControllerListener

Implementation of a RtpFlow which is a bridge for data transmission between two end points. Data which transit on this flow are encoded with a specified format.

Author:
Symphorien Wanko, KenLarson

Constructor Summary
RtpFlowImpl(MediaServiceImpl mediaServie, String localIpAddress, String remoteIpAddress, int localPort, int remotePort, Hashtable<String,List<String>> mediaEncoding)
          Creates an instance of RtpFlowImpl for media transmission.
 
Method Summary
 void addMediaListener(MediaListener listener)
          Add a listener to be informed of media events hapening on this flow.
 void controllerUpdate(javax.media.ControllerEvent ce)
          Implements controllerUpdate from javax.media.rtp.ControllerListener
 String getLocalAddress()
          Returns the local address used by this flow.
 int getLocalPort()
          Returns the local port used by this flow.
 String getRemoteAddress()
          Returns the remote address used by this flow.
 int getRemotePort()
          Returns the remote port used by this flow.
 void pause()
          Pause media transmission on this flow
 void resume()
          Resume media transmission on this flow
 void start()
          Implementation of start to send media data.
 void stop()
          Stops the transmission if already started.
 void update(javax.media.rtp.event.ReceiveStreamEvent evt)
          Implements update from javax.media.rtp.ReceiveStreamListener
 void update(javax.media.rtp.event.SessionEvent evt)
          Implements update from javax.media.rtp.SessionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RtpFlowImpl

public RtpFlowImpl(MediaServiceImpl mediaServie,
                   String localIpAddress,
                   String remoteIpAddress,
                   int localPort,
                   int remotePort,
                   Hashtable<String,List<String>> mediaEncoding)
            throws MediaException
Creates an instance of RtpFlowImpl for media transmission. A flow do not care about session or anything other than transmitting media data between two end points, using the given media encoding.

Parameters:
mediaServie - the media service which created us
localIpAddress - local IP address
localPort - local port number
remoteIpAddress - remote IP address
remotePort - remote port number
mediaEncoding - media encoding used for data
Throws:
MediaException - if initializing the flow fails.
Method Detail

getLocalPort

public int getLocalPort()
Returns the local port used by this flow.

Specified by:
getLocalPort in interface RtpFlow
Returns:
localPort the local port used by this flow.

getLocalAddress

public String getLocalAddress()
Returns the local address used by this flow.

Specified by:
getLocalAddress in interface RtpFlow
Returns:
localAddress the local address port used by this flow.

getRemotePort

public int getRemotePort()
Returns the remote port used by this flow.

Specified by:
getRemotePort in interface RtpFlow
Returns:
remotePort the remote port used by this flow.

getRemoteAddress

public String getRemoteAddress()
Returns the remote address used by this flow.

Specified by:
getRemoteAddress in interface RtpFlow
Returns:
remoteAddress the remote address port used by this flow.

start

public void start()
Implementation of start to send media data.

Specified by:
start in interface RtpFlow

stop

public void stop()
Stops the transmission if already started. Stops receiving also.

Specified by:
stop in interface RtpFlow

resume

public void resume()
Resume media transmission on this flow

Specified by:
resume in interface RtpFlow

pause

public void pause()
Pause media transmission on this flow

Specified by:
pause in interface RtpFlow

update

public void update(javax.media.rtp.event.SessionEvent evt)
Implements update from javax.media.rtp.SessionListener

Specified by:
update in interface javax.media.rtp.SessionListener
Parameters:
evt - received event

update

public void update(javax.media.rtp.event.ReceiveStreamEvent evt)
Implements update from javax.media.rtp.ReceiveStreamListener

Specified by:
update in interface javax.media.rtp.ReceiveStreamListener
Parameters:
evt - received event

controllerUpdate

public void controllerUpdate(javax.media.ControllerEvent ce)
Implements controllerUpdate from javax.media.rtp.ControllerListener

Specified by:
controllerUpdate in interface javax.media.ControllerListener
Parameters:
ce - received event

addMediaListener

public void addMediaListener(MediaListener listener)
Add a listener to be informed of media events hapening on this flow.

Specified by:
addMediaListener in interface RtpFlow

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

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