public class RTPSessionMgr extends RTPManager implements SessionManager
| Modifier and Type | Field and Description |
|---|---|
protected long |
ssrc |
SSRC_UNSPEC| Constructor and Description |
|---|
RTPSessionMgr()
Creates a new RTPManager
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFormat(Format format,
int payload)
Add a format to the list of supported formats.
|
void |
addPeer(SessionAddress peerAddress)
Add a peer to send RTP data to.
|
void |
addReceiveStreamListener(ReceiveStreamListener listener)
Adds a listener to the list of listeners wanting to be informed when a receive stream is created.
|
void |
addRemoteListener(RemoteListener listener)
Adds a listener to the list of remote listeners.
|
void |
addSendStreamListener(SendStreamListener listener)
Add this listener to the list of listeners wanting to be informed when a send stream is created.
|
void |
addSessionListener(SessionListener listener)
Add this listener to the list of session listeners.
|
void |
addTarget(SessionAddress remoteAddress)
Add a network target to which we'll send our RTP packets.
|
void |
closeSession(java.lang.String reason)
Closes this RTP Session.
|
SendStream |
createSendStream(DataSource dataSource,
int streamIndex)
Creates a send stream used to carry data from a source to some receivers over the network.
|
SendStream |
createSendStream(int ssrc,
DataSource ds,
int streamindex)
Creates a send stream used to carry data from a source to some receivers over the network.
|
void |
dispose()
Called when wishing to quit the RTP session.
|
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()
Generate a CNAME.
|
long |
generateSSRC()
Generates a Synchronization SouRCe (SSRC) number.
|
java.util.Vector |
getActiveParticipants()
Returns the list of active participants in this RTP session.
|
java.util.Vector |
getAllParticipants()
Returns the list of all participants in this RTP session.
|
int |
getAverageRTCPSize()
Returns the average RTP packet size computed until now.
|
java.lang.Object |
getControl(java.lang.String controlClass)
Get control for the specified type.
|
java.lang.Object[] |
getControls()
Get the list of all controls possible.
|
long |
getDefaultSSRC()
Returns the default SSRC in this RTP session.
|
Format |
getFormat(int payload)
Another function provided by Sun's implementation, not in the spec/API.
|
GlobalReceptionStats |
getGlobalReceptionStats()
Returns the global reception statistics for this RTP session.
|
GlobalTransmissionStats |
getGlobalTransmissionStats()
Returns the global transmission statistics for this RTP session.
|
LocalParticipant |
getLocalParticipant()
Returns the local participant.
|
SessionAddress |
getLocalSessionAddress()
Returns the local session address.
|
int |
getMulticastScope()
Returns the multicast scope.
|
java.util.Vector |
getPassiveParticipants()
Returns the list of passive participants in this RTP session.
|
java.util.Vector |
getPeers()
Returns all the receiver & senders peers we're sending RTP data to.
|
java.util.Vector |
getReceiveStreams()
Returns the list of receive streams in this RTP session.
|
java.util.Vector |
getRemoteParticipants()
Returns the list of remote participants in this RTP session.
|
SessionAddress |
getRemoteSessionAddress()
Returns the remote session address.
|
java.util.Vector |
getSendStreams()
Returns the list of send streams in this RTP session.
|
SessionAddress |
getSessionAddress()
Returns the session address.
|
RTPStream |
getStream(long filterssrc)
Returns the RTPStream corresponding to this SSRC.
|
static Format[] |
getSupportedFormats()
Return the SupportedFormats via RTP
|
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)
Initializes and starts the RTP Session.
|
void |
initialize(SessionAddress localAddress)
Initializes and starts the RTP Session.
|
void |
initialize(SessionAddress[] localAddresses,
SourceDescription[] sourceDescription,
double rtcpBandwidthFraction,
double rtcpSenderBandwidthFraction,
EncryptionInfo encryptionInfo)
Initializes and starts the RTP Session.
|
int |
initSession(SessionAddress localAddress,
long defaultSSRC,
SourceDescription[] defaultUserDesc,
double rtcp_bw_fraction,
double rtcp_sender_bw_fraction)
Initializes and starts the session.
|
int |
initSession(SessionAddress localAddress,
SourceDescription[] defaultUserDesc,
double rtcp_bw_fraction,
double rtcp_sender_bw_fraction)
Initializes and starts the session.
|
void |
removeAllPeers()
Removes all the peers from this RTP session.
|
void |
removePeer(SessionAddress peerAddress)
Removes a receiver peer from the session.
|
void |
removeReceiveStreamListener(ReceiveStreamListener listener)
Removes this listener from the list of listeners wanting to be be informed
of the creation of new receive streams.
|
void |
removeRemoteListener(RemoteListener listener)
Removes this listener from the list of remote listeners.
|
void |
removeSendStreamListener(SendStreamListener listener)
Removes this listener from the list of listeners wanting to be informed of
the creation of send streams.
|
void |
removeSessionListener(SessionListener listener)
Removes this listener from the list of session listeners.
|
void |
removeTarget(SessionAddress remoteAddress,
java.lang.String reason)
Remove a network target .
|
void |
removeTargets(java.lang.String reason)
Remove a network target .
|
void |
RTPPacketSent(long time,
int size)
Sort of callback method called by RTPSendStreams to inform the RTPSessionManager they're linked to
that an RTP packet has been sent by the local participant.
|
void |
sendRTCPPacket()
Sends an RTCP packet, and schedules the next one
|
void |
setMulticastScope(int multicastScope)
Sets the multicast scope.
|
void |
start()
Starts the sending of RTCP packets
|
int |
startSession(int mcastScope,
EncryptionInfo encryptionInfo)
Starts a session.
|
int |
startSession(SessionAddress destAddress,
int mcastScope,
EncryptionInfo encryptionInfo)
Starts a session.
|
int |
startSession(SessionAddress localReceiverAddress,
SessionAddress localSenderAddress,
SessionAddress remoteReceiverAddress,
EncryptionInfo encryptionInfo)
Starts a session.
|
getRTPManagerList, newInstancepublic static boolean formatSupported(Format f)
f - the format which we want to testpublic static Format[] getSupportedFormats()
public Format getFormat(int payload)
public void addFormat(Format format, int payload)
addFormat in interface SessionManageraddFormat in class RTPManagerformat - format to addpayload - type of payload corresponding to this formatpublic void addReceiveStreamListener(ReceiveStreamListener listener)
addReceiveStreamListener in interface SessionManageraddReceiveStreamListener in class RTPManagerlistener - the listener to addpublic void addRemoteListener(RemoteListener listener)
addRemoteListener in interface SessionManageraddRemoteListener in class RTPManagerlistener - listener to addpublic void addSendStreamListener(SendStreamListener listener)
addSendStreamListener in interface SessionManageraddSendStreamListener in class RTPManagerlistener - the listener to addpublic void addSessionListener(SessionListener listener)
addSessionListener in interface SessionManageraddSessionListener in class RTPManagerlistener - listener to addpublic void removeReceiveStreamListener(ReceiveStreamListener listener)
removeReceiveStreamListener in interface SessionManagerremoveReceiveStreamListener in class RTPManagerlistener - listener to removepublic void removeRemoteListener(RemoteListener listener)
removeRemoteListener in interface SessionManagerremoveRemoteListener in class RTPManagerlistener - listener to removepublic void removeSendStreamListener(SendStreamListener listener)
removeSendStreamListener in interface SessionManagerremoveSendStreamListener in class RTPManagerlistener - listener to removepublic void removeSessionListener(SessionListener listener)
removeSessionListener in interface SessionManagerremoveSessionListener in class RTPManagerlistener - listener to removepublic java.util.Vector getActiveParticipants()
getActiveParticipants in interface SessionManagergetActiveParticipants in class RTPManagerpublic java.util.Vector getAllParticipants()
getAllParticipants in interface SessionManagergetAllParticipants in class RTPManagerpublic LocalParticipant getLocalParticipant()
getLocalParticipant in interface SessionManagergetLocalParticipant in class RTPManagerpublic java.util.Vector getPassiveParticipants()
getPassiveParticipants in interface SessionManagergetPassiveParticipants in class RTPManagerpublic java.util.Vector getRemoteParticipants()
getRemoteParticipants in interface SessionManagergetRemoteParticipants in class RTPManagerpublic GlobalReceptionStats getGlobalReceptionStats()
getGlobalReceptionStats in interface SessionManagergetGlobalReceptionStats in class RTPManagerpublic GlobalTransmissionStats getGlobalTransmissionStats()
getGlobalTransmissionStats in interface SessionManagergetGlobalTransmissionStats in class RTPManagerpublic java.util.Vector getReceiveStreams()
getReceiveStreams in interface SessionManagergetReceiveStreams in class RTPManagerpublic java.util.Vector getSendStreams()
getSendStreams in interface SessionManagergetSendStreams in class RTPManagerpublic void initialize(SessionAddress localAddress) throws java.io.IOException
initialize in class RTPManagerlocalAddress - the local addressjava.io.IOException - I/O Exceptionpublic void initialize(SessionAddress[] localAddresses, SourceDescription[] sourceDescription, double rtcpBandwidthFraction, double rtcpSenderBandwidthFraction, EncryptionInfo encryptionInfo)
initialize in class RTPManagerlocalAddresses - the local addresssourceDescription - the source description to be used when sending SDES reportsrtcpBandwidthFraction - the bandwidth fraction allocated for RTCP trafficrtcpSenderBandwidthFraction - the RTCP bandwidth fraction allocated for sendersencryptionInfo - Encryption information - UNUSED at the momentpublic void addTarget(SessionAddress remoteAddress) throws java.io.IOException
addTarget in class RTPManagerremoteAddress - remote address (unicast or multicast) to which we want to send our RTP packetsjava.io.IOException - I/O Exceptionpublic void initialize(RTPConnector connector)
initialize in class RTPManagerconnector - the RTP connector used to retrieve the control & data streamspublic void removeTarget(SessionAddress remoteAddress, java.lang.String reason)
removeTarget in class RTPManagerremoteAddress - remote address (unicast or multicast) to which we want to send our RTP packetsreason - reason for which we remove this target (used in the RTCP BYE packet following this call)public void removeTargets(java.lang.String reason)
removeTargets in class RTPManagerreason - reason for which we remove this target (used in the RTCP BYE packet following this call)public SendStream createSendStream(DataSource dataSource, int streamIndex) throws UnsupportedFormatException, java.io.IOException
createSendStream in interface SessionManagercreateSendStream in class RTPManagerdataSource - the datasource producing the data to sendstreamIndex - the index of the stream in the datasource's streams tableUnsupportedFormatException - thrown if the datasource's stream only outputs formats which aren't supportedjava.io.IOException - I/O Exception thrown in case of problem with streamspublic void dispose()
dispose in class RTPManagerpublic java.lang.Object getControl(java.lang.String controlClass)
getControl in interface ControlscontrolClass - the control classpublic java.lang.Object[] getControls()
getControls in interface Controlsprotected void handleRTPPacket(byte[] data,
int offset,
int length)
data - The raw packet dataoffset - The packet offset after which we must start investigatinglength - The total packet lengthprotected void handleRTCPPacket(byte[] data,
int offset,
int length)
data - The packet dataoffset - The packet offsetlength - The packet lengthpublic int initSession(SessionAddress localAddress, long defaultSSRC, SourceDescription[] defaultUserDesc, double rtcp_bw_fraction, double rtcp_sender_bw_fraction)
initSession in interface SessionManagerlocalAddress - the local addressdefaultSSRC - the default SSRC. UNUSED.defaultUserDesc - the default SDESrtcp_bw_fraction - the bandwidth fraction allocated for RTCP trafficrtcp_sender_bw_fraction - the RTCP bandwidth fraction allocated for senderspublic int initSession(SessionAddress localAddress, SourceDescription[] defaultUserDesc, double rtcp_bw_fraction, double rtcp_sender_bw_fraction)
initSession in interface SessionManagerlocalAddress - the local addressdefaultUserDesc - the default SDESrtcp_bw_fraction - the bandwidth fraction allocated for RTCP trafficrtcp_sender_bw_fraction - the RTCP bandwidth fraction allocated for senderspublic int startSession(SessionAddress destAddress, int mcastScope, EncryptionInfo encryptionInfo) throws java.io.IOException
startSession in interface SessionManagerdestAddress - destination address to add as targetmcastScope - multicast scope. UNUSED.encryptionInfo - encryption information. UNUSED.java.io.IOException - I/O Exceptionpublic int startSession(SessionAddress localReceiverAddress, SessionAddress localSenderAddress, SessionAddress remoteReceiverAddress, EncryptionInfo encryptionInfo) throws java.io.IOException
startSession in interface SessionManagerlocalReceiverAddress - local receiver address. UNUSED.localSenderAddress - local sender address. UNUSED.remoteReceiverAddress - remote receiver address to add as targetencryptionInfo - encryption information. UNUSEDjava.io.IOException - I/O Exceptionpublic long getDefaultSSRC()
getDefaultSSRC in interface SessionManagerpublic RTPStream getStream(long filterssrc)
getStream in interface SessionManagerfilterssrc - SSRC. UNUSED.public int getMulticastScope()
getMulticastScope in interface SessionManagerpublic void setMulticastScope(int multicastScope)
setMulticastScope in interface SessionManagermulticastScope - multicast scope. UNUSED.public void closeSession(java.lang.String reason)
closeSession in interface SessionManagerreason - Reason why this session is closed (used in the RTCP BYE packet following this call)public java.lang.String generateCNAME()
generateCNAME in interface SessionManagerpublic long generateSSRC()
generateSSRC in interface SessionManagerpublic SessionAddress getSessionAddress()
getSessionAddress in interface SessionManagerpublic SessionAddress getRemoteSessionAddress()
public SessionAddress getLocalSessionAddress()
getLocalSessionAddress in interface SessionManagerpublic SendStream createSendStream(int ssrc, DataSource ds, int streamindex) throws UnsupportedFormatException, java.io.IOException
createSendStream in interface SessionManagerssrc - the stream's SSRC. UNUSED.ds - the datasource producing the data to sendstreamindex - the index of the stream in the datasource's streams tableUnsupportedFormatException - thrown if the datasource's stream only outputs formats which aren't supportedjava.io.IOException - I/O Exception thrown in case of problem with streamspublic int startSession(int mcastScope,
EncryptionInfo encryptionInfo)
startSession in interface SessionManagermcastScope - multicast scope. UNUSED.encryptionInfo - encryption information. UNUSED.public void addPeer(SessionAddress peerAddress) throws java.io.IOException
addPeer in interface SessionManagerpeerAddress - the remote address used as targetjava.io.IOException - I/O Exceptionpublic void removePeer(SessionAddress peerAddress)
removePeer in interface SessionManagerpeerAddress - the peer's address which is used as targetpublic void removeAllPeers()
removeAllPeers in interface SessionManagerpublic java.util.Vector getPeers()
getPeers in interface SessionManagerpublic void start()
public void sendRTCPPacket()
public void RTPPacketSent(long time,
int size)
time - time when the packet was sentsize - size of the packet sentpublic int getAverageRTCPSize()