Libav
vsrc_testsrc.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 Nicolas George <nicolas.george@normalesup.org>
3  * Copyright (c) 2011 Stefano Sabatini
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
33 #include <float.h>
34 
35 #include "libavutil/common.h"
36 #include "libavutil/mathematics.h"
37 #include "libavutil/opt.h"
38 #include "libavutil/intreadwrite.h"
39 #include "libavutil/parseutils.h"
40 #include "avfilter.h"
41 #include "formats.h"
42 #include "internal.h"
43 #include "video.h"
44 
45 typedef struct TestSourceContext {
46  const AVClass *class;
47  int h, w;
48  unsigned int nb_frame;
50  int64_t pts, max_pts;
51  char *size;
52  char *rate;
53  char *duration;
55 
57 
58  /* only used by rgbtest */
59  int rgba_map[4];
61 
62 #define OFFSET(x) offsetof(TestSourceContext, x)
63 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM
64 
65 static const AVOption testsrc_options[] = {
66  { "size", "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = "320x240"}, .flags = FLAGS },
67  { "s", "set video size", OFFSET(size), AV_OPT_TYPE_STRING, {.str = "320x240"}, .flags = FLAGS },
68  { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, .flags = FLAGS },
69  { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, .flags = FLAGS },
70  { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
71  { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl = 1}, 0, INT_MAX, FLAGS },
72  { NULL },
73 };
74 
76 {
77  TestSourceContext *test = ctx->priv;
78  AVRational frame_rate_q;
79  int64_t duration = -1;
80  int ret = 0;
81 
82  if ((ret = av_parse_video_size(&test->w, &test->h, test->size)) < 0) {
83  av_log(ctx, AV_LOG_ERROR, "Invalid frame size: '%s'\n", test->size);
84  return ret;
85  }
86 
87  if ((ret = av_parse_video_rate(&frame_rate_q, test->rate)) < 0 ||
88  frame_rate_q.den <= 0 || frame_rate_q.num <= 0) {
89  av_log(ctx, AV_LOG_ERROR, "Invalid frame rate: '%s'\n", test->rate);
90  return ret;
91  }
92 
93  if ((test->duration) && (ret = av_parse_time(&duration, test->duration, 1)) < 0) {
94  av_log(ctx, AV_LOG_ERROR, "Invalid duration: '%s'\n", test->duration);
95  return ret;
96  }
97 
98  test->time_base.num = frame_rate_q.den;
99  test->time_base.den = frame_rate_q.num;
100  test->max_pts = duration >= 0 ?
101  av_rescale_q(duration, AV_TIME_BASE_Q, test->time_base) : -1;
102  test->nb_frame = 0;
103  test->pts = 0;
104 
105  av_log(ctx, AV_LOG_DEBUG, "size:%dx%d rate:%d/%d duration:%f sar:%d/%d\n",
106  test->w, test->h, frame_rate_q.num, frame_rate_q.den,
107  duration < 0 ? -1 : test->max_pts * av_q2d(test->time_base),
108  test->sar.num, test->sar.den);
109  return 0;
110 }
111 
112 static int config_props(AVFilterLink *outlink)
113 {
114  TestSourceContext *test = outlink->src->priv;
115 
116  outlink->w = test->w;
117  outlink->h = test->h;
118  outlink->sample_aspect_ratio = test->sar;
119  outlink->time_base = test->time_base;
120 
121  return 0;
122 }
123 
124 static int request_frame(AVFilterLink *outlink)
125 {
126  TestSourceContext *test = outlink->src->priv;
127  AVFrame *frame;
128 
129  if (test->max_pts >= 0 && test->pts > test->max_pts)
130  return AVERROR_EOF;
131  frame = ff_get_video_buffer(outlink, test->w, test->h);
132  if (!frame)
133  return AVERROR(ENOMEM);
134 
135  frame->pts = test->pts++;
136  frame->key_frame = 1;
137  frame->interlaced_frame = 0;
138  frame->pict_type = AV_PICTURE_TYPE_I;
139  frame->sample_aspect_ratio = test->sar;
140  test->nb_frame++;
141  test->fill_picture_fn(outlink->src, frame);
142 
143  return ff_filter_frame(outlink, frame);
144 }
145 
146 #if CONFIG_TESTSRC_FILTER
147 
148 static const char *testsrc_get_name(void *ctx)
149 {
150  return "testsrc";
151 }
152 
153 static const AVClass testsrc_class = {
154  .class_name = "TestSourceContext",
155  .item_name = testsrc_get_name,
156  .option = testsrc_options,
157 };
158 
171 static void draw_rectangle(unsigned val, uint8_t *dst, int dst_linesize, unsigned segment_width,
172  unsigned x, unsigned y, unsigned w, unsigned h)
173 {
174  int i;
175  int step = 3;
176 
177  dst += segment_width * (step * x + y * dst_linesize);
178  w *= segment_width * step;
179  h *= segment_width;
180  for (i = 0; i < h; i++) {
181  memset(dst, val, w);
182  dst += dst_linesize;
183  }
184 }
185 
186 static void draw_digit(int digit, uint8_t *dst, unsigned dst_linesize,
187  unsigned segment_width)
188 {
189 #define TOP_HBAR 1
190 #define MID_HBAR 2
191 #define BOT_HBAR 4
192 #define LEFT_TOP_VBAR 8
193 #define LEFT_BOT_VBAR 16
194 #define RIGHT_TOP_VBAR 32
195 #define RIGHT_BOT_VBAR 64
196  struct segments {
197  int x, y, w, h;
198  } segments[] = {
199  { 1, 0, 5, 1 }, /* TOP_HBAR */
200  { 1, 6, 5, 1 }, /* MID_HBAR */
201  { 1, 12, 5, 1 }, /* BOT_HBAR */
202  { 0, 1, 1, 5 }, /* LEFT_TOP_VBAR */
203  { 0, 7, 1, 5 }, /* LEFT_BOT_VBAR */
204  { 6, 1, 1, 5 }, /* RIGHT_TOP_VBAR */
205  { 6, 7, 1, 5 } /* RIGHT_BOT_VBAR */
206  };
207  static const unsigned char masks[10] = {
208  /* 0 */ TOP_HBAR |BOT_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
209  /* 1 */ RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
210  /* 2 */ TOP_HBAR|MID_HBAR|BOT_HBAR|LEFT_BOT_VBAR |RIGHT_TOP_VBAR,
211  /* 3 */ TOP_HBAR|MID_HBAR|BOT_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
212  /* 4 */ MID_HBAR |LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
213  /* 5 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_BOT_VBAR,
214  /* 6 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR |RIGHT_BOT_VBAR,
215  /* 7 */ TOP_HBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
216  /* 8 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR|LEFT_BOT_VBAR|RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
217  /* 9 */ TOP_HBAR|BOT_HBAR|MID_HBAR|LEFT_TOP_VBAR |RIGHT_TOP_VBAR|RIGHT_BOT_VBAR,
218  };
219  unsigned mask = masks[digit];
220  int i;
221 
222  draw_rectangle(0, dst, dst_linesize, segment_width, 0, 0, 8, 13);
223  for (i = 0; i < FF_ARRAY_ELEMS(segments); i++)
224  if (mask & (1<<i))
225  draw_rectangle(255, dst, dst_linesize, segment_width,
226  segments[i].x, segments[i].y, segments[i].w, segments[i].h);
227 }
228 
229 #define GRADIENT_SIZE (6 * 256)
230 
231 static void test_fill_picture(AVFilterContext *ctx, AVFrame *frame)
232 {
233  TestSourceContext *test = ctx->priv;
234  uint8_t *p, *p0;
235  int x, y;
236  int color, color_rest;
237  int icolor;
238  int radius;
239  int quad0, quad;
240  int dquad_x, dquad_y;
241  int grad, dgrad, rgrad, drgrad;
242  int seg_size;
243  int second;
244  int i;
245  uint8_t *data = frame->data[0];
246  int width = frame->width;
247  int height = frame->height;
248 
249  /* draw colored bars and circle */
250  radius = (width + height) / 4;
251  quad0 = width * width / 4 + height * height / 4 - radius * radius;
252  dquad_y = 1 - height;
253  p0 = data;
254  for (y = 0; y < height; y++) {
255  p = p0;
256  color = 0;
257  color_rest = 0;
258  quad = quad0;
259  dquad_x = 1 - width;
260  for (x = 0; x < width; x++) {
261  icolor = color;
262  if (quad < 0)
263  icolor ^= 7;
264  quad += dquad_x;
265  dquad_x += 2;
266  *(p++) = icolor & 1 ? 255 : 0;
267  *(p++) = icolor & 2 ? 255 : 0;
268  *(p++) = icolor & 4 ? 255 : 0;
269  color_rest += 8;
270  if (color_rest >= width) {
271  color_rest -= width;
272  color++;
273  }
274  }
275  quad0 += dquad_y;
276  dquad_y += 2;
277  p0 += frame->linesize[0];
278  }
279 
280  /* draw sliding color line */
281  p = data + frame->linesize[0] * height * 3/4;
282  grad = (256 * test->nb_frame * test->time_base.num / test->time_base.den) %
283  GRADIENT_SIZE;
284  rgrad = 0;
285  dgrad = GRADIENT_SIZE / width;
286  drgrad = GRADIENT_SIZE % width;
287  for (x = 0; x < width; x++) {
288  *(p++) =
289  grad < 256 || grad >= 5 * 256 ? 255 :
290  grad >= 2 * 256 && grad < 4 * 256 ? 0 :
291  grad < 2 * 256 ? 2 * 256 - 1 - grad : grad - 4 * 256;
292  *(p++) =
293  grad >= 4 * 256 ? 0 :
294  grad >= 1 * 256 && grad < 3 * 256 ? 255 :
295  grad < 1 * 256 ? grad : 4 * 256 - 1 - grad;
296  *(p++) =
297  grad < 2 * 256 ? 0 :
298  grad >= 3 * 256 && grad < 5 * 256 ? 255 :
299  grad < 3 * 256 ? grad - 2 * 256 : 6 * 256 - 1 - grad;
300  grad += dgrad;
301  rgrad += drgrad;
302  if (rgrad >= GRADIENT_SIZE) {
303  grad++;
304  rgrad -= GRADIENT_SIZE;
305  }
306  if (grad >= GRADIENT_SIZE)
307  grad -= GRADIENT_SIZE;
308  }
309  for (y = height / 8; y > 0; y--) {
310  memcpy(p, p - frame->linesize[0], 3 * width);
311  p += frame->linesize[0];
312  }
313 
314  /* draw digits */
315  seg_size = width / 80;
316  if (seg_size >= 1 && height >= 13 * seg_size) {
317  second = test->nb_frame * test->time_base.num / test->time_base.den;
318  x = width - (width - seg_size * 64) / 2;
319  y = (height - seg_size * 13) / 2;
320  p = data + (x*3 + y * frame->linesize[0]);
321  for (i = 0; i < 8; i++) {
322  p -= 3 * 8 * seg_size;
323  draw_digit(second % 10, p, frame->linesize[0], seg_size);
324  second /= 10;
325  if (second == 0)
326  break;
327  }
328  }
329 }
330 
331 static av_cold int test_init(AVFilterContext *ctx)
332 {
333  TestSourceContext *test = ctx->priv;
334 
335  test->fill_picture_fn = test_fill_picture;
336  return init_common(ctx);
337 }
338 
339 static int test_query_formats(AVFilterContext *ctx)
340 {
341  static const enum AVPixelFormat pix_fmts[] = {
343  };
345  return 0;
346 }
347 
348 static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = {
349  {
350  .name = "default",
351  .type = AVMEDIA_TYPE_VIDEO,
352  .request_frame = request_frame,
353  .config_props = config_props,
354  },
355  { NULL }
356 };
357 
358 AVFilter ff_vsrc_testsrc = {
359  .name = "testsrc",
360  .description = NULL_IF_CONFIG_SMALL("Generate test pattern."),
361  .priv_size = sizeof(TestSourceContext),
362  .priv_class = &testsrc_class,
363  .init = test_init,
364 
365  .query_formats = test_query_formats,
366 
367  .inputs = NULL,
368 
369  .outputs = avfilter_vsrc_testsrc_outputs,
370 };
371 
372 #endif /* CONFIG_TESTSRC_FILTER */
373 
374 #if CONFIG_RGBTESTSRC_FILTER
375 
376 static const char *rgbtestsrc_get_name(void *ctx)
377 {
378  return "rgbtestsrc";
379 }
380 
381 static const AVClass rgbtestsrc_class = {
382  .class_name = "RGBTestSourceContext",
383  .item_name = rgbtestsrc_get_name,
384  .option = testsrc_options,
385 };
386 
387 #define R 0
388 #define G 1
389 #define B 2
390 #define A 3
391 
392 static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize,
393  int x, int y, int r, int g, int b, enum AVPixelFormat fmt,
394  int rgba_map[4])
395 {
396  int32_t v;
397  uint8_t *p;
398 
399  switch (fmt) {
400  case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break;
401  case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break;
402  case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break;
403  case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break;
404  case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break;
405  case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break;
406  case AV_PIX_FMT_RGB24:
407  case AV_PIX_FMT_BGR24:
408  v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
409  p = dst + 3*x + y*dst_linesize;
410  AV_WL24(p, v);
411  break;
412  case AV_PIX_FMT_RGBA:
413  case AV_PIX_FMT_BGRA:
414  case AV_PIX_FMT_ARGB:
415  case AV_PIX_FMT_ABGR:
416  v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8));
417  p = dst + 4*x + y*dst_linesize;
418  AV_WL32(p, v);
419  break;
420  }
421 }
422 
423 static void rgbtest_fill_picture(AVFilterContext *ctx, AVFrame *frame)
424 {
425  TestSourceContext *test = ctx->priv;
426  int x, y, w = frame->width, h = frame->height;
427 
428  for (y = 0; y < h; y++) {
429  for (x = 0; x < w; x++) {
430  int c = 256*x/w;
431  int r = 0, g = 0, b = 0;
432 
433  if (3*y < h ) r = c;
434  else if (3*y < 2*h) g = c;
435  else b = c;
436 
437  rgbtest_put_pixel(frame->data[0], frame->linesize[0], x, y, r, g, b,
438  ctx->outputs[0]->format, test->rgba_map);
439  }
440  }
441 }
442 
443 static av_cold int rgbtest_init(AVFilterContext *ctx)
444 {
445  TestSourceContext *test = ctx->priv;
446 
447  test->fill_picture_fn = rgbtest_fill_picture;
448  return init_common(ctx);
449 }
450 
451 static int rgbtest_query_formats(AVFilterContext *ctx)
452 {
453  static const enum AVPixelFormat pix_fmts[] = {
460  };
462  return 0;
463 }
464 
465 static int rgbtest_config_props(AVFilterLink *outlink)
466 {
467  TestSourceContext *test = outlink->src->priv;
468 
469  switch (outlink->format) {
470  case AV_PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
471  case AV_PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
472  case AV_PIX_FMT_RGBA:
473  case AV_PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
474  case AV_PIX_FMT_BGRA:
475  case AV_PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
476  }
477 
478  return config_props(outlink);
479 }
480 
481 static const AVFilterPad avfilter_vsrc_rgbtestsrc_outputs[] = {
482  {
483  .name = "default",
484  .type = AVMEDIA_TYPE_VIDEO,
485  .request_frame = request_frame,
486  .config_props = rgbtest_config_props,
487  },
488  { NULL }
489 };
490 
491 AVFilter ff_vsrc_rgbtestsrc = {
492  .name = "rgbtestsrc",
493  .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."),
494  .priv_size = sizeof(TestSourceContext),
495  .priv_class = &rgbtestsrc_class,
496  .init = rgbtest_init,
497 
498  .query_formats = rgbtest_query_formats,
499 
500  .inputs = NULL,
501 
502  .outputs = avfilter_vsrc_rgbtestsrc_outputs,
503 };
504 
505 #endif /* CONFIG_RGBTESTSRC_FILTER */
#define G
Definition: huffyuv.h:50
int size
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
Definition: parseutils.c:122
AVOption.
Definition: opt.h:234
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
Definition: parseutils.c:95
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:232
Main libavfilter public API header.
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:67
int av_parse_time(int64_t *timeval, const char *timestr, int duration)
Parse timestr and return in *time a corresponding number of microseconds.
Definition: parseutils.c:482
#define R
Definition: huffyuv.h:51
int num
numerator
Definition: rational.h:44
static int query_formats(AVFilterContext *ctx)
Definition: af_aformat.c:112
#define FF_ARRAY_ELEMS(a)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition: video.c:104
#define AV_PIX_FMT_RGB444
Definition: pixfmt.h:232
static int64_t duration
Definition: avplay.c:246
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:165
const char * name
Pad name.
Definition: internal.h:42
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:38
#define AV_WL24(p, d)
Definition: intreadwrite.h:426
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:733
uint8_t
#define av_cold
Definition: attributes.h:66
AVOptions.
#define b
Definition: input.c:52
#define AV_WL32(p, d)
Definition: intreadwrite.h:255
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:211
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:97
const char data[16]
Definition: mxf.c:70
static double av_q2d(AVRational a)
Convert rational to double.
Definition: rational.h:69
static int request_frame(AVFilterLink *outlink)
Definition: vsrc_testsrc.c:124
static const AVOption testsrc_options[]
Definition: vsrc_testsrc.c:65
#define AVERROR_EOF
End of file.
Definition: error.h:51
int interlaced_frame
The content of the picture is interlaced.
Definition: frame.h:320
void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:379
#define B
Definition: huffyuv.h:49
#define r
Definition: input.c:51
A filter pad used for either input or output.
Definition: internal.h:36
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Definition: mathematics.c:129
int width
width and height of the video frame
Definition: frame.h:174
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
static const uint16_t mask[17]
Definition: lzw.c:38
#define AVERROR(e)
Definition: error.h:43
static av_cold int init_common(AVFilterContext *ctx)
Definition: vsrc_testsrc.c:75
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:150
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:98
g
Definition: yuv2rgb.c:535
void * priv
private data for use by the filter
Definition: avfilter.h:584
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:144
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:169
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:95
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:96
AVRational sar
sample aspect ratio
Definition: vsrc_testsrc.c:54
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:196
static void test(const char *pattern, const char *host)
Definition: noproxy-test.c:23
static int config_props(AVFilterLink *outlink)
Definition: vsrc_testsrc.c:112
int32_t
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:68
#define FLAGS
Definition: vsrc_testsrc.c:63
Definition: vf_drawbox.c:37
char * rate
video frame rate
Definition: vsrc_testsrc.c:52
#define AV_PIX_FMT_BGR555
Definition: pixfmt.h:236
NULL
Definition: eval.c:55
static int width
Definition: utils.c:156
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
Definition: avutil.h:240
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:153
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Definition: frame.h:206
Describe the class of an AVClass context structure.
Definition: log.h:33
Filter definition.
Definition: avfilter.h:421
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:221
rational number numerator/denominator
Definition: rational.h:43
const char * name
Filter name.
Definition: avfilter.h:425
static int step
Definition: avplay.c:247
char * duration
total duration of the generated video
Definition: vsrc_testsrc.c:53
misc parsing utilities
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:578
#define AV_PIX_FMT_BGR565
Definition: pixfmt.h:235
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:141
AVRational time_base
Definition: vsrc_testsrc.c:49
int height
Definition: gxfenc.c:72
common internal and external API header
unsigned int nb_frame
Definition: vsrc_testsrc.c:48
char * size
video frame size
Definition: vsrc_testsrc.c:51
#define AV_PIX_FMT_BGR444
Definition: pixfmt.h:237
#define AV_PIX_FMT_RGB555
Definition: pixfmt.h:231
int den
denominator
Definition: rational.h:45
static const uint8_t color[]
Definition: log.c:55
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:191
void(* fill_picture_fn)(AVFilterContext *ctx, AVFrame *frame)
Definition: vsrc_testsrc.c:56
#define OFFSET(x)
Definition: vsrc_testsrc.c:62
#define AV_PIX_FMT_RGB565
Definition: pixfmt.h:230
An instance of a filter.
Definition: avfilter.h:563
int height
Definition: frame.h:174
internal API functions
AVPixelFormat
Pixel format.
Definition: pixfmt.h:63