T
- the type of the wrapped Formatpublic abstract class MediaFormatImpl<T extends javax.media.Format> extends java.lang.Object implements MediaFormat
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLOCK_RATE_PNAME
The name of the clockRate property of MediaFormatImpl.
|
(package private) static java.util.Map<java.lang.String,java.lang.String> |
EMPTY_FORMAT_PARAMETERS
The value of the formatParameters property of
MediaFormatImpl when no codec-specific parameters have been
received via SIP/SDP or XMPP/Jingle.
|
static java.lang.String |
ENCODING_PNAME
The name of the encoding property of MediaFormatImpl.
|
protected T |
format
The JMF Format this instance wraps and provides an
implementation of MediaFormat for.
|
static java.lang.String |
FORMAT_PARAMETERS_PNAME
The name of the formatParameters property of
MediaFormatImpl.
|
MAX_DYNAMIC_PAYLOAD_TYPE, MIN_DYNAMIC_PAYLOAD_TYPE, RTP_PAYLOAD_TYPE_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
MediaFormatImpl(T format)
Initializes a new MediaFormatImpl instance which is to provide
an implementation of MediaFormat for a specific Format.
|
protected |
MediaFormatImpl(T format,
java.util.Map<java.lang.String,java.lang.String> formatParameters,
java.util.Map<java.lang.String,java.lang.String> advancedAttributes)
Initializes a new MediaFormatImpl instance which is to provide
an implementation of MediaFormat for a specific Format
and which is to have a specific set of codec-specific parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
advancedAttributesAreEqual(java.util.Map<java.lang.String,java.lang.String> adv,
java.util.Map<java.lang.String,java.lang.String> adv2)
Determines whether a specific set of advanced attributes is equal to
another set of advanced attributes in the sense that they define an equal
number of parameters and assign them equal values.
|
static MediaFormat |
createInstance(javax.media.Format format)
Creates a new MediaFormat instance for a specific JMF
Format.
|
static MediaFormatImpl<? extends javax.media.Format> |
createInstance(javax.media.Format format,
double clockRate,
java.util.Map<java.lang.String,java.lang.String> formatParameters,
java.util.Map<java.lang.String,java.lang.String> advancedAttributess)
Creates a new MediaFormat instance for a specific JMF
Format and assigns it specific clock rate and set of
format-specific parameters.
|
boolean |
equals(java.lang.Object mediaFormat)
Implements MediaFormat#equals(Object) and actually compares the
encapsulated JMF Format instances.
|
protected boolean |
formatParametersAreEqual(java.util.Map<java.lang.String,java.lang.String> fmtps1,
java.util.Map<java.lang.String,java.lang.String> fmtps2)
Determines whether a specific set of format parameters is equal to
another set of format parameters in the sense that they define an equal
number of parameters and assign them equal values.
|
static boolean |
formatParametersAreEqual(java.lang.String encoding,
java.util.Map<java.lang.String,java.lang.String> fmtps1,
java.util.Map<java.lang.String,java.lang.String> fmtps2)
Determines whether a specific set of format parameters is equal to
another set of format parameters in the sense that they define an equal
number of parameters and assign them equal values.
|
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()
Implements MediaFormat#getAdvancedAttributes().
|
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()
Implements MediaFormat#getEncoding() and returns the encoding of the JMF
Format that we are encapsulating here but it is the RFC-known
encoding and not the internal JMF encoding.
|
T |
getFormat()
Returns the JMF Format instance that we are wrapping here.
|
java.util.Map<java.lang.String,java.lang.String> |
getFormatParameters()
Implements MediaFormat#getFormatParameters().
|
java.lang.String |
getJMFEncoding()
Gets the encoding of the JMF Format represented by this
instance as it is known to JMF (in contrast to its RFC name).
|
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".
|
int |
hashCode()
Overrides Object#hashCode() because Object#equals(Object) is overridden.
|
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> fmtps)
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, among other things, its encoding and clockrate values.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getClockRate, getMediaType
public static final java.lang.String CLOCK_RATE_PNAME
static final java.util.Map<java.lang.String,java.lang.String> EMPTY_FORMAT_PARAMETERS
public static final java.lang.String ENCODING_PNAME
public static final java.lang.String FORMAT_PARAMETERS_PNAME
protected final T extends javax.media.Format format
protected MediaFormatImpl(T format)
format
- the JMF Format the new instance is to provide an
implementation of MediaFormat forprotected MediaFormatImpl(T format, java.util.Map<java.lang.String,java.lang.String> formatParameters, java.util.Map<java.lang.String,java.lang.String> advancedAttributes)
format
- the JMF Format the new instance is to provide an
implementation of MediaFormat forformatParameters
- any codec-specific parameters that have been
received via SIP/SDP or XMPP/JingleadvancedAttributes
- any parameters that have been
received via SIP/SDP or XMPP/Jinglepublic static MediaFormat createInstance(javax.media.Format format)
format
- the JMF Format the new instance is to provide an
implementation of MediaFormat forpublic static MediaFormatImpl<? extends javax.media.Format> createInstance(javax.media.Format format, double clockRate, java.util.Map<java.lang.String,java.lang.String> formatParameters, java.util.Map<java.lang.String,java.lang.String> advancedAttributess)
format
- the JMF Format the new instance is to provide an
implementation of MediaFormat forclockRate
- the clock rate of the new instanceformatParameters
- the set of format-specific parameters of the new
instanceadvancedAttributess
- advanced attributes of the new instancepublic static boolean formatParametersAreEqual(java.lang.String encoding, java.util.Map<java.lang.String,java.lang.String> fmtps1, java.util.Map<java.lang.String,java.lang.String> fmtps2)
The two Map instances of format parameters to be checked for equality are presumed to be modifiable in the sense that if the lack of a format parameter in a given Map is equivalent to it having a specific value, an association of the format parameter to the value in question may be added to or removed from the respective Map instance for the purposes of determining equality.
encoding
- the encoding (name) related to the two sets of format
parameters to be tested for equalityfmtps1
- the first set of format parameters to be tested for
equalityfmtps2
- the second set of format parameters to be tested for
equalitypublic boolean advancedAttributesAreEqual(java.util.Map<java.lang.String,java.lang.String> adv, java.util.Map<java.lang.String,java.lang.String> adv2)
adv
- the first set of advanced attributes to be tested for
equalityadv2
- the second set of advanced attributes to be tested for
equalitypublic boolean equals(java.lang.Object mediaFormat)
equals
in interface MediaFormat
equals
in class java.lang.Object
mediaFormat
- the object that we'd like to compare this one
to.
8*protected boolean formatParametersAreEqual(java.util.Map<java.lang.String,java.lang.String> fmtps1, java.util.Map<java.lang.String,java.lang.String> fmtps2)
The two Map instances of format parameters to be checked for equality are presumed to be modifiable in the sense that if the lack of a format parameter in a given Map is equivalent to it having a specific value, an association of the format parameter to the value in question may be added to or removed from the respective Map instance for the purposes of determining equality.
fmtps1
- the first set of format parameters to be tested for
equalityfmtps2
- the second set of format parameters to be tested for
equalitypublic boolean formatParametersMatch(java.util.Map<java.lang.String,java.lang.String> fmtps)
The default implementation of MediaFormatImpl always returns true because format parameters in general do not cause the distinction of payload types.
formatParametersMatch
in interface MediaFormat
fmtps
- the set of format parameters to match to the format
parameters of this MediaFormatpublic java.util.Map<java.lang.String,java.lang.String> getAdditionalCodecSettings()
getAdditionalCodecSettings
in interface MediaFormat
public java.util.Map<java.lang.String,java.lang.String> getAdvancedAttributes()
getAdvancedAttributes
in interface MediaFormat
public java.lang.String getClockRateString()
getClockRateString
in interface MediaFormat
public java.lang.String getEncoding()
getEncoding
in interface MediaFormat
public T getFormat()
public java.util.Map<java.lang.String,java.lang.String> getFormatParameters()
getFormatParameters
in interface MediaFormat
public java.lang.String getJMFEncoding()
public java.lang.String getRealUsedClockRateString()
getRealUsedClockRateString
in interface MediaFormat
public byte getRTPPayloadType()
getRTPPayloadType
in interface MediaFormat
MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWN
MediaFormat.getRTPPayloadType()
public int hashCode()
hashCode
in class java.lang.Object
public boolean matches(MediaFormat format)
MediaType.AUDIO
.matches
in interface MediaFormat
format
- the MediaFormat
whose properties we'd like to
examine and compare with ours.public boolean matches(MediaType mediaType, java.lang.String encoding, double clockRate, int channels, java.util.Map<java.lang.String,java.lang.String> fmtps)
MediaType.AUDIO
.matches
in interface MediaFormat
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 formatfmtps
- the format parameters expected to match these of the
specified formatpublic void setAdditionalCodecSettings(java.util.Map<java.lang.String,java.lang.String> settings)
setAdditionalCodecSettings
in interface MediaFormat
settings
- additional settings represented by a map.public java.lang.String toString()
toString
in interface MediaFormat
toString
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.