33 static const uint8_t
tc_offsets[9] = { 0, 1, 3, 4, 6, 7, 9, 10, 11 };
34 static const uint8_t
tc_muls[9] = { 10, 6, 10, 6, 10, 10, 10, 10, 1 };
39 if (buf[2] !=
':' || buf[5] !=
':' || buf[8] !=
'.')
46 return ms - packet_time;
51 const uint8_t *buf = avpkt->
data;
52 int buf_size = avpkt->
size;
54 const uint8_t *buf_end = buf + buf_size;
56 int w, h, x, y, rlelen, i;
57 int64_t packet_time = 0;
60 memset(sub, 0,
sizeof(*sub));
63 if (buf_size < 27 + 7 * 2 + 4 * 3) {
69 if (buf[0] !=
'[' || buf[13] !=
'-' || buf[26] !=
']') {
80 w = bytestream_get_le16(&buf);
81 h = bytestream_get_le16(&buf);
84 x = bytestream_get_le16(&buf);
85 y = bytestream_get_le16(&buf);
87 bytestream_get_le16(&buf);
88 bytestream_get_le16(&buf);
89 rlelen = bytestream_get_le16(&buf);
93 sub->rects[0] =
av_mallocz(
sizeof(*sub->rects[0]));
95 sub->rects[0]->x = x; sub->rects[0]->y = y;
96 sub->rects[0]->w = w; sub->rects[0]->h = h;
98 sub->rects[0]->pict.linesize[0] = w;
99 sub->rects[0]->pict.data[0] =
av_malloc(w * h);
100 sub->rects[0]->nb_colors = 4;
104 for (i = 0; i < sub->rects[0]->nb_colors; i++)
105 ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf);
107 for (i = 1; i < sub->rects[0]->nb_colors; i++)
108 ((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff000000;
111 rlelen =
FFMIN(rlelen, buf_end - buf);
113 bitmap = sub->rects[0]->pict.data[0];
114 for (y = 0; y < h; y++) {
116 if (y == (h + 1) / 2) bitmap = sub->rects[0]->pict.data[0] + w;
117 for (x = 0; x < w; ) {
121 run =
FFMIN(run, w - x);
123 if (!run) run = w - x;
124 memset(bitmap, color, run);