33 #define MIN_FEEDBACK_INTERVAL 200000
64 rtp_first_dynamic_payload_handler =
handler;
111 for (handler = rtp_first_dynamic_payload_handler;
123 for (handler = rtp_first_dynamic_payload_handler;
140 if (payload_len < 20) {
142 "Invalid length for RTCP SR packet\n");
167 #define RTP_SEQ_MOD (1 << 16)
196 uint16_t udelta = seq - s->
max_seq;
197 const int MAX_DROPOUT = 3000;
198 const int MAX_MISORDER = 100;
199 const int MIN_SEQUENTIAL = 2;
216 }
else if (udelta < MAX_DROPOUT) {
218 if (seq < s->max_seq) {
241 uint32_t arrival_timestamp)
244 uint32_t transit = arrival_timestamp - sent_timestamp;
245 uint32_t prev_transit = s->
transit;
246 int32_t d = transit - prev_transit;
267 uint32_t extended_max;
268 uint32_t expected_interval;
269 uint32_t received_interval;
274 if ((!fd && !avio) || (count < 1))
302 expected = extended_max - stats->
base_seq;
304 lost =
FFMIN(lost, 0xffffff);
309 lost_interval = expected_interval - received_interval;
310 if (expected_interval == 0 || lost_interval <= 0)
313 fraction = (lost_interval << 8) / expected_interval;
315 fraction = (fraction << 24) | lost;
344 for (len = (7 + len) % 4; len % 4; len++)
351 if ((len > 0) && buf) {
353 av_dlog(s->
ic,
"sending %d bytes of RR\n", len);
355 av_dlog(s->
ic,
"result from ffurl_write: %d\n", result);
379 if ((len > 0) && buf)
394 if ((len > 0) && buf)
400 uint16_t *missing_mask)
403 uint16_t next_seq = s->
seq + 1;
406 if (!pkt || pkt->
seq == next_seq)
410 for (i = 1; i <= 16; i++) {
411 uint16_t missing_seq = next_seq + i;
413 int16_t diff = pkt->
seq - missing_seq;
420 if (pkt->
seq == missing_seq)
422 *missing_mask |= 1 << (i - 1);
425 *first_missing = next_seq;
432 int len, need_keyframe, missing_packets;
436 uint16_t first_missing = 0, missing_mask = 0;
445 if (!need_keyframe && !missing_packets)
471 if (missing_packets) {
486 if (len > 0 && buf) {
498 int payload_type,
int queue_size)
586 int payload_type, seq,
flags = 0;
592 csrc = buf[0] & 0x0f;
594 payload_type = buf[1] & 0x7f;
611 "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
612 payload_type, seq, ((s->
seq + 1) & 0xffff));
617 int padding = buf[len - 1];
618 if (len >= 12 + padding)
637 ext = (
AV_RB16(buf + 2) + 1) << 2;
648 s->
st, pkt, ×tamp, buf, len, seq,
653 memcpy(pkt->
data, buf, len);
680 uint16_t seq =
AV_RB16(buf + 2);
685 int16_t diff = seq - (*cur)->
seq;
723 "RTP: missed %d packets\n", s->
queue->
seq - s->
seq - 1);
755 s->
st, pkt, ×tamp, NULL, 0, 0,
785 uint16_t seq =
AV_RB16(buf + 2);
786 int16_t diff = seq - s->
seq;
790 "RTP: dropping old packet received too late\n");
792 }
else if (diff <= 1) {
843 char *attr,
char *
value))
848 int value_size = strlen(p) + 1;
856 while (*p && *p ==
' ')
858 while (*p && *p !=
' ')
860 while (*p && *p ==
' ')
865 value, value_size)) {
866 res =
parse_fmtp(s, stream, data, attr, value);