FFmpeg
Loading...
Searching...
No Matches
src_avsynctest.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017-2022 Paul B Mahol
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "libavutil/avassert.h"
22#include "libavutil/common.h"
24#include "libavutil/ffmath.h"
25#include "libavutil/opt.h"
26#include "libavutil/imgutils.h"
29#include "libavutil/timestamp.h"
31#include "avfilter.h"
32#include "drawutils.h"
33#include "filters.h"
34#include "formats.h"
35#include "audio.h"
36#include "video.h"
37
65
66#define OFFSET(x) offsetof(AVSyncTestContext, x)
67#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
68#define V AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
69#define R AV_OPT_FLAG_RUNTIME_PARAM
70
71static const AVOption avsynctest_options[] = {
72 {"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, V },
73 {"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, V },
74 {"framerate", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="30"}, 0,INT_MAX, V },
75 {"fr", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="30"}, 0,INT_MAX, V },
76 {"samplerate", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100},8000,384000, A },
77 {"sr", "set sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64=44100},8000,384000, A },
78 {"amplitude", "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, {.dbl=.7}, 0., 1., A|R },
79 {"a", "set beep amplitude", OFFSET(amplitude), AV_OPT_TYPE_FLOAT, {.dbl=.7}, 0., 1., A|R },
80 {"period", "set beep period", OFFSET(period), AV_OPT_TYPE_INT, {.i64=3}, 1, 99., A },
81 {"p", "set beep period", OFFSET(period), AV_OPT_TYPE_INT, {.i64=3}, 1, 99., A },
82 {"delay", "set flash delay", OFFSET(delay), AV_OPT_TYPE_INT, {.i64=0}, -30, 30, V|R },
83 {"dl", "set flash delay", OFFSET(delay), AV_OPT_TYPE_INT, {.i64=0}, -30, 30, V|R },
84 {"cycle", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V|R },
85 {"c", "set delay cycle", OFFSET(cycle), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, V|R },
86 {"duration", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, V|A },
87 {"d", "set duration", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, V|A },
88 {"fg", "set foreground color", OFFSET(rgba[0]), AV_OPT_TYPE_COLOR, {.str="white"}, 0, 0, V },
89 {"bg", "set background color", OFFSET(rgba[1]), AV_OPT_TYPE_COLOR, {.str="black"}, 0, 0, V },
90 {"ag", "set additional color", OFFSET(rgba[2]), AV_OPT_TYPE_COLOR, {.str="gray"}, 0, 0, V },
91 {NULL},
92};
93
95
97 AVFilterFormatsConfig **cfg_in,
98 AVFilterFormatsConfig **cfg_out)
99{
100 const AVSyncTestContext *s = ctx->priv;
101 int sample_rates[] = { s->sample_rate, -1 };
102 static const enum AVSampleFormat sample_fmts[] = {
104 };
105 static const AVChannelLayout layouts[] = {
107 { .nb_channels = 0 },
108 };
110 int ret;
111
113 if (!formats)
114 return AVERROR(ENOMEM);
115 if ((ret = ff_formats_ref(formats, &cfg_out[0]->formats)) < 0)
116 return ret;
117
119 if (!formats)
120 return AVERROR(ENOMEM);
121 if ((ret = ff_formats_ref(formats, &cfg_out[1]->formats)) < 0)
122 return ret;
123
125 if (ret < 0)
126 return ret;
127
128 return ff_set_common_samplerates_from_list2(ctx, cfg_in, cfg_out, sample_rates);
129}
130
132{
133 AVFilterContext *ctx = outlink->src;
134 AVSyncTestContext *s = ctx->priv;
135
136 outlink->sample_rate = s->sample_rate;
137 outlink->time_base = (AVRational){1, s->sample_rate};
138
139 s->beep_duration = av_rescale(s->sample_rate, s->frame_rate.den, s->frame_rate.num);
140 s->duration = av_rescale(s->duration, s->sample_rate, AV_TIME_BASE);
141
142 return 0;
143}
144
146{
147 FilterLink *l = ff_filter_link(outlink);
148 AVFilterContext *ctx = outlink->src;
149 AVSyncTestContext *s = ctx->priv;
150 int ret;
151
152 outlink->w = s->w;
153 outlink->h = s->h;
154 outlink->time_base = av_inv_q(s->frame_rate);
155 l->frame_rate = s->frame_rate;
156 outlink->sample_aspect_ratio = (AVRational) {1, 1};
157 s->delay_min = av_mul_q(s->frame_rate, av_make_q(-1, 2));
158 s->delay_max = av_mul_q(s->delay_min, av_make_q(-1, 1));
159 s->delay_range = av_sub_q(s->delay_max, s->delay_min);
160 s->vdelay = av_make_q(s->delay, 1);
161 s->dir = 1;
162 s->prev_intpart = INT64_MIN;
163
164 ret = ff_draw_init_from_link(&s->draw, outlink, 0);
165 if (ret < 0) {
166 av_log(ctx, AV_LOG_ERROR, "Failed to initialize FFDrawContext\n");
167 return ret;
168 }
169
170 ff_draw_color(&s->draw, &s->fg, s->rgba[0]);
171 ff_draw_color(&s->draw, &s->bg, s->rgba[1]);
172 ff_draw_color(&s->draw, &s->ag, s->rgba[2] );
173
174 return 0;
175}
176
177#define FPI 0x8000
178
180{
181 const double pi = M_PI;
182 const int32_t a = ((2.0 * pi) * (1 << 24));
183 const int32_t b = (1 << 7) * (12.0 / pi - 1.0 - pi) * (1 << 24);
184 const int32_t c = (1 << 9) * 3.0 * (2.0 + pi - 16.0 / pi) * (1 << 24);
185 int64_t x2, result;
186 int32_t t1, t2;
187
188 x &= 2 * FPI - 1;
189
190 if (x >= (3 * FPI / 2))
191 x = x - 2 * FPI;
192 else if (x > FPI / 2)
193 x = FPI - x;
194
195 x2 = x * x;
196 t1 = (x2 * c) >> 32;
197 t2 = ((b + t1) * x2) >> 32;
198 x = x << 8;
199
200 result = a + t2;
201 result *= x;
202 result += (1U << 31);
203 result >>= 17;
204 result = av_rescale(result, scale.num, scale.den);
205
206 return result;
207}
208
209static int audio_frame(AVFilterLink *outlink)
210{
211 AVFilterContext *ctx = outlink->src;
212 AVSyncTestContext *s = ctx->priv;
213 const AVRational a = av_d2q(s->amplitude, 32768);
214 int64_t duration[2];
216 AVFrame *out;
217 int32_t *dst;
218
219 delta = av_rescale_q(s->vpts, av_make_q(s->sample_rate, 1), s->frame_rate) - s->apts;
220 if (delta < 0)
221 return 1;
222
223 duration[0] = av_rescale_rnd(s->sample_rate, s->frame_rate.den, s->frame_rate.num, AV_ROUND_DOWN);
224 duration[1] = av_rescale_rnd(s->sample_rate, s->frame_rate.den, s->frame_rate.num, AV_ROUND_UP);
225
226 delta = duration[delta > 0];
227 out = ff_get_audio_buffer(outlink, delta);
228 if (!out)
229 return AVERROR(ENOMEM);
230
231 out->pts = s->apts;
232 dst = (int32_t *)out->data[0];
233
234 for (int i = 0; i < delta; i++) {
235 if (((s->apts + i) % (s->period * s->sample_rate)) == 0)
236 s->beep = 1;
237 if (s->beep) {
238 dst[i] = sin32(av_rescale_q(800LL * 2LL * FPI, outlink->time_base, av_make_q(1, s->apts + i)), a);
239 s->beep++;
240 } else {
241 dst[i] = 0;
242 }
243 if (s->beep >= s->beep_duration) {
244 s->beep = 0;
245 }
246 }
247 s->apts += out->nb_samples;
248
249 return ff_filter_frame(outlink, out);
250}
251
253 int x0, int y0, const uint8_t *text)
254{
255 const uint8_t *cga_font = avpriv_cga_font_get();
256 int x = x0;
257
258 for (; *text; text++) {
259 if (*text == '\n') {
260 x = x0;
261 y0 += 8;
262 continue;
263 }
264 ff_blend_mask(draw, color, out->data, out->linesize,
265 out->width, out->height,
266 &cga_font[*text * 8], 1, 8, 8, 0, 0, x, y0);
267 x += 8;
268 }
269}
270
271static int offset(int x, int num, int den)
272{
273 return av_rescale_rnd(x, num, den, AV_ROUND_UP);
274}
275
276static int video_frame(AVFilterLink *outlink)
277{
278 AVFilterContext *ctx = outlink->src;
279 AVSyncTestContext *s = ctx->priv;
280 const int w = outlink->w;
281 const int h = outlink->h;
282 const int step = av_rescale_rnd(w, s->delay_range.den, s->delay_range.num, AV_ROUND_DOWN);
283 char text[128];
284 int new_offset;
285 int64_t delta, temp, intpart;
286 AVFrame *out;
287
288 if (!s->cycle)
289 s->vdelay = av_make_q(s->delay, 1);
290
291 delta = av_rescale_q(s->apts, s->frame_rate, av_make_q(s->sample_rate, 1)) - s->vpts;
292 if (delta < 0)
293 return 1;
294
295 out = ff_get_video_buffer(outlink, w, h);
296 if (!out)
297 return AVERROR(ENOMEM);
298
299 ff_fill_rectangle(&s->draw, &s->bg, out->data, out->linesize, 0, 0, w, h);
300
301 snprintf(text, sizeof(text), "FRN: %"PRId64"", s->vpts);
302 draw_text(&s->draw, out, &s->fg, offset(w, 1, 10), offset(h, 1, 10), text);
303
304 snprintf(text, sizeof(text), "SEC: %s", av_ts2timestr(s->vpts, &outlink->time_base));
305 draw_text(&s->draw, out, &s->fg, offset(w, 1, 10), offset(h, 9, 10), text);
306
307 snprintf(text, sizeof(text), "DLY: %d", s->vdelay.num);
308 draw_text(&s->draw, out, &s->fg, offset(w, 9, 10) - strlen(text) * 8, offset(h, 9, 10), text);
309
310 snprintf(text, sizeof(text), "FPS: %d/%d", s->frame_rate.num, s->frame_rate.den);
311 draw_text(&s->draw, out, &s->fg, offset(w, 9, 10) - strlen(text) * 8, offset(h, 1, 10), text);
312
313 snprintf(text, sizeof(text), "P: %d", s->period);
314 draw_text(&s->draw, out, &s->ag, offset(w, 1, 2) - strlen(text) * 4, offset(h, 9, 10), text);
315
316 snprintf(text, sizeof(text), "SR: %d", s->sample_rate);
317 draw_text(&s->draw, out, &s->ag, offset(w, 1, 2) - strlen(text) * 4, offset(h, 1, 10), text);
318
319 snprintf(text, sizeof(text), "A: %1.2f", s->amplitude);
320 draw_text(&s->draw, out, &s->ag, offset(w, 1, 10), offset(h, 1, 2), text);
321
322 snprintf(text, sizeof(text), "WxH: %dx%d", w, h);
323 draw_text(&s->draw, out, &s->ag, offset(w, 9, 10) - strlen(text) * 8, offset(h, 1, 2), text);
324
325 temp = s->vpts + s->vdelay.num;
326 intpart = av_rescale_rnd(temp, outlink->time_base.num, outlink->time_base.den, AV_ROUND_NEAR_INF);
327 intpart = temp - av_rescale_rnd(intpart, outlink->time_base.den, outlink->time_base.num, AV_ROUND_NEAR_INF);
328
329 new_offset = offset(w, 1, 2);
330 ff_fill_rectangle(&s->draw, &s->fg, out->data, out->linesize,
331 av_clip(new_offset + step * intpart, 0, w - 2),
332 offset(h, 141, 200), offset(step, 2, 3), offset(h, 1, 25));
333
334 if (intpart == 0 && s->prev_intpart != intpart) {
335 if (s->flash >= s->period) {
336 int result;
337
338 if (s->cycle)
339 s->vdelay = av_add_q(s->vdelay, av_make_q(s->dir, 1));
340 result = av_cmp_q(s->vdelay, s->delay_max);
341 if (result >= 0)
342 s->dir = -1;
343 result = av_cmp_q(s->vdelay, s->delay_min);
344 if (result <= 0)
345 s->dir = 1;
346 ff_fill_rectangle(&s->draw, &s->fg, out->data, out->linesize,
347 offset(w, 1, 3), offset(h, 1, 3), offset(w, 1, 3), offset(h, 1, 4));
348 s->flash = 0;
349 }
350 s->flash++;
351 }
352 s->prev_intpart = intpart;
353
354 for (int i = av_rescale(s->delay_min.num, 1, s->delay_min.den);
355 i < av_rescale(s->delay_max.num, 1, s->delay_max.den); i++) {
356 ff_fill_rectangle(&s->draw, &s->fg, out->data, out->linesize,
357 av_clip(new_offset + step * i, 0, w - 2),
358 offset(h, 7, 10), 1, offset(h, 1, 20));
359 }
360
361 out->pts = s->vpts++;
362 out->duration = 1;
363
364 return ff_filter_frame(outlink, out);
365}
366
368{
369 AVSyncTestContext *s = ctx->priv;
370 AVFilterLink *aoutlink = ctx->outputs[0];
371 AVFilterLink *voutlink = ctx->outputs[1];
372 int ret = FFERROR_NOT_READY;
373
374 if (!ff_outlink_frame_wanted(aoutlink) &&
375 !ff_outlink_frame_wanted(voutlink))
376 return ret;
377
378 if (s->duration > 0 && s->apts >= s->duration) {
379 ff_outlink_set_status(aoutlink, AVERROR_EOF, s->apts);
380 ff_outlink_set_status(voutlink, AVERROR_EOF, s->vpts);
381 return 0;
382 }
383
384 ret = audio_frame(aoutlink);
385 if (ret < 0)
386 return ret;
387 ret = video_frame(voutlink);
388
389 return ret;
390}
391
393 {
394 .name = "audio",
395 .type = AVMEDIA_TYPE_AUDIO,
396 .config_props = aconfig_props,
397 },
398 {
399 .name = "video",
400 .type = AVMEDIA_TYPE_VIDEO,
401 .config_props = config_props,
402 },
403};
404
406 .p.name = "avsynctest",
407 .p.description = NULL_IF_CONFIG_SMALL("Generate an Audio Video Sync Test."),
408 .p.priv_class = &avsynctest_class,
409 .priv_size = sizeof(AVSyncTestContext),
413 .process_command = ff_filter_process_command,
414};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static enum AVSampleFormat sample_fmts[]
Definition adpcmenc.c:933
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
const FFFilter ff_avsrc_avsynctest
#define A(x)
Definition vpx_arith.h:28
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition audio.c:74
int32_t
simple assert() macros that are a bit more flexible than ISO C assert().
#define V
Definition avdct.c:32
static int draw(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
Definition avfilter.c:1690
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition avfilter.c:906
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
Public libavutil channel layout APIs header.
common internal and external API header
#define av_clip
Definition common.h:100
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static const int sample_rates[]
Definition dcaenc.h:34
void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4])
Prepare a color.
Definition drawutils.c:179
AVFilterFormats * ff_draw_supported_pixel_formats(unsigned flags)
Return the list of pixel formats supported by the draw functions.
Definition drawutils.c:670
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.
Definition drawutils.c:258
int ff_draw_init_from_link(FFDrawContext *draw, const AVFilterLink *link, unsigned flags)
Init a draw context, taking the format, colorspace and range from the given filter link.
Definition drawutils.c:168
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.
Definition drawutils.c:557
misc drawing utilities
internal math functions header
static int64_t duration
Definition ffplay.c:330
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add ref as a new reference to formats.
Definition formats.c:756
int ff_set_common_samplerates_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const int *samplerates)
Definition formats.c:1050
int ff_set_common_channel_layouts_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const AVChannelLayout *fmts)
Definition formats.c:1026
av_warn_unused_result AVFilterFormats * ff_make_sample_format_list(const enum AVSampleFormat *fmts)
Create a list of supported sample formats.
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition opt.h:302
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition opt.h:318
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
AVRational av_add_q(AVRational b, AVRational c)
Add two rationals.
Definition rational.c:93
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
Definition rational.c:80
static AVRational av_make_q(int num, int den)
Create an AVRational.
Definition rational.h:71
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
Definition rational.c:110
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
Definition rational.h:89
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
AVRational av_sub_q(AVRational b, AVRational c)
Subtract one rational from another.
Definition rational.c:101
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
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.
Definition mathematics.c:58
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AV_ROUND_DOWN
Round toward -infinity.
@ AV_ROUND_UP
Round toward +infinity.
@ AV_ROUND_NEAR_INF
Round to nearest and halfway cases away from zero.
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
AVSampleFormat
Audio sample formats.
Definition samplefmt.h:55
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition samplefmt.h:59
@ AV_SAMPLE_FMT_NONE
Definition samplefmt.h:56
#define AV_TIME_BASE
Internal time base represented as integer.
Definition avutil.h:253
int a
#define R
Definition huffyuv.h:44
misc image utilities
#define b
Definition input.c:43
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Definition intra.c:278
static int activate(AVBitStreamFilterContext *ctx)
unsigned offset
Definition libaomenc.c:763
#define FILTER_OUTPUTS(array)
Definition filters.h:265
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition filters.h:629
#define FFERROR_NOT_READY
Filters implementation helper functions and internal structures.
Definition filters.h:34
static FilterLink * ff_filter_link(AVFilterLink *link)
Definition filters.h:199
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
uint8_t w
Definition llvidencdsp.c:39
#define M_PI
Definition mathematics.h:67
enum MovChannelLayoutTag * layouts
Definition mov_chan.c:335
AVOptions.
misc parsing utilities
formats
Definition signature.h:47
#define snprintf
Definition snprintf.h:34
static int config_props(AVBitStreamFilterLink *link)
Definition source.c:181
static void draw_text(FFDrawContext *draw, AVFrame *out, FFDrawColor *color, int x0, int y0, const uint8_t *text)
static int video_frame(AVFilterLink *outlink)
static int32_t sin32(int32_t x, AVRational scale)
static int audio_frame(AVFilterLink *outlink)
static av_cold int aconfig_props(AVFilterLink *outlink)
static const AVFilterPad avsynctest_outputs[]
static av_cold int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int activate(AVFilterContext *ctx)
#define OFFSET(x)
static av_cold int config_props(AVFilterLink *outlink)
#define FPI
static const AVOption avsynctest_options[]
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
Lists of formats / etc.
Definition avfilter.h:120
A list of supported formats for one end of a filter link.
Definition formats.h:64
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
AVOption.
Definition opt.h:428
Rational number (pair of numerator and denominator).
Definition rational.h:58
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
AVRational delay_range
AVRational frame_rate
uint8_t rgba[3][4]
FFDrawContext draw
#define av_log(a,...)
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
timestamp utils, mostly useful for debugging/logging purposes
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition timestamp.h:83
else temp
Definition vf_mcdeint.c:275
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89
float delta
static double c[64]
const uint8_t * avpriv_cga_font_get(void)
static const uint8_t cga_font[2048]
CGA/EGA/VGA ROM font data.