public class VideoMediaFormatImpl extends MediaFormatImpl<javax.media.format.VideoFormat> implements VideoMediaFormat
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_CLOCK_RATE
The default value of the clockRate property of
VideoMediaFormatImpl.
|
static java.lang.String |
H264_PACKETIZATION_MODE_FMTP
The name of the format parameter which specifies the packetization mode
of H.264 RTP payload.
|
static java.lang.String |
H264_SPROP_PARAMETER_SETS_FMTP |
CLOCK_RATE_PNAME, EMPTY_FORMAT_PARAMETERS, ENCODING_PNAME, format, FORMAT_PARAMETERS_PNAME
MAX_DYNAMIC_PAYLOAD_TYPE, MIN_DYNAMIC_PAYLOAD_TYPE, RTP_PAYLOAD_TYPE_UNKNOWN
Constructor and Description |
---|
VideoMediaFormatImpl(java.lang.String encoding)
Initializes a new VideoMediaFormatImpl instance with a specific
encoding.
|
VideoMediaFormatImpl(java.lang.String encoding,
double clockRate)
Initializes a new VideoMediaFormatImpl instance with a specific
encoding and a specific clock rate.
|
VideoMediaFormatImpl(javax.media.format.VideoFormat format)
Initializes a new VideoMediaFormatImpl instance which is to
provide an implementation of VideoMediaFormat for a specific
JMF VideoFormat.
|
VideoMediaFormatImpl(javax.media.format.VideoFormat format,
double clockRate)
Initializes a new VideoMediaFormatImpl instance which is to
provide an implementation of VideoMediaFormat for a specific
JMF VideoFormat and to have a specific clock rate.
|
VideoMediaFormatImpl(javax.media.format.VideoFormat format,
double clockRate,
float frameRate,
java.util.Map<java.lang.String,java.lang.String> formatParameters,
java.util.Map<java.lang.String,java.lang.String> advancedParameters)
Initializes a new VideoMediaFormatImpl instance which is to
provide an implementation of VideoMediaFormat for a specific
JMF VideoFormat and to have specific clock rate and set of
format-specific parameters.
|
Modifier and Type | Method and Description |
---|---|
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.
|
static boolean |
formatParametersMatch(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 two sets of format parameters match in the context of
a specific encoding.
|
double |
getClockRate()
Gets the clock rate associated with this MediaFormat.
|
float |
getFrameRate()
Gets the frame rate associated with this MediaFormat.
|
MediaType |
getMediaType()
Gets the type of this MediaFormat which is
MediaType.VIDEO for AudioMediaFormatImpl instances. |
java.awt.Dimension |
getSize()
Gets the size of the image that this VideoMediaFormat describes.
|
int |
hashCode()
Overrides MediaFormatImpl#hashCode() because
Object#equals(Object) is overridden.
|
advancedAttributesAreEqual, createInstance, createInstance, getAdditionalCodecSettings, getAdvancedAttributes, getClockRateString, getEncoding, getFormat, getFormatParameters, getJMFEncoding, getRealUsedClockRateString, getRTPPayloadType, matches, matches, setAdditionalCodecSettings, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAdditionalCodecSettings, getAdvancedAttributes, getClockRateString, getEncoding, getFormatParameters, getRealUsedClockRateString, getRTPPayloadType, matches, matches, setAdditionalCodecSettings, toString
public static final double DEFAULT_CLOCK_RATE
public static final java.lang.String H264_PACKETIZATION_MODE_FMTP
public static final java.lang.String H264_SPROP_PARAMETER_SETS_FMTP
VideoMediaFormatImpl(java.lang.String encoding)
encoding
- the encoding of the new VideoMediaFormatImpl
instanceVideoMediaFormatImpl(java.lang.String encoding, double clockRate)
encoding
- the encoding of the new VideoMediaFormatImpl
instanceclockRate
- the clock rate of the new VideoMediaFormatImpl
instanceVideoMediaFormatImpl(javax.media.format.VideoFormat format)
format
- the JMF VideoFormat the new instance is to wrap
and provide an implementation of VideoMediaFormat forVideoMediaFormatImpl(javax.media.format.VideoFormat format, double clockRate)
format
- the JMF VideoFormat the new instance is to wrap
and provide an implementation of VideoMediaFormat forclockRate
- the clock rate of the new VideoMediaFormatImpl
instanceVideoMediaFormatImpl(javax.media.format.VideoFormat format, double clockRate, float frameRate, java.util.Map<java.lang.String,java.lang.String> formatParameters, java.util.Map<java.lang.String,java.lang.String> advancedParameters)
format
- the JMF VideoFormat the new instance is to wrap
and provide an implementation of VideoMediaFormat forclockRate
- the clock rate of the new VideoMediaFormatImpl
instanceframeRate
- the frame rate of the new VideoMediaFormatImpl
instanceformatParameters
- the set of format-specific parameters of the new
instanceadvancedParameters
- set of advanced parameters of the new instancepublic boolean equals(java.lang.Object mediaFormat)
equals
in interface MediaFormat
equals
in class MediaFormatImpl<javax.media.format.VideoFormat>
mediaFormat
- the object that we'd like to compare this one
toMediaFormatImpl.equals(Object)
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.
Takes into account RFC 3984 "RTP Payload Format for H.264 Video" which says that "[w]hen the value of packetization-mode [format parameter] is equal to 0 or packetization-mode is not present, the single NAL mode, as defined in section 6.2 of RFC 3984, MUST be used."
formatParametersAreEqual
in class MediaFormatImpl<javax.media.format.VideoFormat>
fmtps1
- the first set of format parameters to be tested for
equalityfmtps2
- the second set of format parameters to be tested for
equalityMediaFormatImpl.formatParametersAreEqual(Map, Map)
public 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 formatParametersMatch(java.util.Map<java.lang.String,java.lang.String> fmtps)
VideoMediaFormat reflects the fact that the packetization-mode format parameter distinguishes H.264 payload types.
formatParametersMatch
in interface MediaFormat
formatParametersMatch
in class MediaFormatImpl<javax.media.format.VideoFormat>
fmtps
- the set of format parameters to match to the format
parameters of this MediaFormatpublic static boolean formatParametersMatch(java.lang.String encoding, java.util.Map<java.lang.String,java.lang.String> fmtps1, java.util.Map<java.lang.String,java.lang.String> fmtps2)
encoding
- the encoding (name) related to the two sets of format
parameters to be matched.fmtps1
- the first set of format parameters which is to be matched
against fmtps2fmtps2
- the second set of format parameters which is to be matched
against fmtps1public double getClockRate()
getClockRate
in interface MediaFormat
MediaFormat.getClockRate()
public float getFrameRate()
getFrameRate
in interface VideoMediaFormat
VideoMediaFormat.getFrameRate()
public final MediaType getMediaType()
MediaType.VIDEO
for AudioMediaFormatImpl instances.getMediaType
in interface MediaFormat
MediaFormat.getMediaType()
public java.awt.Dimension getSize()
getSize
in interface VideoMediaFormat
Dimension
instance indicating the image size (in
pixels) of this VideoMediaFormatVideoMediaFormat.getSize()
public int hashCode()
hashCode
in class MediaFormatImpl<javax.media.format.VideoFormat>
MediaFormatImpl.hashCode()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.