80 #define OFFSET(x) offsetof(TestSourceContext, x)
81 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
83 #define SIZE_OPTIONS \
84 { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
85 { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS },\
87 #define COMMON_OPTIONS_NOSIZE \
88 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },\
89 { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },\
90 { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },\
91 { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64 = -1}, -1, INT64_MAX, FLAGS },\
92 { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX, FLAGS },
94 #define COMMON_OPTIONS SIZE_OPTIONS COMMON_OPTIONS_NOSIZE
127 outlink->
w = test->
w;
128 outlink->
h = test->
h;
177 #if CONFIG_COLOR_FILTER
179 static const AVOption color_options[] = {
193 0, 0, test->
w, test->
h);
230 char *res,
int res_len,
int flags)
235 if (!strcmp(cmd,
"color") || !strcmp(cmd,
"c")) {
242 memcpy(test->
color_rgba, color_rgba,
sizeof(color_rgba));
256 .config_props = color_config_props,
264 .priv_class = &color_class,
276 #if CONFIG_HALDCLUTSRC_FILTER
278 static const AVOption haldclutsrc_options[] = {
288 int i, j, k, x = 0, y = 0, is16bit = 0, step;
293 const int w = frame->
width;
296 const int linesize = frame->
linesize[0];
321 scale = ((float)(1 << (8*(is16bit+1))) - 1) / (level*level - 1);
323 #define LOAD_CLUT(nbits) do { \
324 uint##nbits##_t *dst = ((uint##nbits##_t *)(data + y*linesize)) + x*step; \
325 dst[rgba_map[0]] = av_clip_uint##nbits(i * scale); \
326 dst[rgba_map[1]] = av_clip_uint##nbits(j * scale); \
327 dst[rgba_map[2]] = av_clip_uint##nbits(k * scale); \
329 dst[rgba_map[3]] = alpha; \
333 for (k = 0; k <
level; k++) {
334 for (j = 0; j <
level; j++) {
335 for (i = 0; i <
level; i++) {
376 static int haldclutsrc_config_props(
AVFilterLink *outlink)
390 .config_props = haldclutsrc_config_props,
396 .
name =
"haldclutsrc",
398 .priv_class = &haldclutsrc_class,
400 .
init = haldclutsrc_init,
404 .
outputs = haldclutsrc_outputs,
408 #if CONFIG_NULLSRC_FILTER
410 #define nullsrc_options options
436 .init = nullsrc_init,
439 .priv_class = &nullsrc_class,
446 #if CONFIG_TESTSRC_FILTER
448 static const AVOption testsrc_options[] = {
470 int x,
int y,
int w,
int h)
475 dst += segment_width * (step * x + y * dst_linesize);
476 w *= segment_width * step;
478 for (i = 0; i <
h; i++) {
484 static void draw_digit(
int digit,
uint8_t *dst,
int dst_linesize,
490 #define LEFT_TOP_VBAR 8
491 #define LEFT_BOT_VBAR 16
492 #define RIGHT_TOP_VBAR 32
493 #define RIGHT_BOT_VBAR 64
505 static const unsigned char masks[10] = {
506 TOP_HBAR |BOT_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
507 RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
508 TOP_HBAR|MID_HBAR|BOT_HBAR|LEFT_BOT_VBAR |RIGHT_TOP_VBAR,
509 TOP_HBAR|MID_HBAR|BOT_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
510 MID_HBAR |LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
511 TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_BOT_VBAR,
512 TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR |RIGHT_BOT_VBAR,
513 TOP_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
514 TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
515 TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
517 unsigned mask = masks[digit];
524 segments[i].x, segments[i].y, segments[i].w, segments[i].h);
527 #define GRADIENT_SIZE (6 * 256)
534 int color, color_rest;
538 int dquad_x, dquad_y;
539 int grad, dgrad, rgrad, drgrad;
548 radius = (width +
height) / 4;
549 quad0 = width * width / 4 + height * height / 4 - radius * radius;
552 for (y = 0; y <
height; y++) {
558 for (x = 0; x <
width; x++) {
564 *(p++) = icolor & 1 ? 255 : 0;
565 *(p++) = icolor & 2 ? 255 : 0;
566 *(p++) = icolor & 4 ? 255 : 0;
568 if (color_rest >= width) {
579 p0 = p = data + frame->
linesize[0] * (height * 3/4);
583 dgrad = GRADIENT_SIZE /
width;
584 drgrad = GRADIENT_SIZE %
width;
585 for (x = 0; x <
width; x++) {
587 grad < 256 || grad >= 5 * 256 ? 255 :
588 grad >= 2 * 256 && grad < 4 * 256 ? 0 :
589 grad < 2 * 256 ? 2 * 256 - 1 - grad : grad - 4 * 256;
591 grad >= 4 * 256 ? 0 :
592 grad >= 1 * 256 && grad < 3 * 256 ? 255 :
593 grad < 1 * 256 ? grad : 4 * 256 - 1 - grad;
596 grad >= 3 * 256 && grad < 5 * 256 ? 255 :
597 grad < 3 * 256 ? grad - 2 * 256 : 6 * 256 - 1 - grad;
600 if (rgrad >= GRADIENT_SIZE) {
602 rgrad -= GRADIENT_SIZE;
604 if (grad >= GRADIENT_SIZE)
605 grad -= GRADIENT_SIZE;
608 for (y = height / 8; y > 0; y--) {
609 memcpy(p+frame->
linesize[0], p, 3 * width);
614 seg_size = width / 80;
615 if (seg_size >= 1 && height >= 13 * seg_size) {
616 int64_t p10decimals = 1;
626 x = width - (width - seg_size * 64) / 2;
627 y = (height - seg_size * 13) / 2;
628 p = data + (x*3 + y * frame->
linesize[0]);
629 for (i = 0; i < 8; i++) {
630 p -= 3 * 8 * seg_size;
631 draw_digit(second % 10, p, frame->
linesize[0], seg_size);
659 static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = {
673 .priv_class = &testsrc_class,
678 .
outputs = avfilter_vsrc_testsrc_outputs,
683 #if CONFIG_TESTSRC2_FILTER
685 static const AVOption testsrc2_options[] = {
694 uint8_t rgba[4] = { (argb >> 16) & 0xFF,
697 (argb >> 24) & 0xFF, };
701 static uint32_t color_gradient(
unsigned index)
703 unsigned si = index & 0xFF, sd = 0xFF - si;
704 switch (index >> 8) {
705 case 0:
return 0xFF0000 + (si << 8);
706 case 1:
return 0x00FF00 + (sd << 16);
707 case 2:
return 0x00FF00 + (si << 0);
708 case 3:
return 0x0000FF + (sd << 8);
709 case 4:
return 0x0000FF + (si << 16);
710 case 5:
return 0xFF0000 + (sd << 0);
716 int x0,
int y0,
const uint8_t *text)
720 for (; *text; text++) {
740 unsigned i, x = 0, x2;
743 for (i = 1; i < 7; i++) {
746 set_color(s, &color, ((i & 1) ? 0xFF0000 : 0) |
747 ((i & 2) ? 0x00FF00 : 0) |
748 ((i & 4) ? 0x0000FF : 0));
750 x, 0, x2 - x, frame->
height);
758 unsigned x, dx, y0, y, g0,
g;
763 for (x = 0; x < s->
w; x += dx) {
764 g = (
av_rescale(x, 6 * 256, s->
w) + g0) % (6 * 256);
765 set_color(s, &color, color_gradient(g));
767 y %= 2 * (s->
h - 16);
769 y = 2 * (s->
h - 16) - y;
777 if (s->
w >= 64 && s->
h >= 64) {
778 int l = (
FFMIN(s->
w, s->
h) - 32) >> 1;
779 int steps =
FFMAX(4, l >> 5);
780 int xc = (s->
w >> 2) + (s->
w >> 1);
781 int yc = (s->
h >> 2);
786 for (c = 0; c < 3; c++) {
787 set_color(s, &color, 0xBBBBBB ^ (0xFF << (c << 3)));
789 xh = pos < 1 * l ? pos :
791 pos < 3 * l ? 3 * l - pos : 0;
792 yh = pos < 1 * l ? 0 :
793 pos < 2 * l ? pos - l :
798 for (i = 1; i <= steps; i++) {
810 if (s->
w >= 64 && s->
h >= 64) {
811 int l = (
FFMIN(s->
w, s->
h) - 16) >> 2;
813 int xc = (s->
w >> 2);
814 int yc = (s->
h >> 2) + (s->
h >> 1);
819 int size, step, x1, x2, y1, y2;
826 step = (step >> 1) & 3;
827 set_color(s, &color, 0xFF808080);
832 if (step == 0 || step == 2)
834 x1, ym1, x2 - x1, ym2 - ym1);
835 if (step == 1 || step == 2)
837 xm1, y1, xm2 - xm1, y2 - y1);
840 x1, y1, x2 - x1, y2 - y1);
853 for (y = ymin; y < ymax - 15; y += 16) {
854 for (x = xmin; x < xmax - 15; x += 16) {
857 for (i = 0; i < 256; i++) {
858 r = r * 1664525 + 1013904223;
861 set_color(s, &color, 0xFF00FF80);
864 alpha, 16, 16, 16, 3, 0, x, y);
870 if (s->
w >= 16 && s->
h >= 16) {
871 unsigned w = s->
w - 8;
872 unsigned h = s->
h - 8;
881 set_color(s, &color, 0xFF8000FF);
892 set_color(s, &color, 0xC0000000);
896 set_color(s, &color, 0xFFFF8000);
897 snprintf(buf,
sizeof(buf),
"%02d:%02d:%02d.%03d\n%12"PRIi64,
898 time / 3600000, (time / 60000) % 60, (time / 1000) % 60,
899 time % 1000, s->
pts);
929 static const AVFilterPad avfilter_vsrc_testsrc2_outputs[] = {
934 .config_props = test2_config_props,
943 .priv_class = &testsrc2_class,
948 .
outputs = avfilter_vsrc_testsrc2_outputs,
953 #if CONFIG_RGBTESTSRC_FILTER
955 #define rgbtestsrc_options options
963 static void rgbtest_put_pixel(
uint8_t *dst,
int dst_linesize,
971 case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4);
break;
972 case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4);
break;
973 case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3);
break;
974 case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3);
break;
975 case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3);
break;
976 case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3);
break;
979 v = (r << (rgba_map[
R]*8)) + (g << (rgba_map[
G]*8)) + (b << (rgba_map[
B]*8));
980 p = dst + 3*x + y*dst_linesize;
987 v = (r << (rgba_map[
R]*8)) + (g << (rgba_map[
G]*8)) + (b << (rgba_map[
B]*8)) + (255 << (rgba_map[
A]*8));
988 p = dst + 4*x + y*dst_linesize;
999 for (y = 0; y <
h; y++) {
1000 for (x = 0; x < w; x++) {
1002 int r = 0, g = 0, b = 0;
1004 if (3*y < h ) r =
c;
1005 else if (3*y < 2*h) g =
c;
1008 rgbtest_put_pixel(frame->
data[0], frame->
linesize[0], x, y, r, g, b,
1048 static const AVFilterPad avfilter_vsrc_rgbtestsrc_outputs[] = {
1053 .config_props = rgbtest_config_props,
1059 .
name =
"rgbtestsrc",
1062 .priv_class = &rgbtestsrc_class,
1063 .
init = rgbtest_init,
1067 .
outputs = avfilter_vsrc_rgbtestsrc_outputs,
1072 #if CONFIG_SMPTEBARS_FILTER || CONFIG_SMPTEHDBARS_FILTER
1074 static const uint8_t rainbow[7][4] = {
1075 { 180, 128, 128, 255 },
1076 { 161, 44, 141, 255 },
1077 { 131, 156, 44, 255 },
1078 { 112, 72, 57, 255 },
1079 { 83, 183, 198, 255 },
1080 { 65, 99, 212, 255 },
1081 { 34, 212, 114, 255 },
1084 static const uint8_t rainbowhd[7][4] = {
1085 { 180, 128, 128, 255 },
1086 { 168, 44, 136, 255 },
1087 { 145, 147, 44, 255 },
1088 { 133, 63, 52, 255 },
1089 { 63, 193, 204, 255 },
1090 { 51, 109, 212, 255 },
1091 { 28, 212, 120, 255 },
1094 static const uint8_t wobnair[7][4] = {
1095 { 34, 212, 114, 255 },
1096 { 19, 128, 128, 255 },
1097 { 83, 183, 198, 255 },
1098 { 19, 128, 128, 255 },
1099 { 131, 156, 44, 255 },
1100 { 19, 128, 128, 255 },
1101 { 180, 128, 128, 255 },
1104 static const uint8_t white[4] = { 235, 128, 128, 255 };
1107 static const uint8_t neg4ire[4] = { 7, 128, 128, 255 };
1108 static const uint8_t pos4ire[4] = { 24, 128, 128, 255 };
1111 static const uint8_t i_pixel[4] = { 57, 156, 97, 255 };
1112 static const uint8_t q_pixel[4] = { 44, 171, 147, 255 };
1114 static const uint8_t gray40[4] = { 104, 128, 128, 255 };
1115 static const uint8_t gray15[4] = { 49, 128, 128, 255 };
1116 static const uint8_t cyan[4] = { 188, 154, 16, 255 };
1117 static const uint8_t yellow[4] = { 219, 16, 138, 255 };
1118 static const uint8_t blue[4] = { 32, 240, 118, 255 };
1119 static const uint8_t red[4] = { 63, 102, 240, 255 };
1120 static const uint8_t black0[4] = { 16, 128, 128, 255 };
1121 static const uint8_t black2[4] = { 20, 128, 128, 255 };
1122 static const uint8_t black4[4] = { 25, 128, 128, 255 };
1123 static const uint8_t neg2[4] = { 12, 128, 128, 255 };
1126 int x,
int y,
int w,
int h,
1133 x =
FFMIN(x, test->
w - 1);
1134 y =
FFMIN(y, test->
h - 1);
1135 w =
FFMIN(w, test->
w - x);
1136 h =
FFMIN(h, test->
h - y);
1141 for (plane = 0; frame->
data[
plane]; plane++) {
1142 const int c = color[
plane];
1144 int i, px, py, pw, ph;
1146 if (plane == 1 || plane == 2) {
1158 p0 = p = frame->
data[
plane] + py * linesize + px;
1161 for (i = 1; i < ph; i++, p += linesize)
1191 #if CONFIG_SMPTEBARS_FILTER
1193 #define smptebars_options options
1199 int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;
1208 p_h = test->
h - w_h - r_h;
1210 for (i = 0; i < 7; i++) {
1211 draw_bar(test, rainbow[i], x, 0, r_w, r_h, picref);
1212 draw_bar(test, wobnair[i], x, r_h, r_w, w_h, picref);
1216 draw_bar(test, i_pixel, x, r_h + w_h, p_w, p_h, picref);
1218 draw_bar(test, white, x, r_h + w_h, p_w, p_h, picref);
1220 draw_bar(test, q_pixel, x, r_h + w_h, p_w, p_h, picref);
1223 draw_bar(test, black0, x, r_h + w_h, tmp, p_h, picref);
1226 draw_bar(test, neg4ire, x, r_h + w_h, tmp, p_h, picref);
1228 draw_bar(test, black0, x, r_h + w_h, tmp, p_h, picref);
1230 draw_bar(test, pos4ire, x, r_h + w_h, tmp, p_h, picref);
1232 draw_bar(test, black0, x, r_h + w_h, test->
w - x, p_h, picref);
1245 .
name =
"smptebars",
1248 .priv_class = &smptebars_class,
1249 .
init = smptebars_init,
1258 #if CONFIG_SMPTEHDBARS_FILTER
1260 #define smptehdbars_options options
1266 int d_w, r_w, r_h, l_w, i, tmp, x = 0, y = 0;
1273 draw_bar(test, gray40, x, 0, d_w, r_h, picref);
1277 for (i = 0; i < 7; i++) {
1278 draw_bar(test, rainbowhd[i], x, 0, r_w, r_h, picref);
1281 draw_bar(test, gray40, x, 0, test->
w - x, r_h, picref);
1284 draw_bar(test, cyan, 0, y, d_w, r_h, picref);
1286 draw_bar(test, i_pixel, x, y, r_w, r_h, picref);
1289 draw_bar(test, rainbowhd[0], x, y, tmp, r_h, picref);
1292 draw_bar(test, blue, x, y, test->
w - x, r_h, picref);
1294 draw_bar(test, yellow, 0, y, d_w, r_h, picref);
1296 draw_bar(test, q_pixel, x, y, r_w, r_h, picref);
1302 yramp[0] = i * 255 / tmp;
1307 draw_bar(test, yramp, x, y, 1 << pixdesc->
log2_chroma_w, r_h, picref);
1310 draw_bar(test, red, x, y, test->
w - x, r_h, picref);
1312 draw_bar(test, gray15, 0, y, d_w, test->
h - y, picref);
1315 draw_bar(test, black0, x, y, tmp, test->
h - y, picref);
1318 draw_bar(test, white, x, y, tmp, test->
h - y, picref);
1321 draw_bar(test, black0, x, y, tmp, test->
h - y, picref);
1324 draw_bar(test, neg2, x, y, tmp, test->
h - y, picref);
1326 draw_bar(test, black0, x, y, tmp, test->
h - y, picref);
1328 draw_bar(test, black2, x, y, tmp, test->
h - y, picref);
1330 draw_bar(test, black0, x, y, tmp, test->
h - y, picref);
1332 draw_bar(test, black4, x, y, tmp, test->
h - y, picref);
1335 draw_bar(test, black0, x, y, r_w, test->
h - y, picref);
1337 draw_bar(test, gray15, x, y, test->
w - x, test->
h - y, picref);
1350 .
name =
"smptehdbars",
1353 .priv_class = &smptehdbars_class,
1354 .
init = smptehdbars_init,
1364 #if CONFIG_ALLYUV_FILTER
1366 static const AVOption allyuv_options[] = {
1380 for (y = 0; y < 4096; y++) {
1381 for (x = 0; x < 2048; x++) {
1382 frame->
data[0][y * ys + x] = ((x / 8) % 256);
1383 frame->
data[0][y * ys + 4095 - x] = ((x / 8) % 256);
1386 for (x = 0; x < 2048; x+=8) {
1387 for (j = 0; j < 8; j++) {
1388 frame->
data[1][vs * y + x + j] = (y%16 + (j % 8) * 16);
1389 frame->
data[1][vs * y + 4095 - x - j] = (128 + y%16 + (j % 8) * 16);
1393 for (x = 0; x < 4096; x++)
1394 frame->
data[2][y * us + x] = 256 * y / 4096;
1402 test->
w = test->
h = 4096;
1421 static const AVFilterPad avfilter_vsrc_allyuv_outputs[] = {
1435 .priv_class = &allyuv_class,
1436 .
init = allyuv_init,
1440 .
outputs = avfilter_vsrc_allyuv_outputs,
1445 #if CONFIG_ALLRGB_FILTER
1447 static const AVOption allrgb_options[] = {
1457 const int linesize = frame->
linesize[0];
1460 for (y = 0; y < 4096; y++) {
1463 for (x = 0; x < 4096; x++) {
1466 *dst++ = (x >> 8) | ((y >> 8) << 4);
1476 test->
w = test->
h = 4096;
1502 static const AVFilterPad avfilter_vsrc_allrgb_outputs[] = {
1507 .config_props = allrgb_config_props,
1516 .priv_class = &allrgb_class,
1517 .
init = allrgb_init,
1521 .
outputs = avfilter_vsrc_allrgb_outputs,
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVFilterFormats * ff_draw_supported_pixel_formats(unsigned flags)
Return the list of pixel formats supported by the draw functions.
const char const char void * val
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Main libavfilter public API header.
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_PIX_FMT_RGBA64
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
int h
agreed upon image height
static void draw_rectangle(AVFormatContext *s)
static av_cold void uninit(AVFilterContext *ctx)
#define AV_PIX_FMT_BGRA64
static int draw_text(AVFilterContext *ctx, AVFrame *frame, int width, int height)
#define COMMON_OPTIONS_NOSIZE
const uint8_t avpriv_vga16_font[4096]
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
int draw_once
draw only the first frame, always put out the same picture
#define AV_PIX_FMT_RGB444
static AVRational av_make_q(int num, int den)
Create a rational.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static av_cold int init(AVFilterContext *ctx)
int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir, int value)
Round a dimension according to subsampling.
const char * name
Pad name.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int draw_once_reset
draw only the first frame or in case of reset
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
static double av_q2d(AVRational a)
Convert rational to double.
static int request_frame(AVFilterLink *outlink)
#define AVERROR_EOF
End of file.
#define AV_LOG_VERBOSE
Detailed information.
int interlaced_frame
The content of the picture is interlaced.
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx)
Put the RGBA values that correspond to color_string in rgba_color.
A filter pad used for either input or output.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
static double alpha(void *priv, double x, double y)
int width
width and height of the video frame
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
static const uint16_t mask[17]
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
void * priv
private data for use by the filter
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel for the pixel format described by pixdesc, including any padding ...
void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
Prepare a color.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
simple assert() macros that are a bit more flexible than ISO C assert().
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
AVRational sar
sample aspect ratio
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
enum AVPictureType pict_type
Picture type of the frame.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static void test(const char *pattern, const char *host)
int64_t duration
duration expressed in microseconds
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
static int config_props(AVFilterLink *outlink)
packed RGB 8:8:8, 24bpp, BGRBGR...
AVFilterContext * src
source filter
static const AVFilterPad outputs[]
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
int format
agreed upon media format
#define FF_ARRAY_ELEMS(a)
int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt)
void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_w, int dst_h, const uint8_t *mask, int mask_linesize, int mask_w, int mask_h, int l2depth, unsigned endianness, int x0, int y0)
Blend an alpha mask with an uniform color.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
#define AV_PIX_FMT_BGR555
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const AVFilterPad inputs[]
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
BYTE int const BYTE int int int height
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Describe the class of an AVClass context structure.
rational number numerator/denominator
void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_w, int dst_h, int x0, int y0, int w, int h)
Blend a rectangle with an uniform color.
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
const char * name
Filter name.
int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
Init a draw context.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterLink ** outputs
array of pointers to output links
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_BGR565
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int query_formats(AVFilterContext *ctx)
common internal and external API header
#define AV_PIX_FMT_BGR444
static const AVOption options[]
#define AV_PIX_FMT_RGB555
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
#define AVFILTER_DEFINE_CLASS(fname)
int key_frame
1 -> keyframe, 0-> not
void(* fill_picture_fn)(AVFilterContext *ctx, AVFrame *frame)
#define AV_PIX_FMT_RGB565
void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, uint8_t *dst[], int dst_linesize[], int dst_x, int dst_y, int w, int h)
Fill a rectangle with an uniform color.
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
AVFrame * picref
cached reference containing the painted picture
AVPixelFormat
Pixel format.
CGA/EGA/VGA ROM font data.
#define AV_CEIL_RSHIFT(a, b)