javax.media.rtp.rtcp.SourceDescription Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fmj Show documentation
Show all versions of fmj Show documentation
Freedom for Media in Java
package javax.media.rtp.rtcp;
import java.net.*;
/**
* Standard JMF class -- see this class in the JMF Javadoc. Coding complete.
*
* @author Ken Larson
*
*/
public class SourceDescription implements java.io.Serializable
{
public static final int SOURCE_DESC_CNAME = 1;
public static final int SOURCE_DESC_NAME = 2;
public static final int SOURCE_DESC_EMAIL = 3;
public static final int SOURCE_DESC_PHONE = 4;
public static final int SOURCE_DESC_LOC = 5;
public static final int SOURCE_DESC_TOOL = 6;
public static final int SOURCE_DESC_NOTE = 7;
public static final int SOURCE_DESC_PRIV = 8;
public static String generateCNAME()
{
// generates something like user@host
final String hostname;
try
{
hostname = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e)
{
throw new RuntimeException(e);
}
return System.getProperty("user.name") + '@' + hostname;
}
private int type;
private String description;
private int frequency;
private boolean encrypted;
public SourceDescription(int type, String description, int frequency,
boolean encrypted)
{
this.type = type;
this.description = description;
this.frequency = frequency;
this.encrypted = encrypted;
}
public String getDescription()
{
return description;
}
public boolean getEncrypted()
{
return encrypted;
}
public int getFrequency()
{
return frequency;
}
public int getType()
{
return type;
}
public void setDescription(String desc)
{
this.description = desc;
}
}