Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.neomedia.format
Interface MediaFormat

All Known Subinterfaces:
AudioMediaFormat, VideoMediaFormat
All Known Implementing Classes:
AudioMediaFormatImpl, MediaFormatImpl, VideoMediaFormatImpl

public interface MediaFormat

The MediaFormat interface represents a generic (i.e. audio/video or other) format used to represent media represent a media stream.

The interface contains utility methods for extracting common media format properties such as the name of the underlying encoding, or clock rate or in order comparing to compare formats. Extending interfaces representing audio or video formats are likely to add other methods.

Author:
Emil Ivov, Lyubomir Marinov

Field Summary
static int MAX_DYNAMIC_PAYLOAD_TYPE
          The maximum integer that is allowed for use in dynamic payload type assignment.
static int MIN_DYNAMIC_PAYLOAD_TYPE
          The minimum integer that is allowed for use in dynamic payload type assignment.
static byte RTP_PAYLOAD_TYPE_UNKNOWN
          The constant returned by getRTPPayloadType() when the MediaFormat instance describes a format without an RTP payload type (number) known in RFC 3551 "RTP Profile for Audio and Video Conferences with Minimal Control".
 
Method Summary
 boolean equals(Object mediaFormat)
          Determines whether this MediaFormat is equal to mediaFormat i.e.
 boolean formatParametersMatch(Map<String,String> fmtps)
          Determines whether the format parameters of this MediaFormat match a specific set of format parameters.
 Map<String,String> getAdditionalCodecSettings()
          Returns additional codec settings.
 Map<String,String> getAdvancedAttributes()
          Returns a Map containing advanced parameters specific to this particular MediaFormat.
 double getClockRate()
          Returns the clock rate associated with this MediaFormat.
 String getClockRateString()
          Returns a String representation of the clock rate associated with this MediaFormat making sure that the value appears as an integer (i.e.
 String getEncoding()
          Returns the name of the encoding (i.e.
 Map<String,String> getFormatParameters()
          Returns a Map containing parameters specific to this particular MediaFormat.
 MediaType getMediaType()
          Returns the type of this MediaFormat (e.g.
 byte getRTPPayloadType()
          Gets the RTP payload type (number) of this MediaFormat as it is known in RFC 3551 "RTP Profile for Audio and Video Conferences with Minimal Control".
 void setAdditionalCodecSettings(Map<String,String> settings)
          Sets additional codec settings.
 String toString()
          Returns a String representation of this MediaFormat containing important format attributes such as the encoding for example.
 

Field Detail

RTP_PAYLOAD_TYPE_UNKNOWN

static final byte RTP_PAYLOAD_TYPE_UNKNOWN
The constant returned by getRTPPayloadType() when the MediaFormat instance describes a format without an RTP payload type (number) known in RFC 3551 "RTP Profile for Audio and Video Conferences with Minimal Control".

See Also:
Constant Field Values

MIN_DYNAMIC_PAYLOAD_TYPE

static final int MIN_DYNAMIC_PAYLOAD_TYPE
The minimum integer that is allowed for use in dynamic payload type assignment.

See Also:
Constant Field Values

MAX_DYNAMIC_PAYLOAD_TYPE

static final int MAX_DYNAMIC_PAYLOAD_TYPE
The maximum integer that is allowed for use in dynamic payload type assignment.

See Also:
Constant Field Values
Method Detail

getMediaType

MediaType getMediaType()
Returns the type of this MediaFormat (e.g. audio or video).

Returns:
the MediaType that this format represents (e.g. audio or video).

getEncoding

String getEncoding()
Returns the name of the encoding (i.e. codec) used by this MediaFormat.

Returns:
The name of the encoding that this MediaFormat is using.

getClockRate

double getClockRate()
Returns the clock rate associated with this MediaFormat.

Returns:
The clock rate associated with this format.

getClockRateString

String getClockRateString()
Returns a String representation of the clock rate associated with this MediaFormat making sure that the value appears as an integer (i.e. contains no decimal point) unless it is actually a non integer.

Returns:
a String representation of the clock rate associated with this MediaFormat.

equals

boolean equals(Object mediaFormat)
Determines whether this MediaFormat is equal to mediaFormat i.e. they have the same encoding, clock rate, format parameters, advanced attributes, etc.

Overrides:
equals in class Object
Parameters:
mediaFormat - the MediaFormat to compare to this instance
Returns:
true if mediaFormat is equal to this format and false otherwise.

formatParametersMatch

boolean formatParametersMatch(Map<String,String> fmtps)
Determines whether the format parameters of this MediaFormat match a specific set of format parameters.

Parameters:
fmtps - the set of format parameters to match to the format parameters of this MediaFormat
Returns:
true if this MediaFormat considers fmtps matching its format parameters; otherwise, false

getAdvancedAttributes

Map<String,String> getAdvancedAttributes()
Returns a Map containing advanced parameters specific to this particular MediaFormat. The parameters returned here are meant for use in SIP/SDP or XMPP session descriptions.

Returns:
a Map containing advanced parameters specific to this particular MediaFormat

getFormatParameters

Map<String,String> getFormatParameters()
Returns a Map containing parameters specific to this particular MediaFormat. The parameters returned here are meant for use in SIP/SDP or XMPP session descriptions where they get transported through the "fmtp:" attribute or tag respectively.

Returns:
a Map containing parameters specific to this particular MediaFormat.

getRTPPayloadType

byte getRTPPayloadType()
Gets the RTP payload type (number) of this MediaFormat as it is known in RFC 3551 "RTP Profile for Audio and Video Conferences with Minimal Control".

Returns:
the RTP payload type of this MediaFormat if it is known in RFC 3551 "RTP Profile for Audio and Video Conferences with Minimal Control"; otherwise, RTP_PAYLOAD_TYPE_UNKNOWN

setAdditionalCodecSettings

void setAdditionalCodecSettings(Map<String,String> settings)
Sets additional codec settings.

Parameters:
settings - additional settings represented by a map.

getAdditionalCodecSettings

Map<String,String> getAdditionalCodecSettings()
Returns additional codec settings.

Returns:
additional settings represented by a map.

toString

String toString()
Returns a String representation of this MediaFormat containing important format attributes such as the encoding for example.

Overrides:
toString in class Object
Returns:
a String representation of this MediaFormat.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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