rtp.h File Reference

Go to the source code of this file.

Macros

#define RTP_PT_PRIVATE   96
#define RTP_VERSION   2
#define RTP_MAX_SDES   256
 maximum text length for SDES
#define RTCP_TX_RATIO_NUM   5
#define RTCP_TX_RATIO_DEN   1000
#define RTP_XIPH_IDENT   0xfecdba

Enumerations

enum  RTCPType {
  RTCP_SR = 200, RTCP_RR, RTCP_SDES, RTCP_BYE,
  RTCP_APP
}

Functions

int ff_rtp_get_payload_type (AVFormatContext *fmt, AVCodecContext *codec)
 Return the payload type for a given codec used in the given format context.
int ff_rtp_get_codec_info (AVCodecContext *codec, int payload_type)
 Initialize a codec context based on the payload type.
const char * ff_rtp_enc_name (int payload_type)
 Return the encoding name (as defined in http://www.iana.org/assignments/rtp-parameters) for a given payload type.
enum CodecID ff_rtp_codec_id (const char *buf, enum AVMediaType codec_type)
 Return the codec id for the given encoding name and codec type.

Macro Definition Documentation

#define RTCP_TX_RATIO_DEN   1000

Definition at line 77 of file rtp.h.

Referenced by ff_rtp_check_and_send_back_rr(), and rtp_write_packet().

#define RTCP_TX_RATIO_NUM   5

Definition at line 76 of file rtp.h.

Referenced by ff_rtp_check_and_send_back_rr(), and rtp_write_packet().

#define RTP_MAX_SDES   256

maximum text length for SDES

Definition at line 73 of file rtp.h.

#define RTP_PT_PRIVATE   96

Definition at line 71 of file rtp.h.

Referenced by ff_rtp_get_payload_type().

#define RTP_VERSION   2
#define RTP_XIPH_IDENT   0xfecdba

Definition at line 83 of file rtp.h.

Referenced by ff_rtp_send_xiph().

Enumeration Type Documentation

enum RTCPType
Enumerator:
RTCP_SR 
RTCP_RR 
RTCP_SDES 
RTCP_BYE 
RTCP_APP 

Definition at line 86 of file rtp.h.

Function Documentation

enum CodecID ff_rtp_codec_id ( const char *  buf,
enum AVMediaType  codec_type 
)

Return the codec id for the given encoding name and codec type.

Parameters
bufA pointer to the string containing the encoding name
codec_typeThe codec type
Returns
In case of unknown encoding name, CODEC_ID_NONE is returned; otherwise, the codec id is returned

Definition at line 133 of file rtp.c.

const char* ff_rtp_enc_name ( int  payload_type)

Return the encoding name (as defined in http://www.iana.org/assignments/rtp-parameters) for a given payload type.

Parameters
payload_typeThe payload type (the 'PT' field in the RTP header)
Returns
In case of unknown payload type or dynamic payload type, a pointer to an empty string is returned; otherwise, a pointer to a string containing the encoding name is returned

Definition at line 121 of file rtp.c.

Referenced by ff_rtp_parse_close(), and ff_rtp_parse_open().

int ff_rtp_get_codec_info ( AVCodecContext codec,
int  payload_type 
)

Initialize a codec context based on the payload type.

Fill the codec_type and codec_id fields of a codec context with information depending on the payload type; for audio codecs, the channels and sample_rate fields are also filled.

Parameters
codecThe context of the codec
payload_typeThe payload type (the 'PT' field in the RTP header)
Returns
In case of unknown payload type or dynamic payload type, a negative value is returned; otherwise, 0 is returned

Definition at line 74 of file rtp.c.

int ff_rtp_get_payload_type ( AVFormatContext fmt,
AVCodecContext codec 
)

Return the payload type for a given codec used in the given format context.

Parameters
fmtThe context of the format
codecThe context of the codec
Returns
The payload type (the 'PT' field in the RTP header).

Definition at line 93 of file rtp.c.

Referenced by rtp_write_header().