rtp.c File Reference

Go to the source code of this file.

Functions

static void register_dynamic_payload_handler (RTPDynamicProtocolHandler *handler)
void av_register_rtp_dynamic_payload_handlers (void)
int rtp_get_codec_info (AVCodecContext *codec, int payload_type)
int rtp_get_payload_type (AVCodecContext *codec)
 return < 0 if unknown payload type
const char * ff_rtp_enc_name (int payload_type)
enum CodecID ff_rtp_codec_id (const char *buf, enum CodecType codec_type)
static int rtcp_parse_packet (RTPDemuxContext *s, const unsigned char *buf, int len)
static void rtp_init_statistics (RTPStatistics *s, uint16_t base_sequence)
 called on parse open packet
static void rtp_init_sequence (RTPStatistics *s, uint16_t seq)
 called whenever there is a large jump in sequence numbers, or when they get out of probation.
static int rtp_valid_packet_in_sequence (RTPStatistics *s, uint16_t seq)
 returns 1 if we should handle this packet.
static void rtcp_update_jitter (RTPStatistics *s, uint32_t sent_timestamp, uint32_t arrival_timestamp)
 This function is currently unused; without a valid local ntp time, I don't see how we could calculate the difference between the arrival and sent timestamp.
int rtp_check_and_send_back_rr (RTPDemuxContext *s, int count)
 some rtp servers assume client is dead if they don't hear from them.
RTPDemuxContextrtp_parse_open (AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_t *rtp_payload_data)
 open a new RTP parse context for stream 'st'.
static int rtp_parse_mp4_au (RTPDemuxContext *s, const uint8_t *buf)
static void finalize_packet (RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp)
 This was the second switch in rtp_parse packet.
int rtp_parse_packet (RTPDemuxContext *s, AVPacket *pkt, const uint8_t *buf, int len)
 Parse an RTP or RTCP packet directly sent as a buffer.
void rtp_parse_close (RTPDemuxContext *s)
static int rtp_write_header (AVFormatContext *s1)
static void rtcp_send_sr (AVFormatContext *s1, int64_t ntp_time)
void ff_rtp_send_data (AVFormatContext *s1, const uint8_t *buf1, int len, int m)
static void rtp_send_samples (AVFormatContext *s1, const uint8_t *buf1, int size, int sample_size)
static void rtp_send_mpegaudio (AVFormatContext *s1, const uint8_t *buf1, int size)
static void rtp_send_raw (AVFormatContext *s1, const uint8_t *buf1, int size)
static void rtp_send_mpegts_raw (AVFormatContext *s1, const uint8_t *buf1, int size)
static int rtp_write_packet (AVFormatContext *s1, AVPacket *pkt)

Variables

