FFmpeg
Loading...
Searching...
No Matches
vf_frei0r.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 Stefano Sabatini
3 * This file is part of FFmpeg.
4 *
5 * FFmpeg is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with FFmpeg; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20/**
21 * @file
22 * frei0r wrapper
23 */
24
25#include <frei0r.h>
26#include <stdio.h>
27#include <string.h>
28#include <stdlib.h>
29#include "config.h"
30#include "compat/w32dlfcn.h"
31#include "libavutil/avstring.h"
32#include "libavutil/common.h"
33#include "libavutil/eval.h"
35#include "libavutil/imgutils.h"
36#include "libavutil/internal.h"
38#include "libavutil/mem.h"
39#include "libavutil/opt.h"
41#include "avfilter.h"
42#include "filters.h"
43#include "formats.h"
44#include "video.h"
45
46#ifdef __APPLE__
47/* frei0r plugins use .so on macOS */
48#define FREI0R_SLIBSUF ".so"
49#else
50#define FREI0R_SLIBSUF SLIBSUF
51#endif
52
53typedef f0r_instance_t (*f0r_construct_f)(unsigned int width, unsigned int height);
54typedef void (*f0r_destruct_f)(f0r_instance_t instance);
55typedef void (*f0r_deinit_f)(void);
56typedef int (*f0r_init_f)(void);
57typedef void (*f0r_get_plugin_info_f)(f0r_plugin_info_t *info);
58typedef void (*f0r_get_param_info_f)(f0r_param_info_t *info, int param_index);
59typedef void (*f0r_update_f)(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe);
60typedef void (*f0r_update2_f)(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe);
61typedef void (*f0r_set_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index);
62typedef void (*f0r_get_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index);
63
87
88static void *load_sym(AVFilterContext *ctx, const char *sym_name)
89{
90 Frei0rContext *s = ctx->priv;
91 void *sym = dlsym(s->dl_handle, sym_name);
92 if (!sym)
93 av_log(ctx, AV_LOG_ERROR, "Could not find symbol '%s' in loaded module.\n", sym_name);
94 return sym;
95}
96
97static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
98{
99 Frei0rContext *s = ctx->priv;
100 union {
101 double d;
102 f0r_param_color_t col;
103 f0r_param_position_t pos;
104 f0r_param_string str;
105 } val;
106 char *tail;
107 uint8_t rgba[4];
108
109 switch (info.type) {
110 case F0R_PARAM_BOOL:
111 if (!strcmp(param, "y")) val.d = 1.0;
112 else if (!strcmp(param, "n")) val.d = 0.0;
113 else goto fail;
114 break;
115
116 case F0R_PARAM_DOUBLE:
117 val.d = av_strtod(param, &tail);
118 if (*tail || val.d == HUGE_VAL)
119 goto fail;
120 break;
121
122 case F0R_PARAM_COLOR:
123 if (sscanf(param, "%f/%f/%f", &val.col.r, &val.col.g, &val.col.b) != 3) {
124 if (av_parse_color(rgba, param, -1, ctx) < 0)
125 goto fail;
126 val.col.r = rgba[0] / 255.0;
127 val.col.g = rgba[1] / 255.0;
128 val.col.b = rgba[2] / 255.0;
129 }
130 break;
131
132 case F0R_PARAM_POSITION:
133 if (sscanf(param, "%lf/%lf", &val.pos.x, &val.pos.y) != 2)
134 goto fail;
135 break;
136
137 case F0R_PARAM_STRING:
138 val.str = param;
139 break;
140 }
141
142 s->set_param_value(s->instance, &val, index);
143 return 0;
144
145fail:
146 av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for parameter '%s'.\n",
147 param, info.name ? info.name : "(null)");
148 return AVERROR(EINVAL);
149}
150
151static int set_params(AVFilterContext *ctx, const char *params)
152{
153 Frei0rContext *s = ctx->priv;
154 int i;
155
156 if (!params)
157 return 0;
158
159 for (i = 0; i < s->plugin_info.num_params; i++) {
160 f0r_param_info_t info = { 0 };
161 char *param;
162 int ret;
163
164 s->get_param_info(&info, i);
165
166 if (*params) {
167 if (!(param = av_get_token(&params, "|")))
168 return AVERROR(ENOMEM);
169 if (*params)
170 params++; /* skip ':' */
171 ret = set_param(ctx, info, i, param);
172 av_free(param);
173 if (ret < 0)
174 return ret;
175 }
176 }
177
178 return 0;
179}
180
181static int load_path(AVFilterContext *ctx, void **handle_ptr, const char *prefix, const char *name)
182{
183 char *path = av_asprintf("%s%s%s", prefix, name, FREI0R_SLIBSUF);
184 if (!path)
185 return AVERROR(ENOMEM);
186 av_log(ctx, AV_LOG_DEBUG, "Looking for frei0r effect in '%s'.\n", path);
187 *handle_ptr = dlopen(path, RTLD_NOW|RTLD_LOCAL);
188 av_free(path);
189 return 0;
190}
191
193 const char *dl_name, int type)
194{
195 Frei0rContext *s = ctx->priv;
196 f0r_init_f f0r_init;
197 f0r_get_plugin_info_f f0r_get_plugin_info;
198 f0r_plugin_info_t *pi;
199 char *path;
200 int ret = 0;
201 int i;
202 static const char* const frei0r_pathlist[] = {
203 "/usr/local/lib/frei0r-1/",
204 "/usr/lib/frei0r-1/",
205 "/usr/local/lib64/frei0r-1/",
206 "/usr/lib64/frei0r-1/"
207 };
208
209 if (!dl_name) {
210 av_log(ctx, AV_LOG_ERROR, "No filter name provided.\n");
211 return AVERROR(EINVAL);
212 }
213
214 /* see: http://frei0r.dyne.org/codedoc/html/group__pluglocations.html */
215 if (path = getenv_dup("FREI0R_PATH")) {
216#ifdef _WIN32
217 const char *separator = ";";
218#else
219 const char *separator = ":";
220#endif
221 char *p, *ptr = NULL;
222 for (p = path; p = av_strtok(p, separator, &ptr); p = NULL) {
223 /* add additional trailing slash in case it is missing */
224 char *p1 = av_asprintf("%s/", p);
225 if (!p1) {
226 ret = AVERROR(ENOMEM);
227 goto check_path_end;
228 }
229 ret = load_path(ctx, &s->dl_handle, p1, dl_name);
230 av_free(p1);
231 if (ret < 0)
232 goto check_path_end;
233 if (s->dl_handle)
234 break;
235 }
236
237 check_path_end:
238 av_free(path);
239 if (ret < 0)
240 return ret;
241 }
242 if (!s->dl_handle && (path = getenv_utf8("HOME"))) {
243 char *prefix = av_asprintf("%s/.frei0r-1/lib/", path);
244 if (!prefix) {
245 ret = AVERROR(ENOMEM);
246 goto home_path_end;
247 }
248 ret = load_path(ctx, &s->dl_handle, prefix, dl_name);
250
251 home_path_end:
252 freeenv_utf8(path);
253 if (ret < 0)
254 return ret;
255 }
256 for (i = 0; !s->dl_handle && i < FF_ARRAY_ELEMS(frei0r_pathlist); i++) {
257 ret = load_path(ctx, &s->dl_handle, frei0r_pathlist[i], dl_name);
258 if (ret < 0)
259 return ret;
260 }
261 if (!s->dl_handle) {
262 av_log(ctx, AV_LOG_ERROR, "Could not find module '%s'.\n", dl_name);
263 return AVERROR(EINVAL);
264 }
265
266 if (!(f0r_init = load_sym(ctx, "f0r_init" )) ||
267 !(f0r_get_plugin_info = load_sym(ctx, "f0r_get_plugin_info")) ||
268 !(s->get_param_info = load_sym(ctx, "f0r_get_param_info" )) ||
269 !(s->get_param_value = load_sym(ctx, "f0r_get_param_value")) ||
270 !(s->set_param_value = load_sym(ctx, "f0r_set_param_value")) ||
271 !(s->update = load_sym(ctx, "f0r_update" )) ||
272 !(s->construct = load_sym(ctx, "f0r_construct" )) ||
273 !(s->destruct = load_sym(ctx, "f0r_destruct" )) ||
274 !(s->deinit = load_sym(ctx, "f0r_deinit" )))
275 return AVERROR(EINVAL);
276
277 if (f0r_init() < 0) {
278 av_log(ctx, AV_LOG_ERROR, "Could not init the frei0r module.\n");
279 return AVERROR(EINVAL);
280 }
281
282 f0r_get_plugin_info(&s->plugin_info);
283 pi = &s->plugin_info;
284 if (pi->plugin_type != type) {
286 "Invalid type '%s' for this plugin\n",
287 pi->plugin_type == F0R_PLUGIN_TYPE_FILTER ? "filter" :
288 pi->plugin_type == F0R_PLUGIN_TYPE_SOURCE ? "source" :
289 pi->plugin_type == F0R_PLUGIN_TYPE_MIXER2 ? "mixer2" :
290 pi->plugin_type == F0R_PLUGIN_TYPE_MIXER3 ? "mixer3" : "unknown");
291 return AVERROR(EINVAL);
292 }
293
295 "name:%s author:'%s' explanation:'%s' color_model:%s "
296 "frei0r_version:%d version:%d.%d num_params:%d\n",
297 pi->name ? pi->name : "(null)", pi->author ? pi->author : "(null)",
298 pi->explanation ? pi->explanation : "(null)",
299 pi->color_model == F0R_COLOR_MODEL_BGRA8888 ? "bgra8888" :
300 pi->color_model == F0R_COLOR_MODEL_RGBA8888 ? "rgba8888" :
301 pi->color_model == F0R_COLOR_MODEL_PACKED32 ? "packed32" : "unknown",
302 pi->frei0r_version, pi->major_version, pi->minor_version, pi->num_params);
303
304 return 0;
305}
306
308{
309 Frei0rContext *s = ctx->priv;
310
311 return frei0r_init(ctx, s->dl_name, F0R_PLUGIN_TYPE_FILTER);
312}
313
315{
316 Frei0rContext *s = ctx->priv;
317
318 if (s->destruct && s->instance)
319 s->destruct(s->instance);
320 if (s->deinit)
321 s->deinit();
322 if (s->dl_handle)
323 dlclose(s->dl_handle);
324}
325
327{
328 AVFilterContext *ctx = inlink->dst;
329 Frei0rContext *s = ctx->priv;
330
331 if (s->destruct && s->instance)
332 s->destruct(s->instance);
333 if (!(s->instance = s->construct(inlink->w, inlink->h))) {
334 av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
335 return AVERROR(EINVAL);
336 }
337
338 return set_params(ctx, s->params);
339}
340
342 AVFilterFormatsConfig **cfg_in,
343 AVFilterFormatsConfig **cfg_out)
344{
345 const Frei0rContext *s = ctx->priv;
347 int ret;
348
349 if (s->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) {
350 if ((ret = ff_add_format(&formats, AV_PIX_FMT_BGRA)) < 0)
351 return ret;
352 } else if (s->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) {
353 if ((ret = ff_add_format(&formats, AV_PIX_FMT_RGBA)) < 0)
354 return ret;
355 } else { /* F0R_COLOR_MODEL_PACKED32 */
356 static const enum AVPixelFormat pix_fmts[] = {
358 };
360 }
361
362 if (!formats)
363 return AVERROR(ENOMEM);
364
365 return ff_set_common_formats2(ctx, cfg_in, cfg_out, formats);
366}
367
368static int filter_frame(AVFilterLink *inlink, AVFrame *in)
369{
370 Frei0rContext *s = inlink->dst->priv;
371 AVFilterLink *outlink = inlink->dst->outputs[0];
372 /* align parameter is the line alignment, not the buffer alignment.
373 * frei0r expects line size to be width*4 so we want an align of 1
374 * to ensure lines aren't padded out. */
375 AVFrame *out = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1);
376 if (!out)
377 goto fail;
378
380
381 if (in->linesize[0] != out->linesize[0]) {
382 AVFrame *in2 = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1);
383 if (!in2)
384 goto fail;
385 av_frame_copy(in2, in);
386 if (av_frame_copy_props(in2, in) < 0) {
387 av_frame_free(&in2);
388 goto fail;
389 }
390 av_frame_free(&in);
391 in = in2;
392 }
393
394 s->update(s->instance, in->pts * av_q2d(inlink->time_base),
395 (const uint32_t *)in->data[0],
396 (uint32_t *)out->data[0]);
397
398 av_frame_free(&in);
399
400 return ff_filter_frame(outlink, out);
401fail:
402 av_frame_free(&in);
404 return AVERROR(ENOMEM);
405}
406
407static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
408 char *res, int res_len, int flags)
409{
410 Frei0rContext *s = ctx->priv;
411 int ret;
412
413 ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
414 if (ret < 0)
415 return ret;
416
417 return set_params(ctx, s->params);
418}
419
420#define OFFSET(x) offsetof(Frei0rContext, x)
421#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
422#define TFLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
423static const AVOption frei0r_options[] = {
424 { "filter_name", NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
425 { "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = TFLAGS },
426 { NULL }
427};
428
430
432 {
433 .name = "default",
434 .type = AVMEDIA_TYPE_VIDEO,
435 .config_props = config_input_props,
436 .filter_frame = filter_frame,
437 },
438};
439
441 .p.name = "frei0r",
442 .p.description = NULL_IF_CONFIG_SMALL("Apply a frei0r effect."),
443 .p.priv_class = &frei0r_class,
445 .init = filter_init,
446 .uninit = uninit,
447 .priv_size = sizeof(Frei0rContext),
451 .process_command = process_command,
452};
453
455{
456 Frei0rContext *s = ctx->priv;
457
458 s->time_base.num = s->framerate.den;
459 s->time_base.den = s->framerate.num;
460
461 return frei0r_init(ctx, s->dl_name, F0R_PLUGIN_TYPE_SOURCE);
462}
463
465{
466 AVFilterContext *ctx = outlink->src;
467 FilterLink *l = ff_filter_link(outlink);
468 Frei0rContext *s = ctx->priv;
469
470 if (av_image_check_size(s->w, s->h, 0, ctx) < 0)
471 return AVERROR(EINVAL);
472 outlink->w = s->w;
473 outlink->h = s->h;
474 outlink->time_base = s->time_base;
475 l->frame_rate = av_inv_q(s->time_base);
476 outlink->sample_aspect_ratio = (AVRational){1,1};
477
478 if (s->destruct && s->instance)
479 s->destruct(s->instance);
480 if (!(s->instance = s->construct(outlink->w, outlink->h))) {
481 av_log(ctx, AV_LOG_ERROR, "Impossible to load frei0r instance.\n");
482 return AVERROR(EINVAL);
483 }
484 if (!s->params) {
485 av_log(ctx, AV_LOG_ERROR, "frei0r filter parameters not set.\n");
486 return AVERROR(EINVAL);
487 }
488
489 return set_params(ctx, s->params);
490}
491
493{
494 Frei0rContext *s = outlink->src->priv;
495 AVFrame *frame = ff_default_get_video_buffer2(outlink, outlink->w, outlink->h, 1);
496
497 if (!frame)
498 return AVERROR(ENOMEM);
499
500 frame->sample_aspect_ratio = (AVRational) {1, 1};
501 frame->pts = s->pts++;
502 frame->duration = 1;
503
504 s->update(s->instance, av_rescale_q(frame->pts, s->time_base, (AVRational){1,1000}),
505 NULL, (uint32_t *)frame->data[0]);
506
507 return ff_filter_frame(outlink, frame);
508}
509
510static const AVOption frei0r_src_options[] = {
511 { "size", "Dimensions of the generated video.", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "320x240" }, .flags = FLAGS },
512 { "framerate", NULL, OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, .flags = FLAGS },
513 { "filter_name", NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
514 { "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS },
515 { NULL },
516};
517
519
521 {
522 .name = "default",
523 .type = AVMEDIA_TYPE_VIDEO,
524 .request_frame = source_request_frame,
525 .config_props = source_config_props
526 },
527};
528
530 .p.name = "frei0r_src",
531 .p.description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."),
532 .p.priv_class = &frei0r_src_class,
533 .p.inputs = NULL,
534 .priv_size = sizeof(Frei0rContext),
535 .init = source_init,
536 .uninit = uninit,
539};
SwsAArch64OpImplParams params
Definition ops.c:51
static double val(void *priv, double ch)
Definition aeval.c:77
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
#define TFLAGS
Definition af_afade.c:66
const FFFilter ff_vf_frei0r
Definition vf_frei0r.c:440
const FFFilter ff_vsrc_frei0r_src
Definition vf_frei0r.c:529
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
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.
char * av_asprintf(const char *fmt,...)
Definition avstring.c:115
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
common internal and external API header
#define NULL
Definition coverity.c:32
static AVFrame * frame
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
Definition eval.c:110
simple arithmetic expression evaluator
static char separator(CheckasmFormat format)
Definition checkasm.c:149
int ff_set_common_formats2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, AVFilterFormats *formats)
Definition formats.c:1137
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition formats.c:571
av_warn_unused_result AVFilterFormats * ff_make_pixel_format_list(const enum AVPixelFormat *fmts)
Create a list of supported pixel formats.
static char * getenv_dup(const char *varname)
Definition getenv_utf8.h:76
static char * getenv_utf8(const char *varname)
Definition getenv_utf8.h:67
static void freeenv_utf8(char *var)
Definition getenv_utf8.h:72
#define fail
Definition test.h:479
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition opt.h:302
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition avfilter.h:196
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
Definition frame.c:711
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_VERBOSE
Detailed information.
Definition log.h:226
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition rational.h:104
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
Definition rational.h:159
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
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...
Definition imgutils.c:318
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
Definition avstring.c:179
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
Definition avstring.c:143
int index
Definition gxfenc.c:90
cl_device_type type
misc image utilities
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
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
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
uint8_t w
Definition llvidencdsp.c:39
Memory handling functions.
AVOptions.
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.
Definition parseutils.c:359
misc parsing utilities
AVPixelFormat
Pixel format.
Definition pixfmt.h:71
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
const char * name
Definition qsvenc.c:142
formats
Definition signature.h:47
#define FF_ARRAY_ELEMS(a)
unsigned int pos
Definition spdifenc.c:431
Describe the class of an AVClass context structure.
Definition log.h:76
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
AVFilterLink ** outputs
array of pointers to output links
Definition avfilter.h:285
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
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition frame.h:517
AVOption.
Definition opt.h:428
Rational number (pair of numerator and denominator).
Definition rational.h:58
f0r_construct_f construct
Definition vf_frei0r.c:74
f0r_instance_t instance
Definition vf_frei0r.c:68
f0r_set_param_value_f set_param_value
Definition vf_frei0r.c:73
char * params
Definition vf_frei0r.c:79
f0r_update_f update
Definition vf_frei0r.c:66
f0r_get_param_info_f get_param_info
Definition vf_frei0r.c:71
f0r_plugin_info_t plugin_info
Definition vf_frei0r.c:69
f0r_destruct_f destruct
Definition vf_frei0r.c:75
uint64_t pts
Definition vf_frei0r.c:85
f0r_deinit_f deinit
Definition vf_frei0r.c:76
AVRational time_base
Definition vf_frei0r.c:84
f0r_get_param_value_f get_param_value
Definition vf_frei0r.c:72
char * dl_name
Definition vf_frei0r.c:78
void * dl_handle
Definition vf_frei0r.c:67
AVRational framerate
Definition vf_frei0r.c:80
#define av_free(p)
#define av_log(a,...)
float framerate
Definition av1_levels.c:29
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
char prefix[8]
static const AVFilterPad avfilter_vf_frei0r_inputs[]
Definition vf_frei0r.c:431
void(* f0r_get_param_info_f)(f0r_param_info_t *info, int param_index)
Definition vf_frei0r.c:58
void(* f0r_update_f)(f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe)
Definition vf_frei0r.c:59
int(* f0r_init_f)(void)
Definition vf_frei0r.c:56
void(* f0r_get_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index)
Definition vf_frei0r.c:62
void(* f0r_set_param_value_f)(f0r_instance_t instance, f0r_param_t param, int param_index)
Definition vf_frei0r.c:61
f0r_instance_t(* f0r_construct_f)(unsigned int width, unsigned int height)
Definition vf_frei0r.c:53
static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
Definition vf_frei0r.c:97
static const AVOption frei0r_options[]
Definition vf_frei0r.c:423
static int set_params(AVFilterContext *ctx, const char *params)
Definition vf_frei0r.c:151
static int config_input_props(AVFilterLink *inlink)
Definition vf_frei0r.c:326
static int load_path(AVFilterContext *ctx, void **handle_ptr, const char *prefix, const char *name)
Definition vf_frei0r.c:181
void(* f0r_deinit_f)(void)
Definition vf_frei0r.c:55
static av_cold int source_init(AVFilterContext *ctx)
Definition vf_frei0r.c:454
static av_cold int frei0r_init(AVFilterContext *ctx, const char *dl_name, int type)
Definition vf_frei0r.c:192
void(* f0r_get_plugin_info_f)(f0r_plugin_info_t *info)
Definition vf_frei0r.c:57
#define FREI0R_SLIBSUF
Definition vf_frei0r.c:50
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition vf_frei0r.c:368
static void * load_sym(AVFilterContext *ctx, const char *sym_name)
Definition vf_frei0r.c:88
static const AVOption frei0r_src_options[]
Definition vf_frei0r.c:510
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition vf_frei0r.c:341
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition vf_frei0r.c:407
static av_cold void uninit(AVFilterContext *ctx)
Definition vf_frei0r.c:314
#define OFFSET(x)
Definition vf_frei0r.c:420
static int source_request_frame(AVFilterLink *outlink)
Definition vf_frei0r.c:492
void(* f0r_update2_f)(f0r_instance_t instance, double time, const uint32_t *inframe1, const uint32_t *inframe2, const uint32_t *inframe3, uint32_t *outframe)
Definition vf_frei0r.c:60
static av_cold int filter_init(AVFilterContext *ctx)
Definition vf_frei0r.c:307
static int source_config_props(AVFilterLink *outlink)
Definition vf_frei0r.c:464
void(* f0r_destruct_f)(f0r_instance_t instance)
Definition vf_frei0r.c:54
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
Definition vf_frei0r.c:520
AVFrame * ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align)
Definition video.c:49
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37