33 #define MIN_FEEDBACK_INTERVAL 200000
70 rtp_first_dynamic_payload_handler =
handler;
122 for (handler = rtp_first_dynamic_payload_handler;
135 for (handler = rtp_first_dynamic_payload_handler;
152 if (payload_len < 20) {
154 "Invalid length for RTCP SR packet\n");
179 #define RTP_SEQ_MOD (1 << 16)
208 uint16_t udelta = seq - s->
max_seq;
209 const int MAX_DROPOUT = 3000;
210 const int MAX_MISORDER = 100;
211 const int MIN_SEQUENTIAL = 2;
228 }
else if (udelta < MAX_DROPOUT) {
230 if (seq < s->max_seq) {
253 uint32_t arrival_timestamp)
256 uint32_t transit = arrival_timestamp - sent_timestamp;
257 uint32_t prev_transit = s->
transit;
258 int32_t d = transit - prev_transit;
279 uint32_t extended_max;
280 uint32_t expected_interval;
281 uint32_t received_interval;
286 if ((!fd && !avio) || (count < 1))
314 expected = extended_max - stats->
base_seq;
316 lost =
FFMIN(lost, 0xffffff);
321 lost_interval = expected_interval - received_interval;
322 if (expected_interval == 0 || lost_interval <= 0)
325 fraction = (lost_interval << 8) / expected_interval;
327 fraction = (fraction << 24) | lost;
356 for (len = (7 + len) % 4; len % 4; len++)
363 if ((len > 0) && buf) {
365 av_dlog(s->
ic,
"sending %d bytes of RR\n", len);
367 av_dlog(s->
ic,
"result from ffurl_write: %d\n", result);
391 if ((len > 0) && buf)
406 if ((len > 0) && buf)
412 uint16_t *missing_mask)
415 uint16_t next_seq = s->
seq + 1;
418 if (!pkt || pkt->
seq == next_seq)
422 for (i = 1; i <= 16; i++) {
423 uint16_t missing_seq = next_seq + i;
425 int16_t
diff = pkt->
seq - missing_seq;
432 if (pkt->
seq == missing_seq)
434 *missing_mask |= 1 << (i - 1);
437 *first_missing = next_seq;
444 int len, need_keyframe, missing_packets;
448 uint16_t first_missing = 0, missing_mask = 0;
457 if (!need_keyframe && !missing_packets)
483 if (missing_packets) {
498 if (len > 0 && buf) {
510 int payload_type,
int queue_size)
598 int payload_type, seq,
flags = 0;
604 csrc = buf[0] & 0x0f;
606 payload_type = buf[1] & 0x7f;
623 "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
624 payload_type, seq, ((s->
seq + 1) & 0xffff));
629 int padding = buf[len - 1];
630 if (len >= 12 + padding)
649 ext = (
AV_RB16(buf + 2) + 1) << 2;
660 s->
st, pkt, ×tamp, buf, len, seq,
665 memcpy(pkt->
data, buf, len);
692 uint16_t seq =
AV_RB16(buf + 2);
697 int16_t
diff = seq - (*cur)->seq;
735 "RTP: missed %d packets\n", s->
queue->
seq - s->
seq - 1);
767 s->
st, pkt, ×tamp,
NULL, 0, 0,
797 uint16_t seq =
AV_RB16(buf + 2);
802 "RTP: dropping old packet received too late\n");
804 }
else if (diff <= 1) {
855 const char *attr,
const char *
value))
860 int value_size = strlen(p) + 1;
868 while (*p && *p ==
' ')
870 while (*p && *p !=
' ')
872 while (*p && *p ==
' ')
877 value, value_size)) {
878 res =
parse_fmtp(s, stream, data, attr, value);