#include "libavcodec/avcodec.h"
#include "avformat.h"
#include "rtp.h"
#include "url.h"
Go to the source code of this file.
Data Structures | |
struct | RTPStatistics |
struct | RTPDynamicProtocolHandler_s |
struct | RTPPacket |
struct | RTPDemuxContext |
Defines | |
#define | RTP_MIN_PACKET_LENGTH 12 |
#define | RTP_MAX_PACKET_LENGTH 1500 |
#define | RTP_REORDER_QUEUE_DEFAULT_SIZE 10 |
#define | RTP_NOTS_VALUE ((uint32_t)-1) |
#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 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. | |
typedef struct RTPPacket | RTPPacket |
Functions | |
RTPDemuxContext * | ff_rtp_parse_open (AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, int queue_size) |
open a new RTP parse context for stream 'st'. | |
void | ff_rtp_parse_set_dynamic_protocol (RTPDemuxContext *s, PayloadContext *ctx, RTPDynamicProtocolHandler *handler) |
int | ff_rtp_parse_packet (RTPDemuxContext *s, AVPacket *pkt, uint8_t **buf, int len) |
Parse an RTP or RTCP packet directly sent as a buffer. | |
void | ff_rtp_parse_close (RTPDemuxContext *s) |
int64_t | ff_rtp_queued_packet_time (RTPDemuxContext *s) |
void | ff_rtp_reset_packet_queue (RTPDemuxContext *s) |
int | ff_rtp_get_local_rtp_port (URLContext *h) |
Return the local rtp port used by the RTP connection. | |
int | ff_rtp_get_local_rtcp_port (URLContext *h) |
Return the local rtcp port used by the RTP connection. | |
int | ff_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 | ff_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 | ff_rtp_check_and_send_back_rr (RTPDemuxContext *s, int count) |
some rtp servers assume client is dead if they don't hear from them... | |
int | ff_rtp_get_rtcp_file_handle (URLContext *h) |
Get the file handle for the RTCP socket. | |
void | ff_register_dynamic_payload_handler (RTPDynamicProtocolHandler *handler) |
RTPDynamicProtocolHandler * | ff_rtp_handler_find_by_name (const char *name, enum AVMediaType codec_type) |
RTPDynamicProtocolHandler * | ff_rtp_handler_find_by_id (int id, enum AVMediaType codec_type) |
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. | |
int | ff_parse_fmtp (AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVStream *stream, PayloadContext *data, char *attr, char *value)) |
void | av_register_rtp_dynamic_payload_handlers (void) |
#define RTP_FLAG_KEY 0x1 |
RTP packet contains a keyframe.
Definition at line 93 of file rtpdec.h.
Referenced by qt_rtp_parse_packet().
#define RTP_FLAG_MARKER 0x2 |
RTP marker bit was set for this packet.
Definition at line 94 of file rtpdec.h.
Referenced by asfrtp_parse_packet(), and latm_parse_packet().
#define RTP_MAX_PACKET_LENGTH 1500 |
Definition at line 34 of file rtpdec.h.
Referenced by rtp_parse_mp4_au().
#define RTP_NOTS_VALUE ((uint32_t)-1) |
Definition at line 38 of file rtpdec.h.
Referenced by finalize_packet().
#define RTP_REORDER_QUEUE_DEFAULT_SIZE 10 |
Definition at line 36 of file rtpdec.h.
Referenced by rtsp_open_transport_ctx().
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 |
void av_register_rtp_dynamic_payload_handlers | ( | void | ) |
Definition at line 61 of file rtpdec.c.
Referenced by av_register_all().
int ff_parse_fmtp | ( | AVStream * | stream, | |
PayloadContext * | data, | |||
const char * | p, | |||
int(*)(AVStream *stream, PayloadContext *data, char *attr, char *value) | parse_fmtp | |||
) |
Definition at line 757 of file rtpdec.c.
Referenced by amr_parse_sdp_line(), latm_parse_sdp_line(), parse_h264_sdp_line(), parse_sdp_line(), and xiph_parse_sdp_line().
void ff_register_dynamic_payload_handler | ( | RTPDynamicProtocolHandler * | handler | ) |
Definition at line 55 of file rtpdec.c.
Referenced by av_register_rdt_dynamic_payload_handlers(), and av_register_rtp_dynamic_payload_handlers().
int ff_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 226 of file rtpdec.c.
Referenced by ff_rtsp_fetch_packet().
int ff_rtp_get_local_rtcp_port | ( | URLContext * | h | ) |
Return the local rtcp port used by the RTP connection.
h | media file context |
Definition at line 308 of file rtpproto.c.
Referenced by rtsp_cmd_setup().
int ff_rtp_get_local_rtp_port | ( | URLContext * | h | ) |
Return the local rtp port used by the RTP connection.
h | media file context |
Definition at line 296 of file rtpproto.c.
Referenced by ff_rtsp_make_setup_request(), and rtsp_cmd_setup().
int ff_rtp_get_rtcp_file_handle | ( | URLContext * | h | ) |
Get the file handle for the RTCP socket.
Definition at line 320 of file rtpproto.c.
Referenced by udp_read_packet().
RTPDynamicProtocolHandler* ff_rtp_handler_find_by_id | ( | int | id, | |
enum AVMediaType | codec_type | |||
) |
Definition at line 105 of file rtpdec.c.
Referenced by sdp_parse_line().
RTPDynamicProtocolHandler* ff_rtp_handler_find_by_name | ( | const char * | name, | |
enum AVMediaType | codec_type | |||
) |
Definition at line 93 of file rtpdec.c.
Referenced by sdp_parse_rtpmap().
void ff_rtp_parse_close | ( | RTPDemuxContext * | s | ) |
Definition at line 748 of file rtpdec.c.
Referenced by ff_rtsp_undo_setup().
RTPDemuxContext* ff_rtp_parse_open | ( | AVFormatContext * | s1, | |
AVStream * | st, | |||
URLContext * | rtpc, | |||
int | payload_type, | |||
int | queue_size | |||
) |
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)
Definition at line 367 of file rtpdec.c.
Referenced by rtsp_open_transport_ctx().
int ff_rtp_parse_packet | ( | RTPDemuxContext * | s, | |
AVPacket * | pkt, | |||
uint8_t ** | bufptr, | |||
int | len | |||
) |
Parse an RTP or RTCP packet directly sent as a buffer.
s | RTP parse context. | |
pkt | returned packet | |
bufptr | pointer to the input buffer or NULL to read the next packets | |
len | buffer len |
Definition at line 738 of file rtpdec.c.
Referenced by ff_rtsp_fetch_packet().
void ff_rtp_parse_set_dynamic_protocol | ( | RTPDemuxContext * | s, | |
PayloadContext * | ctx, | |||
RTPDynamicProtocolHandler * | handler | |||
) |
Definition at line 415 of file rtpdec.c.
Referenced by rtsp_open_transport_ctx().
int64_t ff_rtp_queued_packet_time | ( | RTPDemuxContext * | s | ) |
Definition at line 626 of file rtpdec.c.
Referenced by ff_rtsp_fetch_packet().
void ff_rtp_reset_packet_queue | ( | RTPDemuxContext * | s | ) |
Definition at line 579 of file rtpdec.c.
Referenced by ff_rtp_parse_close(), and rtsp_read_play().
void ff_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 323 of file rtpdec.c.
Referenced by ff_rtsp_make_setup_request().
int ff_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.
h | media file context | |
uri | of the remote server |
Definition at line 63 of file rtpproto.c.
Referenced by ff_rtsp_make_setup_request().
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 263 of file rtsp.c.
Referenced by ff_parse_fmtp().