@UnstableApi
public final class RtpPayloadFormat


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.

Summary

Constants

static final String
static final String
static final String
RTP_MEDIA_AMR_WB = "AMR-WB"
static final String
RTP_MEDIA_H263_1998 = "H263-1998"
static final String
RTP_MEDIA_H263_2000 = "H263-2000"
static final String
static final String
static final String
RTP_MEDIA_MPEG4_GENERIC = "MPEG4-GENERIC"
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String

Public fields

final int

The clock rate in Hertz, associated with the format.

final ImmutableMap<StringString>

The format parameters, mapped from the SDP FMTP attribute (RFC2327 Page 22).

final Format

The Format of this RTP payload.

final String

The RTP media encoding.

final int

The payload type associated with this format.

Public constructors

RtpPayloadFormat(
    Format format,
    int rtpPayloadType,
    int clockRate,
    Map<StringString> fmtpParameters,
    String mediaEncoding
)

Creates a new instance.

Public methods

boolean
static String

Gets the MIME type that is associated with the RTP media type.

static int

Returns the PCM encoding type for mediaEncoding.

int

Constants

RTP_MEDIA_AC3

public static final String RTP_MEDIA_AC3 = "AC3"

RTP_MEDIA_AMR

public static final String RTP_MEDIA_AMR = "AMR"

RTP_MEDIA_AMR_WB

public static final String RTP_MEDIA_AMR_WB = "AMR-WB"

RTP_MEDIA_H263_1998

public static final String RTP_MEDIA_H263_1998 = "H263-1998"

RTP_MEDIA_H263_2000

public static final String RTP_MEDIA_H263_2000 = "H263-2000"

RTP_MEDIA_H264

public static final String RTP_MEDIA_H264 = "H264"

RTP_MEDIA_H265

public static final String RTP_MEDIA_H265 = "H265"

RTP_MEDIA_MPEG4_GENERIC

public static final String RTP_MEDIA_MPEG4_GENERIC = "MPEG4-GENERIC"

RTP_MEDIA_MPEG4_LATM_AUDIO

public static final String RTP_MEDIA_MPEG4_LATM_AUDIO = "MP4A-LATM"

RTP_MEDIA_MPEG4_VIDEO

public static final String RTP_MEDIA_MPEG4_VIDEO = "MP4V-ES"

RTP_MEDIA_OPUS

public static final String RTP_MEDIA_OPUS = "OPUS"

RTP_MEDIA_PCMA

public static final String RTP_MEDIA_PCMA = "PCMA"

RTP_MEDIA_PCMU

public static final String RTP_MEDIA_PCMU = "PCMU"

RTP_MEDIA_PCM_L16

public static final String RTP_MEDIA_PCM_L16 = "L16"

RTP_MEDIA_PCM_L8

public static final String RTP_MEDIA_PCM_L8 = "L8"

RTP_MEDIA_VP8

public static final String RTP_MEDIA_VP8 = "VP8"

RTP_MEDIA_VP9

public static final String RTP_MEDIA_VP9 = "VP9"

Public fields

clockRate

public final int clockRate

The clock rate in Hertz, associated with the format.

fmtpParameters

public final ImmutableMap<StringStringfmtpParameters

The format parameters, mapped from the SDP FMTP attribute (RFC2327 Page 22).

format

public final Format format

The Format of this RTP payload.

mediaEncoding

public final String mediaEncoding

The RTP media encoding.

rtpPayloadType

public final int rtpPayloadType

The payload type associated with this format.

Public constructors

RtpPayloadFormat

public RtpPayloadFormat(
    Format format,
    int rtpPayloadType,
    int clockRate,
    Map<StringString> fmtpParameters,
    String mediaEncoding
)

Creates a new instance.

Parameters
Format format

The associated media format.

int rtpPayloadType

The assigned RTP payload type, from the RTPMAP attribute in .

int clockRate

The associated clock rate in hertz.

Map<StringString> 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.

String mediaEncoding

The RTP media encoding.

Public methods

equals

public boolean equals(@Nullable Object o)

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 VIDEO_H264.

Throws
java.lang.IllegalArgumentException

When the media type is not supported/recognized.

getRawPcmEncodingType

@C.PcmEncoding
public static int getRawPcmEncodingType(String mediaEncoding)

Returns the PCM encoding type for mediaEncoding.

hashCode

public int hashCode()