33 #define MIN_FEEDBACK_INTERVAL 200000
64 rtp_first_dynamic_payload_handler =
handler;
109 for (handler = rtp_first_dynamic_payload_handler;
121 for (handler = rtp_first_dynamic_payload_handler;
138 if (payload_len < 20) {
140 "Invalid length for RTCP SR packet\n");
165 #define RTP_SEQ_MOD (1 << 16)
194 uint16_t udelta = seq - s->
max_seq;
195 const int MAX_DROPOUT = 3000;
196 const int MAX_MISORDER = 100;
197 const int MIN_SEQUENTIAL = 2;
214 }
else if (udelta < MAX_DROPOUT) {
216 if (seq < s->max_seq) {
239 uint32_t arrival_timestamp)
242 uint32_t transit = arrival_timestamp - sent_timestamp;
243 uint32_t prev_transit = s->
transit;
244 int32_t d = transit - prev_transit;
265 uint32_t extended_max;
266 uint32_t expected_interval;
267 uint32_t received_interval;
272 if ((!fd && !avio) || (count < 1))
300 expected = extended_max - stats->
base_seq;
302 lost =
FFMIN(lost, 0xffffff);
307 lost_interval = expected_interval - received_interval;
308 if (expected_interval == 0 || lost_interval <= 0)
311 fraction = (lost_interval << 8) / expected_interval;
313 fraction = (fraction << 24) | lost;
342 for (len = (7 + len) % 4; len % 4; len++)
349 if ((len > 0) && buf) {
351 av_dlog(s->
ic,
"sending %d bytes of RR\n", len);
353 av_dlog(s->
ic,
"result from ffurl_write: %d\n", result);
377 if ((len > 0) && buf)
392 if ((len > 0) && buf)
398 uint16_t *missing_mask)
401 uint16_t next_seq = s->
seq + 1;
404 if (!pkt || pkt->
seq == next_seq)
408 for (i = 1; i <= 16; i++) {
409 uint16_t missing_seq = next_seq + i;
411 int16_t diff = pkt->
seq - missing_seq;
418 if (pkt->
seq == missing_seq)
420 *missing_mask |= 1 << (i - 1);
423 *first_missing = next_seq;
430 int len, need_keyframe, missing_packets;
434 uint16_t first_missing = 0, missing_mask = 0;
443 if (!need_keyframe && !missing_packets)
469 if (missing_packets) {
484 if (len > 0 && buf) {
496 int payload_type,
int queue_size)
584 int payload_type, seq,
flags = 0;
590 csrc = buf[0] & 0x0f;
592 payload_type = buf[1] & 0x7f;
609 "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
610 payload_type, seq, ((s->
seq + 1) & 0xffff));
615 int padding = buf[len - 1];
616 if (len >= 12 + padding)
635 ext = (
AV_RB16(buf + 2) + 1) << 2;
646 s->
st, pkt, ×tamp, buf, len, seq,
651 memcpy(pkt->
data, buf, len);
678 uint16_t seq =
AV_RB16(buf + 2);
683 int16_t diff = seq - (*cur)->
seq;
721 "RTP: missed %d packets\n", s->
queue->
seq - s->
seq - 1);
753 s->
st, pkt, ×tamp, NULL, 0, 0,
783 uint16_t seq =
AV_RB16(buf + 2);
784 int16_t diff = seq - s->
seq;
788 "RTP: dropping old packet received too late\n");
790 }
else if (diff <= 1) {
839 char *attr,
char *
value))
844 int value_size = strlen(p) + 1;
852 while (*p && *p ==
' ')
854 while (*p && *p !=
' ')
856 while (*p && *p ==
' ')
861 value, value_size)) {