Lines Matching defs:buf
153 AVBPrint buf;
155 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
156 ff_ass_bprint_text_event(&buf, text, strlen(text), "", 0);
157 if (!av_bprint_is_complete(&buf)) {
158 av_bprint_finalize(&buf, NULL);
161 dialog = ff_ass_get_dialog(ctx->readorder++, 0, NULL, NULL, buf.str);
162 av_bprint_finalize(&buf, NULL);
170 AVBPrint buf;
188 av_bprint_init(&buf, 0, TEXT_MAXSZ);
204 av_bprint_append_data(&buf, in, sz);
205 av_bprintf(&buf, "\n");
209 av_bprintf(&buf, "%s\n", vbi_text);
213 if (!av_bprint_is_complete(&buf)) {
214 av_bprint_finalize(&buf, NULL);
218 if (buf.len) {
220 sub_rect->ass = create_ass_text(ctx, buf.str);
223 av_bprint_finalize(&buf, NULL);
230 av_bprint_finalize(&buf, NULL);
234 static void bprint_color(const char *type, AVBPrint *buf, vbi_page *page, unsigned ci)
239 av_bprintf(buf, "{\\%s&H%02X%02X%02X&}", type, b, g, r);
265 static void decode_string(vbi_page *page, vbi_char *row, AVBPrint *buf,
274 bprint_color("c", buf, page, row[i].foreground);
278 bprint_color("3c", buf, page, row[i].background);
283 av_bprintf(buf, "\\h");
285 av_bprintf(buf, "\\%c", (char)out);
289 PUT_UTF8(out, tmp, av_bprint_chars(buf, tmp, 1););
308 AVBPrint buf;
310 av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
363 av_bprintf(&buf, "{\\an%d}", alignment + vertical_align * 3);
370 av_bprintf(&buf, " \\N");
379 decode_string(page, row, &buf, leading, page->columns - trailing, &cur_color, &cur_back_color);
380 av_bprintf(&buf, " \\N");
389 av_bprintf(&buf, " \\N");
391 if (!av_bprint_is_complete(&buf)) {
392 av_bprint_finalize(&buf, NULL);
396 if (buf.len) {
398 sub_rect->ass = ff_ass_get_dialog(ctx->readorder++, 0, is_subtitle_page ? "Subtitle" : "Teletext", NULL, buf.str);
401 av_bprint_finalize(&buf, NULL);
408 av_bprint_finalize(&buf, NULL);
584 static int slice_to_vbi_lines(TeletextContext *ctx, const uint8_t *buf, int size)
588 int data_unit_id = buf[0];
589 int data_unit_length = buf[1];
596 int line_offset = buf[2] & 0x1f;
597 int field_parity = buf[2] & 0x20;
603 p[i] = vbi_rev8(buf[4 + i]);
633 buf += data_unit_length + 2;