22 #ifndef AVFORMAT_RTPDEC_H
23 #define AVFORMAT_RTPDEC_H
33 #define RTP_MIN_PACKET_LENGTH 12
34 #define RTP_MAX_PACKET_LENGTH 1500
36 #define RTP_REORDER_QUEUE_DEFAULT_SIZE 10
38 #define RTP_NOTS_VALUE ((uint32_t)-1)
93 #define RTP_FLAG_KEY 0x1
94 #define RTP_FLAG_MARKER 0x2
107 typedef int (*DynamicPayloadPacketHandlerProc) (AVFormatContext *ctx,
206 char *attr,
char *value));
int queue_size
The size of queue, or 0 if reordering is disabled.
int(* parse_sdp_a_line)(AVFormatContext *s, int st_index, PayloadContext *priv_data, const char *line)
Parse the a= line from the sdp field.
void(* free)(PayloadContext *protocol_data)
free any data needed by the rtp parsing for this dynamic data.
RTPDynamicProtocolHandler * ff_rtp_handler_find_by_name(const char *name, enum AVMediaType codec_type)
#define RTP_MAX_PACKET_LENGTH
int64_t range_start_offset
int prev_ret
Fields for packet reordering.
RTP/H264 specific private data.
unsigned int last_octet_count
RTPPacket * queue
A sorted queue of buffered packets not yet returned.
enum AVMediaType codec_type
enum AVMediaType codec_type
int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s)
struct MpegTSContext * ts
uint32_t cycles
shifted count of sequence number cycles
DynamicPayloadPacketHandlerProc parse_packet
parse handler for this dynamic packet.
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...
PayloadContext * dynamic_protocol_context
This is a copy from the values setup from the sdp parsing, in rtsp.c don't free me.
DynamicPayloadPacketHandlerProc parse_packet
This is also copied from the dynamic protocol handler structure.
uint32_t base_seq
base sequence number
int ff_rtp_get_rtcp_file_handle(URLContext *h)
Get the file handle for the RTCP socket.
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_rtp_get_local_rtcp_port(URLContext *h)
Return the local rtcp port used by the RTP connection.
int received
packets received
int ff_parse_fmtp(AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVStream *stream, PayloadContext *data, char *attr, char *value))
int ff_rtp_get_local_rtp_port(URLContext *h)
Return the local rtp port used by the RTP connection.
void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, RTPDynamicProtocolHandler *handler)
int max_frames_per_packet
int probation
sequence packets till source is valid
void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler)
int(* init)(AVFormatContext *s, int st_index, PayloadContext *priv_data)
Initialize dynamic protocol handler, called after the full rtpmap line is parsed. ...
uint32_t transit
relative transit time for previous packet
uint32_t jitter
estimated jitter.
int queue_len
The number of packets in queue.
void ff_rtp_reset_packet_queue(RTPDemuxContext *s)
int64_t first_rtcp_ntp_time
void av_register_rtp_dynamic_payload_handlers(void)
int64_t last_rtcp_ntp_time
uint8_t buf[RTP_MAX_PACKET_LENGTH]
unsigned int packet_count
int64_t unwrapped_timestamp
uint32_t last_rtcp_timestamp
static int parse_fmtp(AVStream *stream, PayloadContext *data, char *attr, char *value)
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
void ff_rtp_parse_close(RTPDemuxContext *s)
RTPDynamicProtocolHandler * ff_rtp_handler_find_by_id(int id, enum AVMediaType codec_type)
RTPStatistics statistics
Statistics for this stream (used by RTCP receiver reports)
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.
uint32_t bad_seq
last bad sequence number + 1
uint16_t max_seq
highest sequence number seen
struct RTPDynamicProtocolHandler_s * next
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_send_punch_packets(URLContext *rtp_handle)
Send a dummy packet on both port pairs to set up the connection state in potential NAT routers...
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'.
struct RTPPacket RTPPacket
CodecID
Identify the syntax and semantics of the bitstream.
int received_prior
packets received in last interval
unbuffered private I/O API
int expected_prior
packets expected in last interval
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...