net.sf.fmj.media.rtp
Class RTPSessionMgr

java.lang.Object
  extended by javax.media.rtp.RTPManager
      extended by net.sf.fmj.media.rtp.RTPSessionMgr
All Implemented Interfaces:
Controls, SessionManager

public class RTPSessionMgr
extends RTPManager
implements SessionManager

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

Field Summary
protected static long ssrc
           
 
Fields inherited from interface javax.media.rtp.SessionManager
SSRC_UNSPEC
 
Constructor Summary
RTPSessionMgr()
          Creates a new RTPManager
 
Method Summary
 void addFormat(Format format, int payload)
           
 void addPeer(SessionAddress peerAddress)
           
 void addReceiveStreamListener(ReceiveStreamListener listener)
           
 void addRemoteListener(RemoteListener listener)
           
 void addSendStreamListener(SendStreamListener listener)
           
 void addSessionListener(SessionListener listener)
           
 void addTarget(SessionAddress remoteAddress)
           
 void closeSession(java.lang.String reason)
           
 SendStream createSendStream(DataSource dataSource, int streamIndex)
           
 SendStream createSendStream(int ssrc, DataSource ds, int streamindex)
           
 void dispose()
           
static boolean formatSupported(Format f)
          This is a function provided by Sun's implementation, which is not in the API as AFAIK - kenlars99.
 java.lang.String generateCNAME()
           
 long generateSSRC()
           
 java.util.Vector getActiveParticipants()
           
 java.util.Vector getAllParticipants()
           
 java.lang.Object getControl(java.lang.String controlClass)
           
 java.lang.Object[] getControls()
           
 long getDefaultSSRC()
           
 Format getFormat(int payload)
          Another function provided by Sun's implementation, not in the spec/API.
 GlobalReceptionStats getGlobalReceptionStats()
           
 GlobalTransmissionStats getGlobalTransmissionStats()
           
 LocalParticipant getLocalParticipant()
           
 SessionAddress getLocalSessionAddress()
           
 int getMulticastScope()
           
 java.util.Vector getPassiveParticipants()
           
 java.util.Vector getPeers()
           
 java.util.Vector getReceiveStreams()
           
 java.util.Vector getRemoteParticipants()
           
 SessionAddress getRemoteSessionAddress()
           
 java.util.Vector getSendStreams()
           
 SessionAddress getSessionAddress()
           
 RTPStream getStream(long filterssrc)
           
protected  void handleRTCPPacket(byte[] data, int offset, int length)
          Handles an incoming RTCP packet
protected  void handleRTPPacket(byte[] data, int offset, int length)
          Handles an incoming RTP packet
 void initialize(RTPConnector connector)
           
 void initialize(SessionAddress localAddress)
           
 void initialize(SessionAddress[] localAddresses, SourceDescription[] sourceDescription, double rtcpBandwidthFraction, double rtcpSenderBandwidthFraction, EncryptionInfo encryptionInfo)
           
 int initSession(SessionAddress localAddress, long defaultSSRC, SourceDescription[] defaultUserDesc, double rtcp_bw_fraction, double rtcp_sender_bw_fraction)
           
 int initSession(SessionAddress localAddress, SourceDescription[] defaultUserDesc, double rtcp_bw_fraction, double rtcp_sender_bw_fraction)
           
 void removeAllPeers()
           
 void removePeer(SessionAddress peerAddress)
           
 void removeReceiveStreamListener(ReceiveStreamListener listener)
           
 void removeRemoteListener(RemoteListener listener)
           
 void removeSendStreamListener(SendStreamListener listener)
           
 void removeSessionListener(SessionListener listener)
           
 void removeTarget(SessionAddress remoteAddress, java.lang.String reason)
           
 void removeTargets(java.lang.String reason)
           
 void sendRTCPPacket()
          Sends an RTCP packet, and schedules the next one
 void setMulticastScope(int multicastScope)
           
 void start()
          Starts the sending of RTCP packets
 int startSession(int mcastScope, EncryptionInfo encryptionInfo)
           
 int startSession(SessionAddress destAddress, int mcastScope, EncryptionInfo encryptionInfo)
           
 int startSession(SessionAddress localReceiverAddress, SessionAddress localSenderAddress, SessionAddress remoteReceiverAddress, EncryptionInfo encryptionInfo)
           
 
Methods inherited from class javax.media.rtp.RTPManager
getRTPManagerList, newInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ssrc

protected static long ssrc
Constructor Detail

RTPSessionMgr

public RTPSessionMgr()
Creates a new RTPManager

Method Detail

