RtpPayloadFormat
@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 |
RTP_MEDIA_AC3 = "AC3" |
static final String |
RTP_MEDIA_AMR = "AMR" |
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 |
RTP_MEDIA_H264 = "H264" |
static final String |
RTP_MEDIA_H265 = "H265" |
static final String |
RTP_MEDIA_MPEG4_GENERIC = "MPEG4-GENERIC" |
static final String |
RTP_MEDIA_MPEG4_LATM_AUDIO = "MP4A-LATM" |
static final String |
RTP_MEDIA_MPEG4_VIDEO = "MP4V-ES" |
static final String |
RTP_MEDIA_OPUS = "OPUS" |
static final String |
RTP_MEDIA_PCMA = "PCMA" |
static final String |
RTP_MEDIA_PCMU = "PCMU" |
static final String |
RTP_MEDIA_PCM_L16 = "L16" |
static final String |
RTP_MEDIA_PCM_L8 = "L8" |
static final String |
RTP_MEDIA_VP8 = "VP8" |
static final String |
RTP_MEDIA_VP9 = "VP9" |
Public fields |
|
---|---|
final int |
The clock rate in Hertz, associated with the format. |
final ImmutableMap<String, String> |
The format parameters, mapped from the SDP FMTP attribute (RFC2327 Page 22). |
final Format |
The |
final String |
The RTP media encoding. |
final int |
The payload type associated with this format. |
Public constructors |
---|
RtpPayloadFormat( Creates a new instance. |
Public methods |
|
---|---|
boolean |
|
static String |
getMimeTypeFromRtpMediaType(String mediaType) Gets the MIME type that is associated with the RTP media type. |
static int |
@C.PcmEncoding Returns the PCM encoding type for |
int |
hashCode() |
Constants
Public fields
fmtpParameters
public final ImmutableMap<String, String> fmtpParameters
The format parameters, mapped from the SDP FMTP attribute (RFC2327 Page 22).
Public constructors
RtpPayloadFormat
public RtpPayloadFormat(
Format format,
int rtpPayloadType,
int clockRate,
Map<String, String> fmtpParameters,
String mediaEncoding
)
Creates a new instance.
Parameters | |
---|---|
Format format |
The associated |
int rtpPayloadType |
The assigned RTP payload type, from the RTPMAP attribute in . |
int clockRate |
The associated clock rate in hertz. |
Map<String, String> 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
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
.