Class RtpPayloadFormat

  • public final class RtpPayloadFormat
    extends Object
    Represents the payload format used in RTP.

    In RTSP playback, the format information is always present in the SessionDescription enclosed in the response of a DESCRIBE request. Within each track's MediaDescription, it is the attributes FMTP and RTPMAP that allows us to recreate the media format.

    This class wraps around the Format class, in addition to the instance fields that are specific to RTP.

    • Field Detail

      • rtpPayloadType

        public final int rtpPayloadType
        The payload type associated with this format.
      • clockRate

        public final int clockRate
        The clock rate in Hertz, associated with the format.
      • format

        public final Format format
        The Format of this RTP payload.
      • fmtpParameters

        public final ImmutableMap<String,​String> fmtpParameters
        The format parameters, mapped from the SDP FMTP attribute (RFC2327 Page 22).
    • Constructor Detail

      • RtpPayloadFormat

        public RtpPayloadFormat​(Format format,
                                int rtpPayloadType,
                                int clockRate,
                                Map<String,​String> fmtpParameters)
        Creates a new instance.
        format - The associated media format.
        rtpPayloadType - The assigned RTP payload type, from the RTPMAP attribute in MediaDescription.
        clockRate - The associated clock rate in hertz.
        fmtpParameters - The format parameters, from the SDP FMTP attribute (RFC2327 Page 22), empty if unset. The keys and values are specified in the RFCs for specific formats. For instance, RFC3640 Section 4.1 defines keys like profile-level-id and config.
    • Method Detail

      • isFormatSupported

        public static boolean isFormatSupported​( mediaDescription)
        Returns whether the format of a MediaDescription is supported.
      • getMimeTypeFromRtpMediaType

        public static String getMimeTypeFromRtpMediaType​(String mediaType)
        Gets the MIME type that is associated with the RTP media type.

        For instance, RTP media type "H264" maps to MimeTypes.VIDEO_H264.

        IllegalArgumentException - When the media type is not supported/recognized.
      • equals

        public boolean equals​(@Nullable
                              Object o)
        equals in class Object
      • hashCode

        public int hashCode()
        hashCode in class Object