AVRtpPayloadType_t AVRtpPayloadTypes []
RTPDynamicProtocolHandlerRTPFirstDynamicPayloadHandler = NULL
static RTPDynamicProtocolHandler mp4v_es_handler = {"MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4}
static RTPDynamicProtocolHandler mpeg4_generic_handler = {"mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC}
AVOutputFormat rtp_muxer


Function Documentation

static void register_dynamic_payload_handler ( RTPDynamicProtocolHandler handler  )  [static]

Definition at line 187 of file rtp.c.

Referenced by av_register_rtp_dynamic_payload_handlers().

void av_register_rtp_dynamic_payload_handlers ( void   ) 

Definition at line 193 of file rtp.c.

Referenced by av_register_all().

int rtp_get_codec_info ( AVCodecContext codec,
int  payload_type 
)

Definition at line 200 of file rtp.c.

Referenced by sdp_parse_line().

int rtp_get_payload_type ( AVCodecContext codec  ) 

return < 0 if unknown payload type

Definition at line 219 of file rtp.c.

Referenced by rtp_write_header(), and sdp_write_media().

const char* ff_rtp_enc_name ( int  payload_type  ) 

Definition at line 234 of file rtp.c.

Referenced by rtp_parse_close(), rtp_parse_open(), and sdp_parse_line().

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

Definition at line 246 of file rtp.c.

Referenced by sdp_parse_rtpmap().

static int rtcp_parse_packet ( RTPDemuxContext s,
const unsigned char *  buf,
int  len 
) [static]

Definition at line 258 of file rtp.c.

Referenced by rtp_parse_packet().

static void rtp_init_statistics ( RTPStatistics s,
uint16_t  base_sequence 
) [static]

called on parse open packet

Definition at line 274 of file rtp.c.

Referenced by rtp_parse_open().

static void rtp_init_sequence ( RTPStatistics s,
uint16_t  seq 
) [static]

called whenever there is a large jump in sequence numbers, or when they get out of probation.

..

Definition at line 284 of file rtp.c.

Referenced by rtp_valid_packet_in_sequence().

static int rtp_valid_packet_in_sequence ( RTPStatistics s,
uint16_t  seq 
) [static]

returns 1 if we should handle this packet.

Definition at line 300 of file rtp.c.

Referenced by rtp_parse_packet().

static void rtcp_update_jitter ( RTPStatistics s,
uint32_t  sent_timestamp,
uint32_t  arrival_timestamp 
) [static]

This function is currently unused; without a valid local ntp time, I don't see how we could calculate the difference between the arrival and sent timestamp.

As a result, the jitter and transit statistics values never change. I left this in in case someone else can see a way. (rdm)

Definition at line 351 of file rtp.c.

int rtp_check_and_send_back_rr ( RTPDemuxContext s,
int  count 
)

some rtp servers assume client is dead if they don't hear from them.

.. so we send a Receiver Report to the provided ByteIO context (we don't have access to the rtcp handle from here)

Definition at line 361 of file rtp.c.

Referenced by rtsp_read_packet().

RTPDemuxContext* rtp_parse_open ( AVFormatContext s1,
AVStream st,
URLContext rtpc,
int  payload_type,
rtp_payload_data_t rtp_payload_data 
)

open a new RTP parse context for stream 'st'.

'st' can be NULL for MPEG2TS streams to indicate that they should be demuxed inside the rtp demux (otherwise CODEC_ID_MPEG2TS packets are returned) TODO: change this to not take rtp_payload data, and use the new dynamic payload system.

Definition at line 467 of file rtp.c.

Referenced by rtsp_read_header(), and sdp_read_header().

static int rtp_parse_mp4_au ( RTPDemuxContext s,
const uint8_t *  buf 
) [static]

Definition at line 507 of file rtp.c.

Referenced by rtp_parse_packet().

static void finalize_packet ( RTPDemuxContext s,
AVPacket pkt,
uint32_t  timestamp 
) [static]

This was the second switch in rtp_parse packet.

Normalizes time, if required, sets stream_index, etc.

Definition at line 558 of file rtp.c.

Referenced by rtp_parse_packet().

int rtp_parse_packet ( RTPDemuxContext s,
AVPacket pkt,
const uint8_t *  buf,
int  len 
)

Parse an RTP or RTCP packet directly sent as a buffer.

Parameters:
s RTP parse context.
pkt returned packet
buf input buffer or NULL to read the next packets
len buffer len
Returns:
0 if a packet is returned, 1 if a packet is returned and more can follow (use buf as NULL to read the next). -1 if no packet (error or no more packet).

Definition at line 598 of file rtp.c.

Referenced by rtsp_read_packet().

void rtp_parse_close ( RTPDemuxContext s  ) 

Definition at line 744 of file rtp.c.

Referenced by rtsp_close_streams().

static int rtp_write_header ( AVFormatContext s1  )  [static]

Definition at line 755 of file rtp.c.

static void rtcp_send_sr ( AVFormatContext s1,
int64_t  ntp_time 
) [static]

Definition at line 828 of file rtp.c.

Referenced by rtp_write_packet().

void ff_rtp_send_data ( AVFormatContext s1,
const uint8_t *  buf1,
int  len,
int  m 
)

static void rtp_send_samples ( AVFormatContext s1,
const uint8_t *  buf1,
int  size,
int  sample_size 
) [static]

Definition at line 880 of file rtp.c.

Referenced by rtp_write_packet().

static void rtp_send_mpegaudio ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
) [static]

Definition at line 908 of file rtp.c.

Referenced by rtp_write_packet().

static void rtp_send_raw ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
) [static]

Definition at line 960 of file rtp.c.

Referenced by rtp_write_packet().

static void rtp_send_mpegts_raw ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
) [static]

Definition at line 982 of file rtp.c.

Referenced by rtp_write_packet().

static int rtp_write_packet ( AVFormatContext s1,
AVPacket pkt 
) [static]

Definition at line 1006 of file rtp.c.


Variable Documentation

Definition at line 47 of file rtp.c.

Definition at line 182 of file rtp.c.

Referenced by sdp_parse_rtpmap().

RTPDynamicProtocolHandler mp4v_es_handler = {"MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4} [static]

Definition at line 184 of file rtp.c.

RTPDynamicProtocolHandler mpeg4_generic_handler = {"mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC} [static]

Definition at line 185 of file rtp.c.

Initial value:

 {
    "rtp",
    "RTP output format",
    NULL,
    NULL,
    sizeof(RTPDemuxContext),
    CODEC_ID_PCM_MULAW,
    CODEC_ID_NONE,
    rtp_write_header,
    rtp_write_packet,
}

Definition at line 1064 of file rtp.c.


Generated on Sat Dec 18 05:15:55 2010 for MythTV by  doxygen 1.5.5