SourceDescriptionpublic class SourceDescription extends Object implements SerializableClass to encapsulate a source description item used in RTCP SDES reports. |
Fields Summary |
---|
public static final int | SOURCE_DESC_CNAME | public static final int | SOURCE_DESC_NAME | public static final int | SOURCE_DESC_EMAIL | public static final int | SOURCE_DESC_PHONE | public static final int | SOURCE_DESC_LOC | public static final int | SOURCE_DESC_TOOL | public static final int | SOURCE_DESC_NOTE | public static final int | SOURCE_DESC_PRIV | private static JMFSecurity | jmfSecurity | private static boolean | securityPrivelege | private static Method[] | m | private static Class[] | cl | private static Object[] | args | private int | m_type | private String | m_description | private int | m_frequency | private boolean | m_encrypted |
Constructors Summary |
---|
public SourceDescription(int type, String description, int frequency, boolean encrypted)Constructor.
the type of source description this is
description the actual source description string
frequency the frequency at which RTCP sends this source description
encrypted set to true if this SDES item is to be encrypted.
Please see individual variable description for current implementation status
try {
jmfSecurity = JMFSecurityManager.getJMFSecurity();
securityPrivelege = true;
} catch (SecurityException e) {
}
m_type = type;
m_description = description;
m_frequency = frequency;
m_encrypted = encrypted;
|
Methods Summary |
---|
public static java.lang.String | generateCNAME()This function can be used to generate a CNAME using the scheme
described in RFC1889. This function is provided in order to facilitate CNAME
generation prior to actual stream creation.
String hostname = null;
InetAddress host;
String cname = "";
if ( jmfSecurity != null) {
String permission = null;
try {
if (jmfSecurity.getName().startsWith("jmf-security")) {
permission = "connect";
jmfSecurity.requestPermission(m, cl, args, JMFSecurity.CONNECT);
m[0].invoke(cl[0], args[0]);
} else if (jmfSecurity.getName().startsWith("internet")) {
PolicyEngine.checkPermission(PermissionID.NETIO);
PolicyEngine.assertPermission(PermissionID.NETIO);
}
} catch (Throwable e) {
if (JMFSecurityManager.DEBUG) {
System.err.println("Unable to get " + permission +
" privilege " + e);
}
jmfSecurity.permissionFailureNotification(JMFSecurity.CONNECT);
// securityPrivelege = false;
}
}
try {
if ( (jmfSecurity != null) && (jmfSecurity.getName().startsWith("jdk12"))) {
Constructor cons = jdk12InetAddressAction.cons;
host = (InetAddress) jdk12.doPrivM.invoke(
jdk12.ac,
new Object[] {
cons.newInstance(
new Object[] {
null, // static method
"getLocalHost",
null, // No parameters
})});
hostname = (String) jdk12.doPrivM.invoke(
jdk12.ac,
new Object[] {
cons.newInstance(
new Object[] {
host,
"getHostName",
null, // No parameters
})});
} else {
host = InetAddress.getLocalHost();
hostname = host.getHostName();
}
} catch (Throwable e) {
System.err.println("InitSession : UnknownHostExcpetion " +
e.getMessage());
}
cname = getProperty("user.name");
if (cname == null) {
return hostname;
} else {
return cname + "@" + hostname;
}
| public java.lang.String | getDescription()Get the actual source description string.
return m_description;
| public boolean | getEncrypted()Should this source description be encrypted?.
Currently, we do not support any encryption schemes
return m_encrypted;
| public int | getFrequency()Get the frequency at which RTCP sends this source description.
Currently, this frequency parameter will be ignored by the
implementation and SDES items are sent according to the following
algorithm... The CNAME is sent every RTCP reporting interval. All
other SDES items are sent once every 3 RTCP report intervals.
return m_frequency;
| private static java.lang.String | getProperty(java.lang.String prop)
String value = null;
if ( jmfSecurity != null) {
try {
if (jmfSecurity.getName().startsWith("jmf-security")) {
jmfSecurity.requestPermission(m, cl, args, JMFSecurity.READ_PROPERTY);
m[0].invoke(cl[0], args[0]);
} else if (jmfSecurity.getName().startsWith("internet")) {
PolicyEngine.checkPermission(PermissionID.PROPERTY);
PolicyEngine.assertPermission(PermissionID.PROPERTY);
}
} catch (Throwable e) {
if (JMFSecurityManager.DEBUG) {
System.err.println("Unable to get read property " +
" privilege " + e);
}
jmfSecurity.permissionFailureNotification(JMFSecurity.READ_PROPERTY);
// securityPrivelege = false;
}
}
try {
if ( (jmfSecurity != null) && (jmfSecurity.getName().startsWith("jdk12"))) {
Constructor cons = jdk12PropertyAction.cons;
value = (String) jdk12.doPrivM.invoke(
jdk12.ac,
new Object[] {
cons.newInstance(
new Object[] {
prop
})});
} else {
value = System.getProperty(prop);
}
} catch (Throwable e) {
}
return value;
| public int | getType()Get the type of source description this is. // encrypt it?
// Methods
return m_type;
| public void | setDescription(java.lang.String desc)
m_description = desc;
|
|