39 if (buf[2] !=
':' || buf[5] !=
':' || buf[8] !=
'.')
46 return ms - packet_time;
52 int buf_size = avpkt->
size;
54 const uint8_t *buf_end = buf + buf_size;
57 int64_t packet_time = 0;
62 if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) {
68 if (buf[0] !=
'[' || buf[13] !=
'-' || buf[26] !=
']') {
79 w = bytestream_get_le16(&
buf);
80 h = bytestream_get_le16(&
buf);
83 x = bytestream_get_le16(&
buf);
84 y = bytestream_get_le16(&
buf);
86 bytestream_get_le16(&
buf);
87 bytestream_get_le16(&
buf);
92 bytestream_get_le16(&
buf);
99 sub->rects[0] =
av_mallocz(
sizeof(*sub->rects[0]));
100 if (!sub->rects[0]) {
104 sub->rects[0]->x = x; sub->rects[0]->y =
y;
105 sub->rects[0]->w = w; sub->rects[0]->h = h;
107 sub->rects[0]->pict.linesize[0] = w;
108 sub->rects[0]->pict.data[0] =
av_malloc(w * h);
109 sub->rects[0]->nb_colors = 4;
111 if (!sub->rects[0]->pict.data[0] || !sub->rects[0]->pict.data[1]) {
120 for (i = 0; i < sub->rects[0]->nb_colors; i++)
121 ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&
buf);
125 for (i = 1; i < sub->rects[0]->nb_colors; i++)
126 ((uint32_t *)sub->rects[0]->pict.data[1])[i] |= 0xff000000;
128 for (i = 0; i < sub->rects[0]->nb_colors; i++)
129 ((uint32_t *)sub->rects[0]->pict.data[1])[i] |= *
buf++ << 24;
134 bitmap = sub->rects[0]->pict.data[0];
135 for (
y = 0;
y < h;
y++) {
137 if (
y == (h + 1) / 2) bitmap = sub->rects[0]->pict.data[0] + w;
138 for (x = 0; x < w; ) {
142 run =
FFMIN(run, w - x);
144 if (!run) run = w - x;
145 memset(bitmap, color, run);