SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media
Class MediaUtils

java.lang.Object
  extended by net.java.sip.communicator.impl.media.MediaUtils

public class MediaUtils
extends Object

Implements static utility methods used by media classes.

Author:
Emil Ivov

Field Summary
static int UNKNOWN_ENCODING
          Returned by sdpToJmfEncoding(String) if it does not know the given encoding.
 
Constructor Summary
MediaUtils()
           
 
Method Summary
static int jmfToSdpEncoding(String jmfEncoding)
          Returns the SDP encoding number corresponding to jmfFormat.
static String sdpToJmfEncoding(String sdpEncodingStr)
          Returns the String encoding, as specified in AudioFormat and VideoFormat, corresponding to the format specified in sdpFormatStr
static List<String> sdpToJmfEncodings(List<String> sdpEncodings)
          Converts the list of sdpEncodings to a list of jmf compatible encoding strings as specified by the static vars in VideoFormat and AudioFormat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_ENCODING

public static final int UNKNOWN_ENCODING
Returned by sdpToJmfEncoding(String) if it does not know the given encoding.

See Also:
Constant Field Values
Constructor Detail

MediaUtils

public MediaUtils()
Method Detail

sdpToJmfEncoding

public static String sdpToJmfEncoding(String sdpEncodingStr)
Returns the String encoding, as specified in AudioFormat and VideoFormat, corresponding to the format specified in sdpFormatStr

Parameters:
sdpEncodingStr - the SDP index that we'd like to convert to a JMF format.
Returns:
one of the AudioFormat.XXX or VideoFormat.XXX format strings.

jmfToSdpEncoding

public static int jmfToSdpEncoding(String jmfEncoding)
Returns the SDP encoding number corresponding to jmfFormat.

Parameters:
jmfEncoding - one of the AudioFormat.XXX or VideoFormat.XXX format strings.
Returns:
the SDP index corresponding to jmfEncoding. Returns UNKNOWN_ENCODING if the encoding is not supported or jmfEncoding is null.

sdpToJmfEncodings

public static List<String> sdpToJmfEncodings(List<String> sdpEncodings)
Converts the list of sdpEncodings to a list of jmf compatible encoding strings as specified by the static vars in VideoFormat and AudioFormat.

Parameters:
sdpEncodings - a list containing strings representing SDP format codes.
Returns:
a list of strings representing JMF compatible encoding names.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.