#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 | |
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'. | |
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 | |
RTPDynamicProtocolHandler * | RTPFirstDynamicPayloadHandler |
#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 |
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.
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_*) |
typedef struct PayloadContext PayloadContext |
typedef struct RTPDemuxContext RTPDemuxContext |
typedef struct RTPDynamicProtocolHandler_s RTPDynamicProtocolHandler |
typedef struct rtp_payload_data RTPPayloadData |
Structure listing useful vars to parse RTP packet payload.
void av_register_rtp_dynamic_payload_handlers | ( | void | ) |
void ff_register_dynamic_payload_handler | ( | RTPDynamicProtocolHandler * | handler | ) |
Definition at line 56 of file rtpdec.c.
Referenced by av_register_rdt_dynamic_payload_handlers(), and av_register_rtp_dynamic_payload_handlers().
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 | |||
) |
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.
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.
s1 | media file context |
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.
s1 | media file context |
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.
s1 | media file context |
Definition at line 324 of file rtpproto.c.
Referenced by rtsp_cmd_setup().
void rtp_parse_close | ( | RTPDemuxContext * | s | ) |
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.
s | RTP parse context. | |
pkt | returned packet | |
buf | input buffer or NULL to read the next packets | |
len | buffer len |
< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned....
void rtp_parse_set_dynamic_protocol | ( | RTPDemuxContext * | s, | |
PayloadContext * | ctx, | |||
RTPDynamicProtocolHandler * | handler | |||
) |
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.
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.
s1 | media file context | |
uri | of the remote server |
Definition at line 60 of file rtpproto.c.