#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "mpegts.h"
#include <unistd.h>
#include "network.h"
#include "rtpdec.h"
#include "rtpdec_amr.h"
#include "rtpdec_asf.h"
#include "rtpdec_h263.h"
#include "rtpdec_h264.h"
#include "rtpdec_xiph.h"
Go to the source code of this file.
Defines | |
#define | _XOPEN_SOURCE 600 |
#define | RTP_SEQ_MOD (1<<16) |
Functions | |
void | ff_register_dynamic_payload_handler (RTPDynamicProtocolHandler *handler) |
void | av_register_rtp_dynamic_payload_handlers (void) |
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. | |
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 | 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. | |
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) |
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) |
Variables | |
RTPDynamicProtocolHandler * | RTPFirstDynamicPayloadHandler = NULL |
static RTPDynamicProtocolHandler | mp4v_es_handler = {"MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4} |
static RTPDynamicProtocolHandler | mpeg4_generic_handler = {"mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC} |
#define RTP_SEQ_MOD (1<<16) |
Definition at line 89 of file rtpdec.c.
Referenced by rtp_init_sequence(), and rtp_valid_packet_in_sequence().
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().
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 430 of file rtpdec.c.
Referenced by rtp_parse_packet().
static int rtcp_parse_packet | ( | RTPDemuxContext * | s, | |
const unsigned char * | buf, | |||
int | len | |||
) | [static] |
int rtp_check_and_send_back_rr | ( | RTPDemuxContext * | s, | |
int | count | |||
) |
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 104 of file rtpdec.c.
Referenced by rtp_valid_packet_in_sequence().
static void rtp_init_statistics | ( | RTPStatistics * | s, | |
uint16_t | base_sequence | |||
) | [static] |
void rtp_parse_close | ( | RTPDemuxContext * | s | ) |
static int rtp_parse_mp4_au | ( | RTPDemuxContext * | s, | |
const uint8_t * | buf | |||
) | [static] |
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.
static int rtp_valid_packet_in_sequence | ( | RTPStatistics * | s, | |
uint16_t | seq | |||
) | [static] |
returns 1 if we should handle this packet.
Definition at line 120 of file rtpdec.c.
Referenced by rtp_parse_packet().
RTPDynamicProtocolHandler mp4v_es_handler = {"MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4} [static] |
RTPDynamicProtocolHandler mpeg4_generic_handler = {"mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC} [static] |