You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

550 lines
19KB

  1. /*
  2. * Copyright (c) 2007 Nicolas George <nicolas.george@normalesup.org>
  3. * Copyright (c) 2011 Stefano Sabatini
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * Misc test sources.
  24. *
  25. * testsrc is based on the test pattern generator demuxer by Nicolas George:
  26. * http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2007-October/037845.html
  27. *
  28. * rgbtestsrc is ported from MPlayer libmpcodecs/vf_rgbtest.c by
  29. * Michael Niedermayer.
  30. */
  31. #include <float.h>
  32. #include "libavutil/opt.h"
  33. #include "libavutil/intreadwrite.h"
  34. #include "libavutil/parseutils.h"
  35. #include "avfilter.h"
  36. #include "formats.h"
  37. #include "internal.h"
  38. #include "video.h"
  39. typedef struct {
  40. const AVClass *class;
  41. int w, h;
  42. unsigned int nb_frame;
  43. AVRational time_base;
  44. int64_t pts, max_pts;
  45. char *rate; ///< video frame rate
  46. char *duration; ///< total duration of the generated video
  47. AVRational sar; ///< sample aspect ratio
  48. int nb_decimals;
  49. void (* fill_picture_fn)(AVFilterContext *ctx, AVFilterBufferRef *picref);
  50. /* only used by rgbtest */
  51. int rgba_map[4];
  52. } TestSourceContext;
  53. #define OFFSET(x) offsetof(TestSourceContext, x)
  54. static const AVOption testsrc_options[]= {
  55. { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
  56. { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
  57. { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
  58. { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 },
  59. { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
  60. { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 },
  61. { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX },
  62. /* only used by testsrc */
  63. { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
  64. { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX },
  65. { NULL },
  66. };
  67. static av_cold int init(AVFilterContext *ctx, const char *args)
  68. {
  69. TestSourceContext *test = ctx->priv;
  70. AVRational frame_rate_q;
  71. int64_t duration = -1;
  72. int ret = 0;
  73. av_opt_set_defaults(test);
  74. if ((ret = (av_set_options_string(test, args, "=", ":"))) < 0) {
  75. av_log(ctx, AV_LOG_ERROR, "Error parsing options string: '%s'\n", args);
  76. return ret;
  77. }
  78. if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0) {
  79. av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);
  80. return ret;
  81. }
  82. if (test->duration && (ret = av_parse_time(&duration, test->duration, 1)) < 0) {
  83. av_log(ctx, AV_LOG_ERROR, "Invalid duration: '%s'\n", test->duration);
  84. return ret;
  85. }
  86. if (test->nb_decimals && strcmp(ctx->filter->name, "testsrc")) {
  87. av_log(ctx, AV_LOG_WARNING,
  88. "Option 'decimals' is ignored with source '%s'\n",
  89. ctx->filter->name);
  90. }
  91. test->time_base.num = frame_rate_q.den;
  92. test->time_base.den = frame_rate_q.num;
  93. test->max_pts = duration >= 0 ?
  94. av_rescale_q(duration, AV_TIME_BASE_Q, test->time_base) : -1;
  95. test->nb_frame = 0;
  96. test->pts = 0;
  97. av_log(ctx, AV_LOG_VERBOSE, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
  98. test->w, test->h, frame_rate_q.num, frame_rate_q.den,
  99. duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
  100. test->sar.num, test->sar.den);
  101. return 0;
  102. }
  103. static av_cold void uninit(AVFilterContext *ctx)
  104. {
  105. TestSourceContext *test = ctx->priv;
  106. av_opt_free(test);
  107. }
  108. static int config_props(AVFilterLink *outlink)
  109. {
  110. TestSourceContext *test = outlink->src->priv;
  111. outlink->w = test->w;
  112. outlink->h = test->h;
  113. outlink->sample_aspect_ratio = test->sar;
  114. outlink->time_base = test->time_base;
  115. return 0;
  116. }
  117. static int request_frame(AVFilterLink *outlink)
  118. {
  119. TestSourceContext *test = outlink->src->priv;
  120. AVFilterBufferRef *picref;
  121. int ret;
  122. if (test->max_pts >= 0 && test->pts >= test->max_pts)
  123. return AVERROR_EOF;
  124. picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, test->w, test->h);
  125. if (!picref)
  126. return AVERROR(ENOMEM);
  127. picref->pts = test->pts++;
  128. picref->pos = -1;
  129. picref->video->key_frame = 1;
  130. picref->video->interlaced = 0;
  131. picref->video->pict_type = AV_PICTURE_TYPE_I;
  132. picref->video->sample_aspect_ratio = test->sar;
  133. test->fill_picture_fn(outlink->src, picref);
  134. test->nb_frame++;
  135. if ((ret = ff_start_frame(outlink, picref)) < 0 ||
  136. (ret = ff_draw_slice(outlink, 0, test->h, 1)) < 0 ||
  137. (ret = ff_end_frame(outlink)) < 0)
  138. return ret;
  139. return 0;
  140. }
  141. #if CONFIG_NULLSRC_FILTER
  142. static const AVClass nullsrc_class = {
  143. .class_name = "nullsrc",
  144. .item_name = av_default_item_name,
  145. .option = testsrc_options,
  146. .version = LIBAVUTIL_VERSION_INT,
  147. .category = AV_CLASS_CATEGORY_FILTER,
  148. };
  149. static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { }
  150. static av_cold int nullsrc_init(AVFilterContext *ctx, const char *args)
  151. {
  152. TestSourceContext *test = ctx->priv;
  153. test->class = &nullsrc_class;
  154. test->fill_picture_fn = nullsrc_fill_picture;
  155. return init(ctx, args);
  156. }
  157. AVFilter avfilter_vsrc_nullsrc = {
  158. .name = "nullsrc",
  159. .description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."),
  160. .init = nullsrc_init,
  161. .uninit = uninit,
  162. .priv_size = sizeof(TestSourceContext),
  163. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  164. .outputs = (const AVFilterPad[]) {{ .name = "default",
  165. .type = AVMEDIA_TYPE_VIDEO,
  166. .request_frame = request_frame,
  167. .config_props = config_props, },
  168. { .name = NULL}},
  169. };
  170. #endif /* CONFIG_NULLSRC_FILTER */
  171. #if CONFIG_TESTSRC_FILTER
  172. AVFILTER_DEFINE_CLASS(testsrc);
  173. /**
  174. * Fill a rectangle with value val.
  175. *
  176. * @param val the RGB value to set
  177. * @param dst pointer to the destination buffer to fill
  178. * @param dst_linesize linesize of destination
  179. * @param segment_width width of the segment
  180. * @param x horizontal coordinate where to draw the rectangle in the destination buffer
  181. * @param y horizontal coordinate where to draw the rectangle in the destination buffer
  182. * @param w width of the rectangle to draw, expressed as a number of segment_width units
  183. * @param h height of the rectangle to draw, expressed as a number of segment_width units
  184. */
  185. static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigned segment_width,
  186. unsigned x, unsigned y, unsigned w, unsigned h)
  187. {
  188. int i;
  189. int step = 3;
  190. dst += segment_width * (step * x + y * dst_linesize);
  191. w *= segment_width * step;
  192. h *= segment_width;
  193. for (i = 0; i < h; i++) {
  194. memset(dst, val, w);
  195. dst += dst_linesize;
  196. }
  197. }
  198. static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize,
  199. unsigned segment_width)
  200. {
  201. #define TOP_HBAR 1
  202. #define MID_HBAR 2
  203. #define BOT_HBAR 4
  204. #define LEFT_TOP_VBAR 8
  205. #define LEFT_BOT_VBAR 16
  206. #define RIGHT_TOP_VBAR 32
  207. #define RIGHT_BOT_VBAR 64
  208. struct {
  209. int x, y, w, h;
  210. } segments[] = {
  211. { 1, 0, 5, 1 }, /* TOP_HBAR */
  212. { 1, 6, 5, 1 }, /* MID_HBAR */
  213. { 1, 12, 5, 1 }, /* BOT_HBAR */
  214. { 0, 1, 1, 5 }, /* LEFT_TOP_VBAR */
  215. { 0, 7, 1, 5 }, /* LEFT_BOT_VBAR */
  216. { 6, 1, 1, 5 }, /* RIGHT_TOP_VBAR */
  217. { 6, 7, 1, 5 } /* RIGHT_BOT_VBAR */
  218. };
  219. static const unsigned char masks[10] = {
  220. /* 0 */ TOP_HBAR |BOT_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  221. /* 1 */ RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  222. /* 2 */ TOP_HBAR|MID_HBAR|BOT_HBAR|LEFT_BOT_VBAR |RIGHT_TOP_VBAR,
  223. /* 3 */ TOP_HBAR|MID_HBAR|BOT_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  224. /* 4 */ MID_HBAR |LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  225. /* 5 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_BOT_VBAR,
  226. /* 6 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR |RIGHT_BOT_VBAR,
  227. /* 7 */ TOP_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  228. /* 8 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  229. /* 9 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
  230. };
  231. unsigned mask = masks[digit];
  232. int i;
  233. draw_rectangle(0, dst, dst_linesize, segment_width, 0, 0, 8, 13);
  234. for (i = 0; i < FF_ARRAY_ELEMS(segments); i++)
  235. if (mask & (1<<i))
  236. draw_rectangle(255, dst, dst_linesize, segment_width,
  237. segments[i].x, segments[i].y, segments[i].w, segments[i].h);
  238. }
  239. #define GRADIENT_SIZE (6 * 256)
  240. static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
  241. {
  242. TestSourceContext *test = ctx->priv;
  243. uint8_t *p, *p0;
  244. int x, y;
  245. int color, color_rest;
  246. int icolor;
  247. int radius;
  248. int quad0, quad;
  249. int dquad_x, dquad_y;
  250. int grad, dgrad, rgrad, drgrad;
  251. int seg_size;
  252. int second;
  253. int i;
  254. uint8_t *data = picref->data[0];
  255. int width = picref->video->w;
  256. int height = picref->video->h;
  257. /* draw colored bars and circle */
  258. radius = (width + height) / 4;
  259. quad0 = width * width / 4 + height * height / 4 - radius * radius;
  260. dquad_y = 1 - height;
  261. p0 = data;
  262. for (y = 0; y < height; y++) {
  263. p = p0;
  264. color = 0;
  265. color_rest = 0;
  266. quad = quad0;
  267. dquad_x = 1 - width;
  268. for (x = 0; x < width; x++) {
  269. icolor = color;
  270. if (quad < 0)
  271. icolor ^= 7;
  272. quad += dquad_x;
  273. dquad_x += 2;
  274. *(p++) = icolor & 1 ? 255 : 0;
  275. *(p++) = icolor & 2 ? 255 : 0;
  276. *(p++) = icolor & 4 ? 255 : 0;
  277. color_rest += 8;
  278. if (color_rest >= width) {
  279. color_rest -= width;
  280. color++;
  281. }
  282. }
  283. quad0 += dquad_y;
  284. dquad_y += 2;
  285. p0 += picref->linesize[0];
  286. }
  287. /* draw sliding color line */
  288. p0 = p = data + picref->linesize[0] * height * 3/4;
  289. grad = (256 * test->nb_frame * test->time_base.num / test->time_base.den) %
  290. GRADIENT_SIZE;
  291. rgrad = 0;
  292. dgrad = GRADIENT_SIZE / width;
  293. drgrad = GRADIENT_SIZE % width;
  294. for (x = 0; x < width; x++) {
  295. *(p++) =
  296. grad < 256 || grad >= 5 * 256 ? 255 :
  297. grad >= 2 * 256 && grad < 4 * 256 ? 0 :
  298. grad < 2 * 256 ? 2 * 256 - 1 - grad : grad - 4 * 256;
  299. *(p++) =
  300. grad >= 4 * 256 ? 0 :
  301. grad >= 1 * 256 && grad < 3 * 256 ? 255 :
  302. grad < 1 * 256 ? grad : 4 * 256 - 1 - grad;
  303. *(p++) =
  304. grad < 2 * 256 ? 0 :
  305. grad >= 3 * 256 && grad < 5 * 256 ? 255 :
  306. grad < 3 * 256 ? grad - 2 * 256 : 6 * 256 - 1 - grad;
  307. grad += dgrad;
  308. rgrad += drgrad;
  309. if (rgrad >= GRADIENT_SIZE) {
  310. grad++;
  311. rgrad -= GRADIENT_SIZE;
  312. }
  313. if (grad >= GRADIENT_SIZE)
  314. grad -= GRADIENT_SIZE;
  315. }
  316. p = p0;
  317. for (y = height / 8; y > 0; y--) {
  318. memcpy(p+picref->linesize[0], p, 3 * width);
  319. p += picref->linesize[0];
  320. }
  321. /* draw digits */
  322. seg_size = width / 80;
  323. if (seg_size >= 1 && height >= 13 * seg_size) {
  324. double time = av_q2d(test->time_base) * test->nb_frame *
  325. pow(10, test->nb_decimals);
  326. if (time > INT_MAX)
  327. return;
  328. second = (int)time;
  329. x = width - (width - seg_size * 64) / 2;
  330. y = (height - seg_size * 13) / 2;
  331. p = data + (x*3 + y * picref->linesize[0]);
  332. for (i = 0; i < 8; i++) {
  333. p -= 3 * 8 * seg_size;
  334. draw_digit(second % 10, p, picref->linesize[0], seg_size);
  335. second /= 10;
  336. if (second == 0)
  337. break;
  338. }
  339. }
  340. }
  341. static av_cold int test_init(AVFilterContext *ctx, const char *args)
  342. {
  343. TestSourceContext *test = ctx->priv;
  344. test->class = &testsrc_class;
  345. test->fill_picture_fn = test_fill_picture;
  346. return init(ctx, args);
  347. }
  348. static int test_query_formats(AVFilterContext *ctx)
  349. {
  350. static const enum PixelFormat pix_fmts[] = {
  351. PIX_FMT_RGB24, PIX_FMT_NONE
  352. };
  353. ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
  354. return 0;
  355. }
  356. AVFilter avfilter_vsrc_testsrc = {
  357. .name = "testsrc",
  358. .description = NULL_IF_CONFIG_SMALL("Generate test pattern."),
  359. .priv_size = sizeof(TestSourceContext),
  360. .init = test_init,
  361. .uninit = uninit,
  362. .query_formats = test_query_formats,
  363. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  364. .outputs = (const AVFilterPad[]) {{ .name = "default",
  365. .type = AVMEDIA_TYPE_VIDEO,
  366. .request_frame = request_frame,
  367. .config_props = config_props, },
  368. { .name = NULL }},
  369. };
  370. #endif /* CONFIG_TESTSRC_FILTER */
  371. #if CONFIG_RGBTESTSRC_FILTER
  372. static const AVClass rgbtestsrc_class = {
  373. .class_name = "rgbtestsrc",
  374. .item_name = av_default_item_name,
  375. .option = testsrc_options,
  376. .version = LIBAVUTIL_VERSION_INT,
  377. .category = AV_CLASS_CATEGORY_FILTER,
  378. };
  379. #define R 0
  380. #define G 1
  381. #define B 2
  382. #define A 3
  383. static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,
  384. int x, int y, int r, int g, int b, enum PixelFormat fmt,
  385. int rgba_map[4])
  386. {
  387. int32_t v;
  388. uint8_t *p;
  389. switch (fmt) {
  390. case PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;
  391. case PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;
  392. case PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;
  393. case PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;
  394. case PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;
  395. case PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;
  396. case PIX_FMT_RGB24:
  397. case PIX_FMT_BGR24:
  398. v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
  399. p = dst + 3*x + y*dst_linesize;
  400. AV_WL24(p, v);
  401. break;
  402. case PIX_FMT_RGBA:
  403. case PIX_FMT_BGRA:
  404. case PIX_FMT_ARGB:
  405. case PIX_FMT_ABGR:
  406. v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)) + (255 << (rgba_map[A]*8));
  407. p = dst + 4*x + y*dst_linesize;
  408. AV_WL32(p, v);
  409. break;
  410. }
  411. }
  412. static void rgbtest_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
  413. {
  414. TestSourceContext *test = ctx->priv;
  415. int x, y, w = picref->video->w, h = picref->video->h;
  416. for (y = 0; y < h; y++) {
  417. for (x = 0; x < picref->video->w; x++) {
  418. int c = 256*x/w;
  419. int r = 0, g = 0, b = 0;
  420. if (3*y < h ) r = c;
  421. else if (3*y < 2*h) g = c;
  422. else b = c;
  423. rgbtest_put_pixel(picref->data[0], picref->linesize[0], x, y, r, g, b,
  424. ctx->outputs[0]->format, test->rgba_map);
  425. }
  426. }
  427. }
  428. static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args)
  429. {
  430. TestSourceContext *test = ctx->priv;
  431. test->class = &rgbtestsrc_class;
  432. test->fill_picture_fn = rgbtest_fill_picture;
  433. return init(ctx, args);
  434. }
  435. static int rgbtest_query_formats(AVFilterContext *ctx)
  436. {
  437. static const enum PixelFormat pix_fmts[] = {
  438. PIX_FMT_RGBA, PIX_FMT_ARGB, PIX_FMT_BGRA, PIX_FMT_ABGR,
  439. PIX_FMT_BGR24, PIX_FMT_RGB24,
  440. PIX_FMT_RGB444, PIX_FMT_BGR444,
  441. PIX_FMT_RGB565, PIX_FMT_BGR565,
  442. PIX_FMT_RGB555, PIX_FMT_BGR555,
  443. PIX_FMT_NONE
  444. };
  445. ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
  446. return 0;
  447. }
  448. static int rgbtest_config_props(AVFilterLink *outlink)
  449. {
  450. TestSourceContext *test = outlink->src->priv;
  451. switch (outlink->format) {
  452. case PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
  453. case PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
  454. case PIX_FMT_RGBA:
  455. case PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
  456. case PIX_FMT_BGRA:
  457. case PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
  458. }
  459. return config_props(outlink);
  460. }
  461. AVFilter avfilter_vsrc_rgbtestsrc = {
  462. .name = "rgbtestsrc",
  463. .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."),
  464. .priv_size = sizeof(TestSourceContext),
  465. .init = rgbtest_init,
  466. .uninit = uninit,
  467. .query_formats = rgbtest_query_formats,
  468. .inputs = (const AVFilterPad[]) {{ .name = NULL}},
  469. .outputs = (const AVFilterPad[]) {{ .name = "default",
  470. .type = AVMEDIA_TYPE_VIDEO,
  471. .request_frame = request_frame,
  472. .config_props = rgbtest_config_props, },
  473. { .name = NULL }},
  474. };
  475. #endif /* CONFIG_RGBTESTSRC_FILTER */