libavformat/rtpdec.h File Reference

#include "libavcodec/avcodec.h"
#include "avformat.h"
#include "rtp.h"

Go to the source code of this file.

Data Structures

struct  rtp_payload_data
 Structure listing useful vars to parse RTP packet payload. More...
struct  rtp_payload_data::rtp_payload_data::AUHeaders
 mpeg 4 AU headers More...
struct  RTPStatistics
struct  RTPDynamicProtocolHandler_s
struct  RTPDemuxContext

Defines

#define RTP_MIN_PACKET_LENGTH   12
#define RTP_MAX_PACKET_LENGTH   1500
#define RTP_FLAG_KEY   0x1
 RTP packet contains a keyframe.
#define RTP_FLAG_MARKER   0x2
 RTP marker bit was set for this packet.

Typedefs

typedef struct rtp_payload_data RTPPayloadData
 Structure listing useful vars to parse RTP packet payload.
typedef struct PayloadContext PayloadContext
typedef struct
RTPDynamicProtocolHandler_s 
RTPDynamicProtocolHandler
typedef struct RTPDemuxContext RTPDemuxContext
typedef int(* DynamicPayloadPacketHandlerProc )(AVFormatContext *ctx, PayloadContext *s, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, int flags)
 Packet parsing for "private" payloads in the RTP specs.

Functions

RTPDemuxContextrtp_parse_open (AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, RTPPayloadData *rtp_payload_data)
 open a new RTP parse context for stream 'st'.
void rtp_parse_set_dynamic_protocol (RTPDemuxContext *s, PayloadContext *ctx, RTPDynamicProtocolHandler *handler)
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 rtp port used by the RTP connection.
int rtp_get_local_rtp_port (URLContext *h)
 Return the local rtp port used by the RTP connection.
int rtp_get_local_rtcp_port (URLContext *h)
 Return the local rtcp 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.
void rtp_send_punch_packets (URLContext *rtp_handle)
 Send a dummy packet on both port pairs to set up the connection state in potential NAT routers, so that we're able to receive packets.
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.
void ff_register_dynamic_payload_handler (RTPDynamicProtocolHandler *handler)
int ff_rtsp_next_attr_and_value (const char **p, char *attr, int attr_size, char *value, int value_size)
 from rtsp.c, but used by rtp dynamic protocol handlers.
void av_register_rtp_dynamic_payload_handlers (void)

Variables

RTPDynamicProtocolHandlerRTPFirstDynamicPayloadHandler


Define Documentation

#define RTP_FLAG_KEY   0x1

RTP packet contains a keyframe.

Definition at line 115 of file rtpdec.h.

Referenced by asfrtp_parse_packet(), ff_rdt_parse_packet(), and rdt_parse_packet().

#define RTP_FLAG_MARKER   0x2

RTP marker bit was set for this packet.

Definition at line 116 of file rtpdec.h.

Referenced by asfrtp_parse_packet(), and rtp_parse_packet().

#define RTP_MAX_PACKET_LENGTH   1500

Definition at line 61 of file rtpdec.h.

Referenced by rtp_parse_mp4_au().

#define RTP_MIN_PACKET_LENGTH   12

Definition at line 60 of file rtpdec.h.


Typedef Documentation

typedef int(* DynamicPayloadPacketHandlerProc)(AVFormatContext *ctx, PayloadContext *s, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, int flags)

Packet parsing for "private" payloads in the RTP specs.

Parameters:
ctx RTSP demuxer context
s stream context
st stream that this packet belongs to
pkt packet in which to write the parsed data
timestamp pointer in which to write the timestamp of this RTP packet
buf pointer to raw RTP packet data
len length of buf
flags flags from the RTP packet header (RTP_FLAG_*)

Definition at line 129 of file rtpdec.h.

Definition at line 57 of file rtpdec.h.

Definition at line 63 of file rtpdec.h.

Definition at line 58 of file rtpdec.h.

Structure listing useful vars to parse RTP packet payload.


Function Documentation

void av_register_rtp_dynamic_payload_handlers ( void   ) 

Definition at line 62 of file rtpdec.c.

Referenced by av_register_all().

void ff_register_dynamic_payload_handler ( RTPDynamicProtocolHandler handler  ) 

int ff_rtsp_next_attr_and_value ( const char **  p,
char *  attr,
int  attr_size,
char *  value,
int  value_size 
)

from rtsp.c, but used by rtp dynamic protocol handlers.

Definition at line 254 of file rtsp.c.

Referenced by amr_parse_sdp_line(), parse_h264_sdp_line(), sdp_parse_fmtp(), and xiph_parse_sdp_line().

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

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 361 of file rtpproto.c.

int rtp_get_local_port ( URLContext h  ) 

Return the local rtp port used by the RTP connection.

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

Definition at line 336 of file rtpproto.c.

int rtp_get_local_rtcp_port ( URLContext h  ) 

Return the local rtcp port used by the RTP connection.

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

Definition at line 348 of file rtpproto.c.

Referenced by rtsp_cmd_setup().

int rtp_get_local_rtp_port ( URLContext h  ) 

Return the local rtp port used by the RTP connection.

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

Definition at line 324 of file rtpproto.c.

Referenced by rtsp_cmd_setup().

void rtp_parse_close ( RTPDemuxContext s  ) 

Definition at line 606 of file rtpdec.c.

Referenced by ff_rtsp_close_streams().

RTPDemuxContext* rtp_parse_open ( AVFormatContext s1,
AVStream st,
URLContext rtpc,
int  payload_type,
RTPPayloadData 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 322 of file rtpdec.c.

Referenced by rtsp_open_transport_ctx().

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

void rtp_parse_set_dynamic_protocol ( RTPDemuxContext s,
PayloadContext ctx,
RTPDynamicProtocolHandler handler 
)

Definition at line 368 of file rtpdec.c.

Referenced by rtsp_open_transport_ctx().

void rtp_send_punch_packets ( URLContext rtp_handle  ) 

Send a dummy packet on both port pairs to set up the connection state in potential NAT routers, so that we're able to receive packets.

Note, this only works if the NAT router doesn't remap ports. This isn't a standardized procedure, but it works in many cases in practice.

The same routine is used with RDT too, even if RDT doesn't use normal RTP packets otherwise.

Definition at line 277 of file rtpdec.c.

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 60 of file rtpproto.c.


Variable Documentation

Definition at line 51 of file rtpdec.c.

Referenced by sdp_parse_rtpmap().


Generated on Fri Oct 26 02:36:55 2012 for FFmpeg by  doxygen 1.5.8