public interface MediaFormat
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.
Modifier and Type | Field and Description |
---|---|
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". |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object mediaFormat)
Determines whether this MediaFormat is equal to
mediaFormat i.e.
|
boolean |
formatParametersMatch(java.util.Map<java.lang.String,java.lang.String> fmtps)
Determines whether the format parameters of this MediaFormat
match a specific set of format parameters.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalCodecSettings()
Returns additional codec settings.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdvancedAttributes()
Returns a Map containing advanced parameters specific to this
particular MediaFormat.
|
double |
getClockRate()
Returns the clock rate associated with this MediaFormat.
|
java.lang.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.
|
java.lang.String |
getEncoding()
Returns the name of the encoding (i.e.
|
java.util.Map<java.lang.String,java.lang.String> |
getFormatParameters()
Returns a Map containing parameters specific to this particular
MediaFormat.
|
MediaType |
getMediaType()
Returns the type of this MediaFormat (e.g.
|
java.lang.String |
getRealUsedClockRateString()
Returns a String representation of the real used clock rate
associated with this MediaFormat making sure that the value
appears as an integer (i.e.
|
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".
|
boolean |
matches(MediaFormat format)
Determines whether this MediaFormat matches properties of a
specific MediaFormat, such as mediaType,
encoding, clockRate and channels for
MediaFormats with mediaType equal to
MediaType.AUDIO . |
boolean |
matches(MediaType mediaType,
java.lang.String encoding,
double clockRate,
int channels,
java.util.Map<java.lang.String,java.lang.String> formatParameters)
Determines whether this MediaFormat has specific values
for its properties mediaType, encoding,
clockRate and channels for MediaFormats with
mediaType equal to
MediaType.AUDIO . |
void |
setAdditionalCodecSettings(java.util.Map<java.lang.String,java.lang.String> settings)
Sets additional codec settings.
|
java.lang.String |
toString()
Returns a String representation of this MediaFormat
containing important format attributes such as the encoding for example.
|
static final byte RTP_PAYLOAD_TYPE_UNKNOWN
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".static final int MIN_DYNAMIC_PAYLOAD_TYPE
static final int MAX_DYNAMIC_PAYLOAD_TYPE
MediaType getMediaType()
java.lang.String getEncoding()
double getClockRate()
java.lang.String getClockRateString()
java.lang.String getRealUsedClockRateString()
boolean equals(java.lang.Object mediaFormat)
equals
in class java.lang.Object
mediaFormat
- the MediaFormat to compare to this instanceboolean formatParametersMatch(java.util.Map<java.lang.String,java.lang.String> fmtps)
fmtps
- the set of format parameters to match to the format
parameters of this MediaFormatjava.util.Map<java.lang.String,java.lang.String> getAdvancedAttributes()
java.util.Map<java.lang.String,java.lang.String> getFormatParameters()
byte getRTPPayloadType()
RTP_PAYLOAD_TYPE_UNKNOWN
void setAdditionalCodecSettings(java.util.Map<java.lang.String,java.lang.String> settings)
settings
- additional settings represented by a map.java.util.Map<java.lang.String,java.lang.String> getAdditionalCodecSettings()
java.lang.String toString()
toString
in class java.lang.Object
boolean matches(MediaFormat format)
MediaType.AUDIO
.format
- the MediaFormat
whose properties we'd like to
examinemediaType
- the type we expect MediaFormat
to haveencoding
- the encoding we are looking for.clockRate
- the clock rate that we'd like the format to have.channels
- the number of channels that expect to find in this formatformatParameters
- the format parameters expected to match these of
the specified formatboolean matches(MediaType mediaType, java.lang.String encoding, double clockRate, int channels, java.util.Map<java.lang.String,java.lang.String> formatParameters)
MediaType.AUDIO
.mediaType
- the type we expect MediaFormat
to haveencoding
- the encoding we are looking for.clockRate
- the clock rate that we'd like the format to have.channels
- the number of channels that expect to find in this formatformatParameters
- the format parameters expected to match these of
the specified format
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.