33 #define MIN_FEEDBACK_INTERVAL 200000
58 rtp_first_dynamic_payload_handler =
handler;
102 for (handler = rtp_first_dynamic_payload_handler;
114 for (handler = rtp_first_dynamic_payload_handler;
131 if (payload_len < 20) {
133 "Invalid length for RTCP SR packet\n");
158 #define RTP_SEQ_MOD (1 << 16)
187 uint16_t udelta = seq - s->
max_seq;
188 const int MAX_DROPOUT = 3000;
189 const int MAX_MISORDER = 100;
190 const int MIN_SEQUENTIAL = 2;
207 }
else if (udelta < MAX_DROPOUT) {
209 if (seq < s->max_seq) {
232 uint32_t arrival_timestamp)
235 uint32_t transit = arrival_timestamp - sent_timestamp;
236 uint32_t prev_transit = s->
transit;
237 int32_t d = transit - prev_transit;
258 uint32_t extended_max;
259 uint32_t expected_interval;
260 uint32_t received_interval;
265 if ((!fd && !avio) || (count < 1))
293 expected = extended_max - stats->
base_seq;
295 lost =
FFMIN(lost, 0xffffff);
300 lost_interval = expected_interval - received_interval;
301 if (expected_interval == 0 || lost_interval <= 0)
304 fraction = (lost_interval << 8) / expected_interval;
306 fraction = (fraction << 24) | lost;
335 for (len = (7 + len) % 4; len % 4; len++)
342 if ((len > 0) && buf) {
344 av_dlog(s->
ic,
"sending %d bytes of RR\n", len);
346 av_dlog(s->
ic,
"result from ffurl_write: %d\n", result);
370 if ((len > 0) && buf)
385 if ((len > 0) && buf)
391 uint16_t *missing_mask)
394 uint16_t next_seq = s->
seq + 1;
397 if (!pkt || pkt->
seq == next_seq)
401 for (i = 1; i <= 16; i++) {
402 uint16_t missing_seq = next_seq + i;
404 int16_t diff = pkt->
seq - missing_seq;
411 if (pkt->
seq == missing_seq)
413 *missing_mask |= 1 << (i - 1);
416 *first_missing = next_seq;
423 int len, need_keyframe, missing_packets;
427 uint16_t first_missing = 0, missing_mask = 0;
436 if (!need_keyframe && !missing_packets)
462 if (missing_packets) {
477 if (len > 0 && buf) {
489 int payload_type,
int queue_size)
577 int payload_type, seq,
flags = 0;
583 csrc = buf[0] & 0x0f;
585 payload_type = buf[1] & 0x7f;
602 "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
603 payload_type, seq, ((s->
seq + 1) & 0xffff));
608 int padding = buf[len - 1];
609 if (len >= 12 + padding)
628 ext = (
AV_RB16(buf + 2) + 1) << 2;
639 s->
st, pkt, ×tamp, buf, len, seq,
644 memcpy(pkt->
data, buf, len);
671 uint16_t seq =
AV_RB16(buf + 2);
676 int16_t diff = seq - (*cur)->
seq;
714 "RTP: missed %d packets\n", s->
queue->
seq - s->
seq - 1);
746 s->
st, pkt, ×tamp, NULL, 0, 0,
776 uint16_t seq =
AV_RB16(buf + 2);
777 int16_t diff = seq - s->
seq;
781 "RTP: dropping old packet received too late\n");
783 }
else if (diff <= 1) {
832 char *attr,
char *
value))
837 int value_size = strlen(p) + 1;
845 while (*p && *p ==
' ')
847 while (*p && *p !=
' ')
849 while (*p && *p ==
' ')
854 value, value_size)) {