libavformat/rtp.h File Reference

#include "avcodec.h"
#include "avformat.h"

Go to the source code of this file.

Data Structures

struct  rtp_payload_data_s
 Structure listing useful vars to parse RTP packet payload. More...
struct  rtp_payload_data_s::AUHeaders
 mpeg 4 AU headers More...

Defines

#define RTP_MIN_PACKET_LENGTH   12
#define RTP_MAX_PACKET_LENGTH   1500
#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

Typedefs

typedef struct RTPDemuxContext RTPDemuxContext
typedef struct rtp_payload_data_s rtp_payload_data_s
typedef struct rtp_payload_data_s rtp_payload_data_t
 Structure listing useful vars to parse RTP packet payload.

Functions

int rtp_get_codec_info (AVCodecContext *codec, int payload_type)
int rtp_get_payload_type (AVCodecContext *codec)
 return < 0 if unknown payload type
RTPDemuxContextrtp_parse_open (AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, rtp_payload_data_s *rtp_payload_data)
 open a new RTP parse context for stream 'st'.
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)
int rtp_get_local_port (URLContext *h)
 Return the local port used by the RTP connection.
int rtp_set_remote_url (URLContext *h, const char *uri)
 If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address.
void rtp_get_file_handles (URLContext *h, int *prtp_fd, int *prtcp_fd)
 Return the rtp and rtcp file handles for select() usage to wait for several RTP streams at the same time.
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.


Define Documentation

#define RTCP_TX_RATIO_DEN   1000

Definition at line 59 of file rtp.h.

Referenced by rtp_check_and_send_back_rr(), and rtp_write_packet().

#define RTCP_TX_RATIO_NUM   5

Definition at line 58 of file rtp.h.

Referenced by rtp_check_and_send_back_rr(), and rtp_write_packet().

#define RTP_MAX_PACKET_LENGTH   1500

Definition at line 28 of file rtp.h.

Referenced by rtp_parse_mp4_au(), and rtsp_read_packet().

#define RTP_MAX_SDES   256

maximum text length for SDES

Definition at line 55 of file rtp.h.

#define RTP_MIN_PACKET_LENGTH   12

Definition at line 27 of file rtp.h.

#define RTP_PT_PRIVATE   96

Definition at line 53 of file rtp.h.

Referenced by rtp_write_header(), sdp_parse_line(), and sdp_parse_rtpmap().

#define RTP_VERSION   2

Definition at line 54 of file rtp.h.

Referenced by ff_rtp_send_data(), rtcp_send_sr(), rtp_check_and_send_back_rr(), and rtp_parse_packet().


Typedef Documentation

Definition at line 36 of file rtp.h.

Structure listing useful vars to parse RTP packet payload.

Definition at line 35 of file rtp.h.


Function Documentation

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 164 of file rtpdec.c.

Referenced by rtsp_read_packet().

int rtp_get_codec_info ( AVCodecContext codec,
int  payload_type 
)

Definition at line 174 of file rtp.c.

Referenced by sdp_parse_line().

void rtp_get_file_handles ( URLContext h,
int *  prtp_fd,
int *  prtcp_fd 
)

Return the rtp and rtcp file handles for select() usage to wait for several RTP streams at the same time.

Parameters:
h media file context

Definition at line 285 of file rtpproto.c.

Referenced by udp_read_packet().

int rtp_get_local_port ( URLContext h  ) 

Return the local port used by the RTP connection.

Parameters:
s1 media file context
Returns:
the local port number

Definition at line 274 of file rtpproto.c.

Referenced by rtsp_cmd_setup(), and rtsp_read_header().

int rtp_get_payload_type ( AVCodecContext codec  ) 

return < 0 if unknown payload type

Definition at line 193 of file rtp.c.

Referenced by rtp_write_header().

void rtp_parse_close ( RTPDemuxContext s  ) 

Definition at line 545 of file rtpdec.c.

Referenced by rtsp_close_streams().

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 270 of file rtpdec.c.

Referenced by rtsp_read_header(), and sdp_read_header().

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

< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned....

Definition at line 401 of file rtpdec.c.

Referenced by rtsp_read_packet().

int rtp_set_remote_url ( URLContext h,
const char *  uri 
)

If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address.

Parameters:
s1 media file context
uri of the remote server
Returns:
zero if no error.

Definition at line 47 of file rtpproto.c.

Referenced by rtsp_read_header().


Generated on Fri Apr 23 15:12:03 2010 for ffmpeg by  doxygen 1.5.6