formatSupported

public static boolean formatSupported(Format f)
This is a function provided by Sun's implementation, which is not in the API as AFAIK - kenlars99. This does not include formats in the RTP bonus formats mgr. This is a somewhat dubious function, since the actual RTPSessionMgr used is determined by RTPManager.newInstance(). To the extend that Sun's code calls this function, it is assuming that its own RTPSessionMgr will be used, which may be the source of some problems. Note: the format list in JMF is static, and in FMJ it is not. So you can add a format once with JMF, but you have to add it every time you instantiate the manager with FMJ.


getFormat

public Format getFormat(int payload)
Another function provided by Sun's implementation, not in the spec/API.


addFormat

public void addFormat(Format format,
                      int payload)
Specified by:
addFormat in interface SessionManager
Specified by:
addFormat in class RTPManager

addReceiveStreamListener

public void addReceiveStreamListener(ReceiveStreamListener listener)
Specified by:
addReceiveStreamListener in interface SessionManager
Specified by:
addReceiveStreamListener in class RTPManager

addRemoteListener

public void addRemoteListener(RemoteListener listener)
Specified by:
addRemoteListener in interface SessionManager
Specified by:
addRemoteListener in class RTPManager

addSendStreamListener

public void addSendStreamListener(SendStreamListener listener)
Specified by:
addSendStreamListener in interface SessionManager
Specified by:
addSendStreamListener in class RTPManager

addSessionListener

public void addSessionListener(SessionListener listener)
Specified by:
addSessionListener in interface SessionManager
Specified by:
addSessionListener in class RTPManager

removeReceiveStreamListener

public void removeReceiveStreamListener(ReceiveStreamListener listener)
Specified by:
removeReceiveStreamListener in interface SessionManager
Specified by:
removeReceiveStreamListener in class RTPManager

removeRemoteListener

public void removeRemoteListener(RemoteListener listener)
Specified by:
removeRemoteListener in interface SessionManager
Specified by:
removeRemoteListener in class RTPManager

removeSendStreamListener

public void removeSendStreamListener(SendStreamListener listener)
Specified by:
removeSendStreamListener in interface SessionManager
Specified by:
removeSendStreamListener in class RTPManager

removeSessionListener

public void removeSessionListener(SessionListener listener)
Specified by:
removeSessionListener in interface SessionManager
Specified by:
removeSessionListener in class RTPManager

getActiveParticipants

public java.util.Vector getActiveParticipants()
Specified by:
getActiveParticipants in interface SessionManager
Specified by:
getActiveParticipants in class RTPManager

getAllParticipants

public java.util.Vector getAllParticipants()
Specified by:
getAllParticipants in interface SessionManager
Specified by:
getAllParticipants in class RTPManager

getLocalParticipant

public LocalParticipant getLocalParticipant()
Specified by:
getLocalParticipant in interface SessionManager
Specified by:
getLocalParticipant in class RTPManager

getPassiveParticipants

public java.util.Vector getPassiveParticipants()
Specified by:
getPassiveParticipants in interface SessionManager
Specified by:
getPassiveParticipants in class RTPManager

getRemoteParticipants

public java.util.Vector getRemoteParticipants()
Specified by:
getRemoteParticipants in interface SessionManager
Specified by:
getRemoteParticipants in class RTPManager

getGlobalReceptionStats

public GlobalReceptionStats getGlobalReceptionStats()
Specified by:
getGlobalReceptionStats in interface SessionManager
Specified by:
getGlobalReceptionStats in class RTPManager

getGlobalTransmissionStats

public GlobalTransmissionStats getGlobalTransmissionStats()
Specified by:
getGlobalTransmissionStats in interface SessionManager
Specified by:
getGlobalTransmissionStats in class RTPManager

getReceiveStreams

public java.util.Vector getReceiveStreams()
Specified by:
getReceiveStreams in interface SessionManager
Specified by:
getReceiveStreams in class RTPManager

getSendStreams

public java.util.Vector getSendStreams()
Specified by:
getSendStreams in interface SessionManager
Specified by:
getSendStreams in class RTPManager

initialize

public void initialize(SessionAddress localAddress)
                throws java.io.IOException
Specified by:
initialize in class RTPManager
Throws:
java.io.IOException

initialize

public void initialize(SessionAddress[] localAddresses,
                       SourceDescription[] sourceDescription,
                       double rtcpBandwidthFraction,
                       double rtcpSenderBandwidthFraction,
                       EncryptionInfo encryptionInfo)
Specified by:
initialize in class RTPManager

addTarget

