FFmpeg
|
#include "libavutil/mathematics.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/time.h"
#include "avformat.h"
#include "network.h"
#include "srtp.h"
#include "url.h"
#include "rtpdec.h"
#include "rtpdec_formats.h"
Go to the source code of this file.
Macros | |
#define | MIN_FEEDBACK_INTERVAL 200000 /* 200 ms in us */ |
#define | RTP_SEQ_MOD (1 << 16) |
Functions | |
const RTPDynamicProtocolHandler * | ff_rtp_handler_iterate (void **opaque) |
Iterate over all registered rtp dynamic protocol handlers. More... | |
const RTPDynamicProtocolHandler * | ff_rtp_handler_find_by_name (const char *name, enum AVMediaType codec_type) |
Find a registered rtp dynamic protocol handler with the specified name. More... | |
const RTPDynamicProtocolHandler * | ff_rtp_handler_find_by_id (int id, enum AVMediaType codec_type) |
Find a registered rtp dynamic protocol handler with a matching codec ID. More... | |
static int | rtcp_parse_packet (RTPDemuxContext *s, const unsigned char *buf, int len) |
static void | rtp_init_statistics (RTPStatistics *s, uint16_t base_sequence) |
static void | rtp_init_sequence (RTPStatistics *s, uint16_t seq) |
static int | rtp_valid_packet_in_sequence (RTPStatistics *s, uint16_t seq) |
static void | rtcp_update_jitter (RTPStatistics *s, uint32_t sent_timestamp, uint32_t arrival_timestamp) |
int | ff_rtp_check_and_send_back_rr (RTPDemuxContext *s, URLContext *fd, AVIOContext *avio, int count) |
some rtp servers assume client is dead if they don't hear from them... More... | |
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. More... | |
static int | find_missing_packets (RTPDemuxContext *s, uint16_t *first_missing, uint16_t *missing_mask) |
int | ff_rtp_send_rtcp_feedback (RTPDemuxContext *s, URLContext *fd, AVIOContext *avio) |
RTPDemuxContext * | ff_rtp_parse_open (AVFormatContext *s1, AVStream *st, int payload_type, int queue_size) |
open a new RTP parse context for stream 'st'. More... | |
void | ff_rtp_parse_set_dynamic_protocol (RTPDemuxContext *s, PayloadContext *ctx, const RTPDynamicProtocolHandler *handler) |
void | ff_rtp_parse_set_crypto (RTPDemuxContext *s, const char *suite, const char *params) |
static void | finalize_packet (RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp) |
This was the second switch in rtp_parse packet. More... | |
static int | rtp_parse_packet_internal (RTPDemuxContext *s, AVPacket *pkt, const uint8_t *buf, int len) |
void | ff_rtp_reset_packet_queue (RTPDemuxContext *s) |
static int | enqueue_packet (RTPDemuxContext *s, uint8_t *buf, int len) |
static int | has_next_packet (RTPDemuxContext *s) |
int64_t | ff_rtp_queued_packet_time (RTPDemuxContext *s) |
static int | rtp_parse_queued_packet (RTPDemuxContext *s, AVPacket *pkt) |
static int | rtp_parse_one_packet (RTPDemuxContext *s, AVPacket *pkt, uint8_t **bufptr, int len) |
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. More... | |
void | ff_rtp_parse_close (RTPDemuxContext *s) |
int | ff_parse_fmtp (AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value)) |
int | ff_rtp_finalize_packet (AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx) |
Close the dynamic buffer and make a packet from it. More... | |
const RTPDynamicProtocolHandler* ff_rtp_handler_iterate | ( | void ** | opaque | ) |
Iterate over all registered rtp dynamic protocol handlers.
opaque | a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. |
Definition at line 135 of file rtpdec.c.
Referenced by ff_rtp_handler_find_by_id(), and ff_rtp_handler_find_by_name().
const RTPDynamicProtocolHandler* ff_rtp_handler_find_by_name | ( | const char * | name, |
enum AVMediaType | codec_type | ||
) |
const RTPDynamicProtocolHandler* ff_rtp_handler_find_by_id | ( | int | id, |
enum AVMediaType | codec_type | ||
) |
|
static |
Definition at line 173 of file rtpdec.c.
Referenced by rtp_parse_one_packet().
|
static |
Definition at line 210 of file rtpdec.c.
Referenced by ff_rtp_parse_open().
|
static |
Definition at line 221 of file rtpdec.c.
Referenced by rtp_valid_packet_in_sequence().
|
static |
Definition at line 235 of file rtpdec.c.
Referenced by rtp_parse_packet_internal().
|
static |
Definition at line 281 of file rtpdec.c.
Referenced by rtp_parse_one_packet().
int ff_rtp_check_and_send_back_rr | ( | RTPDemuxContext * | s, |
URLContext * | fd, | ||
AVIOContext * | avio, | ||
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 URLContext or AVIOContext (we don't have access to the rtcp handle from here)
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 402 of file rtpdec.c.
Referenced by rtsp_read_play().
|
static |
Definition at line 438 of file rtpdec.c.
Referenced by ff_rtp_send_rtcp_feedback().
int ff_rtp_send_rtcp_feedback | ( | RTPDemuxContext * | s, |
URLContext * | fd, | ||
AVIOContext * | avio | ||
) |
RTPDemuxContext* ff_rtp_parse_open | ( | AVFormatContext * | s1, |
AVStream * | st, | ||
int | payload_type, | ||
int | queue_size | ||
) |
open a new RTP parse context for stream 'st'.
'st' can be NULL for MPEG-2 TS streams.
Definition at line 536 of file rtpdec.c.
Referenced by ff_rtsp_open_transport_ctx().
void ff_rtp_parse_set_dynamic_protocol | ( | RTPDemuxContext * | s, |
PayloadContext * | ctx, | ||
const RTPDynamicProtocolHandler * | handler | ||
) |
Definition at line 572 of file rtpdec.c.
Referenced by ff_rtsp_open_transport_ctx().
void ff_rtp_parse_set_crypto | ( | RTPDemuxContext * | s, |
const char * | suite, | ||
const char * | params | ||
) |
Definition at line 579 of file rtpdec.c.
Referenced by ff_rtsp_open_transport_ctx().
|
static |
This was the second switch in rtp_parse packet.
Normalizes time, if required, sets stream_index, etc.
Definition at line 590 of file rtpdec.c.
Referenced by rtp_parse_one_packet(), and rtp_parse_packet_internal().
|
static |
Definition at line 625 of file rtpdec.c.
Referenced by rtp_parse_one_packet(), and rtp_parse_queued_packet().
void ff_rtp_reset_packet_queue | ( | RTPDemuxContext * | s | ) |
Definition at line 708 of file rtpdec.c.
Referenced by ff_rtp_parse_close(), and rtsp_read_play().
|
static |
Definition at line 721 of file rtpdec.c.
Referenced by rtp_parse_one_packet().
|
static |
Definition at line 748 of file rtpdec.c.
Referenced by ff_rtp_parse_packet(), and rtp_parse_queued_packet().
int64_t ff_rtp_queued_packet_time | ( | RTPDemuxContext * | s | ) |
|
static |
Definition at line 758 of file rtpdec.c.
Referenced by ff_rtp_parse_packet(), and rtp_parse_one_packet().
|
static |
Definition at line 780 of file rtpdec.c.
Referenced by ff_rtp_parse_packet().
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 |
void ff_rtp_parse_close | ( | RTPDemuxContext * | s | ) |
Definition at line 880 of file rtpdec.c.
Referenced by ff_rtsp_undo_setup().
int ff_parse_fmtp | ( | AVFormatContext * | s, |
AVStream * | stream, | ||
PayloadContext * | data, | ||
const char * | p, | ||
int(*)(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value) | parse_fmtp | ||
) |
Definition at line 887 of file rtpdec.c.
Referenced by amr_parse_sdp_line(), dv_parse_sdp_line(), hevc_parse_sdp_line(), ilbc_parse_sdp_line(), latm_parse_sdp_line(), parse_h264_sdp_line(), parse_sdp_line(), rfc4175_parse_sdp_line(), and xiph_parse_sdp_line().
int ff_rtp_finalize_packet | ( | AVPacket * | pkt, |
AVIOContext ** | dyn_buf, | ||
int | stream_idx | ||
) |
Close the dynamic buffer and make a packet from it.
Definition at line 925 of file rtpdec.c.
Referenced by ac3_handle_packet(), dv_handle_packet(), h261_handle_packet(), h263_handle_packet(), jpeg_parse_packet(), mpa_robust_parse_packet(), svq3_parse_packet(), vc2hq_handle_frame_fragment(), vp8_handle_packet(), vp9_handle_packet(), and xiph_handle_packet().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
RTPDynamicProtocolHandler ff_rdt_video_handler |
RTPDynamicProtocolHandler ff_rdt_audio_handler |
RTPDynamicProtocolHandler ff_rdt_live_video_handler |
RTPDynamicProtocolHandler ff_rdt_live_audio_handler |
|
static |
Definition at line 77 of file rtpdec.c.
Referenced by ff_rtp_handler_iterate().