Methods Summary |
---|
public abstract void | addFormat(javax.media.Format format, int payload)This method is used to add a dynamic payload to format
mapping to the RTPManager. The RTPManager maintains
all static payload numbers and their correspnding formats as
mentioned in the Audio/Video profile document. Using the plugin
packethandler interface, a user may plugin his own packetizer or
depacketizer to handle RTP streams of a proprietary format using
dynamic payload numbers as specified in the AV profile. Before
streaming dynamic payloads, a Format object needs to
be created for each of the dynamic payload types and associated
with a dynamic payload number.
|
public abstract void | addReceiveStreamListener(javax.media.rtp.ReceiveStreamListener listener)Adds a ReceiveStreamListener. This listener listens to all the
events that notify state transitions for a particular
ReceiveStream.
|
public abstract void | addRemoteListener(javax.media.rtp.RemoteListener listener)Adds a RemoteListener to the session. This listener listens
to all remote RTP events. Currently, these include
ReceiverReportEvent, ReceiveSenderReportEvent and
RemoteCollisionEvent. This interface would be usefuly for an RTCP
monitor that does not wish to receive any particular stream
transitionEvents but just wants to monitor the session quality
and statistics.
|
public abstract void | addSendStreamListener(javax.media.rtp.SendStreamListener listener)Adds a SendStreamListener. This listener listens to all the
events that notify state transitions for a particular
SendStream.
|
public abstract void | addSessionListener(javax.media.rtp.SessionListener listener)Adds a SessionListener. A SessionListener will receive
events that pertain to the Session as a whole. Currently,
these include the NewParticipantEvent and
LocalCollisionEvent. Events are notified in the
update(SessionEvent) method which must be implemented by all
SessionListeners.
|
public abstract void | addTarget(javax.media.rtp.SessionAddress remoteAddress)This method opens the session, causing RTCP reports to be
generated and callbacks to be made through the
SessionListener interface. This method must be called after
session initialization and prior to the creation of any streams
on a session.
|
static java.util.Vector | buildClassList(java.util.Vector prefixList, java.lang.String name)Build a list of complete class names.
For each element of the prefix-list
the following element is added to the list:
<prefix>.<name>
These are added to the list in the same order as the prefixes appear
in the prefix-list.
// New list which has the name as the first element ...
Vector classList = new Vector();
// Try and instance one directly from the classpath
// if it's there.
// $jdr: This has been objected to as confusing,
// the argument for it's inclusion is that it
// gives the user (via the classpath) a way
// of modifying the search list at run time
// for all applications.
classList.addElement(name);
// ... for each prefix append the name and put it
// in the class list ...
Enumeration prefix = prefixList.elements();
while( prefix.hasMoreElements()) {
String prefixName = (String)prefix.nextElement();
classList.addElement(prefixName + "." + name);
}
// ... done
return classList;
|
private static boolean | checkIfJDK12()
if (jdkInit)
return (forName3ArgsM != null);
jdkInit = true;
try {
forName3ArgsM = Class.class.getMethod("forName",
new Class[] {
String.class, boolean.class, ClassLoader.class
});
getSystemClassLoaderM = ClassLoader.class.getMethod("getSystemClassLoader", null);
// TODO: may need to invoke RuntimePermission("getClassLoader") privilege
systemClassLoader = (ClassLoader) getSystemClassLoaderM.invoke(ClassLoader.class, null);
getContextClassLoaderM = Thread.class.getMethod("getContextClassLoader", null);
return true;
} catch (Throwable t) {
forName3ArgsM = null;
return false;
}
|
public abstract javax.media.rtp.SendStream | createSendStream(javax.media.protocol.DataSource dataSource, int streamIndex)This method is used to create a sending stream within the RTP
session. For each time the call is made, a new sending stream
will be created. This stream will use the SDES items as entered
in the initialize() call for all its RTCP messages. Each stream
is sent out with a new SSRC (Synchronisation SouRCe
identifier), but from the same participant i.e. local
participant.
|
public abstract void | dispose()Releases all objects allocated in the course of the session and prepares
the RTPManager to be garbage-collected. This method should be called at
the end of any RTP session.
|
public abstract java.util.Vector | getActiveParticipants()Returns a vector of all the active (data sending)
participants. These participants may be remote and/or the local participant.
|
public abstract java.util.Vector | getAllParticipants()Returns all the participants of this session.
|
static java.lang.Class | getClassForName(java.lang.String className)
/**
* Note: if we don't want this functionality
* just replace it with Class.forName(className)
*/
try {
return Class.forName(className);
} catch (Exception e) {
if (!checkIfJDK12()) {
throw new ClassNotFoundException(e.getMessage());
}
} catch (Error e) {
if (!checkIfJDK12()) {
throw e;
}
}
/**
* In jdk1.2 application, when you have jmf.jar in the ext directory and
* you want to access a class that is not in jmf.jar but is in the CLASSPATH,
* you have to load it using the the system class loader.
*/
try {
return (Class) forName3ArgsM.invoke(Class.class, new Object[] {
className, new Boolean(true), systemClassLoader});
} catch (Throwable e) {
}
/**
* In jdk1.2 applet, when you have jmf.jar in the ext directory and
* you want to access a class that is not in jmf.jar but applet codebase,
* you have to load it using the the context class loader.
*/
try {
// TODO: may need to invoke RuntimePermission("getClassLoader") privilege
ClassLoader contextClassLoader =
(ClassLoader) getContextClassLoaderM.invoke(Thread.currentThread(), null);
return (Class) forName3ArgsM.invoke(Class.class, new Object[] {
className, new Boolean(true), contextClassLoader});
} catch (Exception e) {
throw new ClassNotFoundException(e.getMessage());
} catch (Error e) {
throw e;
}
|
public abstract javax.media.rtp.GlobalReceptionStats | getGlobalReceptionStats()This method will provide access to overall data and control
messsage reception statistics for this session. Statistics on
data from individual sources is available from the
getSourceReceptionStats() method of the ReceiveStream interface.
|
public abstract javax.media.rtp.GlobalTransmissionStats | getGlobalTransmissionStats()This method will provide access to overall data and control
messsage transmission statistics for this session. Statistics on
data from individual sources is available from the
getSourceTransmissionStats() method of the SendStream interface.
|
public abstract javax.media.rtp.LocalParticipant | getLocalParticipant()Retrieves the local participant.
|
public abstract java.util.Vector | getPassiveParticipants()Returns all the passive participants. These participants will
include the local participant and some remote participants that
do not send any data.
|
static java.util.Vector | getProtocolPrefixList()
return (Vector) javax.media.PackageManager.getProtocolPrefixList().clone();
|
public static java.util.Vector | getRTPManagerList()Build a list of RTPManager implementation classes.
The implemenation class must be named 'RTPSessionMgr' and is
required to extend from javax.media.rtp.RTPManager.
The first name in the list will always be:
media.rtp.RTPSessionMgr
Each additional name looks like:
com.<company>.media.rtp.RTPSessionMgr
for every <company> in the
company-list.
// The first element is the name of the protocol handler ...
String sourceName =
"media.rtp.RTPSessionMgr";
return buildClassList(getProtocolPrefixList(), sourceName);
|
public abstract java.util.Vector | getReceiveStreams()Returns the ReceiveStreams created by the
RTPManager. These are streams formed when the RTPManager
detects a new source of RTP data.
ReceiveStreams returned are a snapshot of the current state in the
RTPManager and the ReceiveStreamListener interface may be used
to get notified of additional streams.
|
public abstract java.util.Vector | getRemoteParticipants()Returns a Vector of all the remote participants in the
session.This vector is simply a snapshot of the current state in
the RTPManager. The SessionListener interface can be
used to get notified of additional participants for the
Session.
|
public abstract java.util.Vector | getSendStreams()Returns the SendStreams created by the
RTPManager.
SendStreams returned are a snapshot of the current state in the
RTPSesion and the SendStreamListener interface may be used
to get notified of additional streams.
|
public abstract void | initialize(javax.media.rtp.SessionAddress localAddress)Initializes the session. Once this method has been called, the
session is "initialized" and this method cannot be called again.
|
public abstract void | initialize(javax.media.rtp.SessionAddress[] localAddresses, javax.media.rtp.rtcp.SourceDescription[] sourceDescription, double rtcpBandwidthFraction, double rtcpSenderBandwidthFraction, javax.media.rtp.EncryptionInfo encryptionInfo)Initializes the session. Once this method has been called, the
session is "initialized" and this method cannot be called again.
|
public abstract void | initialize(javax.media.rtp.RTPConnector connector)Initializes the session. Once this method has been called, the
session is "initialized" and this method cannot be called again.
|
public static javax.media.rtp.RTPManager | newInstance()Create an RTPManager object for the underlying
implementation class.
RTPManager rtpManager= null;
Enumeration SessionList =
getRTPManagerList().elements();
while( SessionList.hasMoreElements()) {
String protoClassName = (String)SessionList.nextElement();
try {
Class protoClass = getClassForName(protoClassName);
rtpManager = (RTPManager)protoClass.newInstance();
} catch (ClassNotFoundException e) {
// System.out.println( "class def not found.");
} catch (InstantiationException e) {
String err = "Error instantiating class: " + protoClassName + " : " + e;
Log.error(e);
} catch (IllegalAccessException e) {
System.out.println( "illegal access.");
} catch (Exception e) {
String err = "Error instantiating class: " + protoClassName + " : " + e;
Log.error(e);
} catch (Error e) {
String err = "Error instantiating class: " + protoClassName + " : " + e;
Log.error(e);
}
if( rtpManager != null) {
break;
}
}
return rtpManager;
|
public abstract void | removeReceiveStreamListener(javax.media.rtp.ReceiveStreamListener listener)Removes a ReceiveStreamListener.
|
public abstract void | removeRemoteListener(javax.media.rtp.RemoteListener listener)Removes a RemoteListener.
|
public abstract void | removeSendStreamListener(javax.media.rtp.SendStreamListener listener)Removes a SendStreamListener.
|
public abstract void | removeSessionListener(javax.media.rtp.SessionListener listener)Removes a SessionListener.
|
public abstract void | removeTarget(javax.media.rtp.SessionAddress remoteAddress, java.lang.String reason)Closes all open streams associated with the endpoint defined
by remoteAddress.
|
public abstract void | removeTargets(java.lang.String reason)Closes the open streams associated with all remote endpoints
that have been added previously by subsequent addTarget() calls.
|