public void addTarget(SessionAddress remoteAddress)
               throws java.io.IOException
Specified by:
addTarget in class RTPManager
Throws:
java.io.IOException

initialize

public void initialize(RTPConnector connector)
Specified by:
initialize in class RTPManager

removeTarget

public void removeTarget(SessionAddress remoteAddress,
                         java.lang.String reason)
Specified by:
removeTarget in class RTPManager

removeTargets

public void removeTargets(java.lang.String reason)
Specified by:
removeTargets in class RTPManager

createSendStream

public SendStream createSendStream(DataSource dataSource,
                                   int streamIndex)
                            throws UnsupportedFormatException,
                                   java.io.IOException
Specified by:
createSendStream in interface SessionManager
Specified by:
createSendStream in class RTPManager
Throws:
UnsupportedFormatException
java.io.IOException

dispose

public void dispose()
Specified by:
dispose in class RTPManager

getControl

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

getControls

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

handleRTPPacket

protected void handleRTPPacket(byte[] data,
                               int offset,
                               int length)
Handles an incoming RTP packet

Parameters:
data - The packet data
offset - The packet offset
length - The packet length
Throws:
java.io.IOException

handleRTCPPacket

protected void handleRTCPPacket(byte[] data,
                                int offset,
                                int length)
Handles an incoming RTCP packet

Parameters:
data - The packet data
offset - The packet offset
length - The packet length

initSession

public int initSession(SessionAddress localAddress,
                       long defaultSSRC,
                       SourceDescription[] defaultUserDesc,
                       double rtcp_bw_fraction,
                       double rtcp_sender_bw_fraction)
Specified by:
initSession in interface SessionManager

initSession

public int initSession(SessionAddress localAddress,
                       SourceDescription[] defaultUserDesc,
                       double rtcp_bw_fraction,
                       double rtcp_sender_bw_fraction)
Specified by:
initSession in interface SessionManager

startSession

public int startSession(SessionAddress destAddress,
                        int mcastScope,
                        EncryptionInfo encryptionInfo)
                 throws java.io.IOException
Specified by:
startSession in interface SessionManager
Throws:
java.io.IOException

startSession

public int startSession(SessionAddress localReceiverAddress,
                        SessionAddress localSenderAddress,
                        SessionAddress remoteReceiverAddress,
                        EncryptionInfo encryptionInfo)
                 throws java.io.IOException
Specified by:
startSession in interface SessionManager
Throws:
java.io.IOException

getDefaultSSRC

public long getDefaultSSRC()
Specified by:
getDefaultSSRC in interface SessionManager

getStream

public RTPStream getStream(long filterssrc)
Specified by:
getStream in interface SessionManager

getMulticastScope

public int getMulticastScope()
Specified by:
getMulticastScope in interface SessionManager

setMulticastScope

public void setMulticastScope(int multicastScope)
Specified by:
setMulticastScope in interface SessionManager

closeSession

public void closeSession(java.lang.String reason)
Specified by:
closeSession in interface SessionManager

generateCNAME

public java.lang.String generateCNAME()
Specified by:
generateCNAME in interface SessionManager

generateSSRC

public long generateSSRC()
Specified by:
generateSSRC in interface SessionManager

getSessionAddress

public SessionAddress getSessionAddress()
Specified by:
getSessionAddress in interface SessionManager

getRemoteSessionAddress

public SessionAddress getRemoteSessionAddress()

getLocalSessionAddress

public SessionAddress getLocalSessionAddress()
Specified by:
getLocalSessionAddress in interface SessionManager

createSendStream

public SendStream createSendStream(int ssrc,
                                   DataSource ds,
                                   int streamindex)
                            throws UnsupportedFormatException,
                                   java.io.IOException
Specified by:
createSendStream in interface SessionManager
Throws:
UnsupportedFormatException
java.io.IOException

startSession

public int startSession(int mcastScope,
                        EncryptionInfo encryptionInfo)
Specified by:
startSession in interface SessionManager

addPeer

public void addPeer(SessionAddress peerAddress)
             throws java.io.IOException
Specified by:
addPeer in interface SessionManager
Throws:
java.io.IOException

removePeer

public void removePeer(SessionAddress peerAddress)
Specified by:
removePeer in interface SessionManager

removeAllPeers

public void removeAllPeers()
Specified by:
removeAllPeers in interface SessionManager

getPeers

public java.util.Vector getPeers()
Specified by:
getPeers in interface SessionManager

start

public void start()
Starts the sending of RTCP packets


sendRTCPPacket

public void sendRTCPPacket()
Sends an RTCP packet, and schedules the next one