Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.format
Class ParameterizedVideoFormat

java.lang.Object
  extended by javax.media.Format
      extended by javax.media.format.VideoFormat
          extended by net.java.sip.communicator.impl.neomedia.format.ParameterizedVideoFormat
All Implemented Interfaces:
Serializable, Cloneable

public class ParameterizedVideoFormat
extends javax.media.format.VideoFormat

Implements a VideoFormat with format parameters (like VideoMediaFormatImpl) (some of) which (could) distinguish payload types.

Author:
Lyubomir Marinov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.media.format.VideoFormat
CINEPAK, frameRate, H261, H261_RTP, H263, H263_1998_RTP, H263_RTP, INDEO32, INDEO41, INDEO50, IRGB, JPEG, JPEG_RTP, maxDataLength, MJPEGA, MJPEGB, MJPG, MPEG, MPEG_RTP, RGB, RLE, RPZA, size, SMC, YUV
 
Fields inherited from class javax.media.Format
byteArray, clz, dataType, encoding, FALSE, formatArray, intArray, NOT_SPECIFIED, shortArray, TRUE
 
Constructor Summary
ParameterizedVideoFormat(String encoding, Dimension size, int maxDataLength, Class<?> dataType, float frameRate, Map<String,String> fmtps)
          Constructs a new ParametizedVideoFormat.
ParameterizedVideoFormat(String encoding, Map<String,String> fmtps)
          Initializes a new ParameterizedVideoFormat with a specific encoding and a specific set of format parameters.
ParameterizedVideoFormat(String encoding, String... fmtps)
          Initializes a new ParameterizedVideoFormat with a specific encoding and a specific set of format parameters.
 
Method Summary
 Object clone()
          Initializes a new ParameterizedVideoFormat instance which has the same properties as this instance.
protected  void copy(javax.media.Format f)
          Copies the properties of the specified Format into this instance.
 boolean equals(Object obj)
          Determines whether a specific Object represents a value that is equal to the value represented by this instance.
 boolean formatParametersMatch(javax.media.Format format)
          Returns whether or not the format parameters match.
 String getFormatParameter(String name)
          Returns the format parameters value for the specified name.
 Map<String,String> getFormatParameters()
          Returns the format parameters Map.
 javax.media.Format intersects(javax.media.Format format)
          Finds the attributes shared by two matching Formats.
 boolean matches(javax.media.Format format)
          Determines whether a specific format matches this instance i.e.
static
<T> Map<T,T>
toMap(T... entries)
          Initializes a new Map from an array in which the key and the value of an association are expressed as consecutive elements.
 String toString()
           
 
Methods inherited from class javax.media.format.VideoFormat
getFrameRate, getMaxDataLength, getSize, relax
 
Methods inherited from class javax.media.Format
getDataType, getEncoding, isSameEncoding, isSameEncoding
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedVideoFormat

public ParameterizedVideoFormat(String encoding,
                                Dimension size,
                                int maxDataLength,
                                Class<?> dataType,
                                float frameRate,
                                Map<String,String> fmtps)
Constructs a new ParametizedVideoFormat.

Parameters:
encoding - encoding
size - video size
maxDataLength - maximum data length
dataType - data type
frameRate - frame rate
fmtps - format parameters

ParameterizedVideoFormat

public ParameterizedVideoFormat(String encoding,
                                Map<String,String> fmtps)
Initializes a new ParameterizedVideoFormat with a specific encoding and a specific set of format parameters.

Parameters:
encoding - the encoding of the new instance
fmtps - the format parameters of the new instance

ParameterizedVideoFormat

public ParameterizedVideoFormat(String encoding,
                                String... fmtps)
Initializes a new ParameterizedVideoFormat with a specific encoding and a specific set of format parameters.

Parameters:
encoding - the encoding of the new instance
fmtps - the format parameters of the new instance in the form of an array of Strings in which the key and the value of an association are expressed as consecutive elements.
Method Detail

clone

public Object clone()
Initializes a new ParameterizedVideoFormat instance which has the same properties as this instance.

Overrides:
clone in class javax.media.format.VideoFormat
Returns:
a new ParameterizedVideoFormat instance which has the same properties as this instance

copy

protected void copy(javax.media.Format f)
Copies the properties of the specified Format into this instance.

Overrides:
copy in class javax.media.format.VideoFormat
Parameters:
f - the Format the properties of which are to be copied into this instance

equals

public boolean equals(Object obj)
Determines whether a specific Object represents a value that is equal to the value represented by this instance.

Overrides:
equals in class javax.media.format.VideoFormat
Parameters:
obj - the Object to be determined whether it represents a value that is equal to the value represented by this instance
Returns:
true if the specified obj represents a value that is equal to the value represented by this instance; otherwise, false

formatParametersMatch

public boolean formatParametersMatch(javax.media.Format format)
Returns whether or not the format parameters match.

Parameters:
format - format to test
Returns:
true if the format parameters match.

getFormatParameter

public String getFormatParameter(String name)
Returns the format parameters value for the specified name.

Parameters:
name - format parameters name
Returns:
value for the specified format parameters name

getFormatParameters

public Map<String,String> getFormatParameters()
Returns the format parameters Map.

Returns:
the format parameters Map.

intersects

public javax.media.Format intersects(javax.media.Format format)
Finds the attributes shared by two matching Formats. If the specified Format does not match this one, the result is undefined.

Overrides:
intersects in class javax.media.format.VideoFormat
Parameters:
format - the matching Format to intersect with this one
Returns:
a Format with its attributes set to the attributes common to this instance and the specified format

matches

public boolean matches(javax.media.Format format)
Determines whether a specific format matches this instance i.e. whether their attributes match according to the definition of "match" given by Format.matches(Format).

Overrides:
matches in class javax.media.format.VideoFormat
Parameters:
format - the Format to compare to this instance
Returns:
true if the specified format matches this one; otherwise, false

toMap

public static <T> Map<T,T> toMap(T... entries)
Initializes a new Map from an array in which the key and the value of an association are expressed as consecutive elements.

Type Parameters:
T - the very type of the keys and the values to be associated in the new Map
Parameters:
entries - the associations to be created in the new Map where the key and value of an association are expressed as consecutive elements
Returns:
a new Map with the associations specified by entries

toString

public String toString()
Overrides:
toString in class javax.media.format.VideoFormat

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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