70 int start_partition, end_packet;
71 int extended_bits, part_id;
72 int pictureid_present = 0, tl0picidx_present = 0, tid_present = 0,
74 int pictureid = -1, pictureid_mask = 0;
75 int returned_old_frame = 0;
76 uint32_t old_timestamp = 0;
94 extended_bits = buf[0] & 0x80;
95 start_partition = buf[0] & 0x10;
96 part_id = buf[0] & 0x0f;
103 pictureid_present = buf[0] & 0x80;
104 tl0picidx_present = buf[0] & 0x40;
105 tid_present = buf[0] & 0x20;
106 keyidx_present = buf[0] & 0x10;
110 if (pictureid_present) {
116 pictureid =
AV_RB16(buf) & 0x7fff;
117 pictureid_mask = 0x7fff;
121 pictureid = buf[0] & 0x7f;
122 pictureid_mask = 0x7f;
127 if (tl0picidx_present) {
132 if (tid_present || keyidx_present) {
140 if (start_partition && part_id == 0 && len >= 3) {
142 int non_key = buf[0] & 0x01;
156 if (pictureid >= 0) {
159 "Missed a picture, sequence broken\n");
161 if (vp8->
data && !can_continue)
163 "Missed a picture, sequence broken\n");
166 uint16_t expected_seq = vp8->
prev_seq + 1;
167 int16_t
diff = seq - expected_seq;
176 if ((diff == 0 || diff == 1) && can_continue) {
180 "Missed too much, sequence broken\n");
185 "Missed unknown data, sequence broken\n");
195 returned_old_frame = 1;
211 uint16_t expected_seq = vp8->
prev_seq + 1;
219 "Received no start marker; dropping frame\n");
222 if (seq != expected_seq) {
225 "Missed part of a keyframe, sequence broken\n");
231 "Missed part of the first partition, sequence broken\n");
243 if (returned_old_frame) {
244 *timestamp = old_timestamp;
245 return end_packet ? 1 : 0;