vf_frei0r.c File Reference

frei0r wrapper More...

#include <dlfcn.h>
#include <frei0r.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
Include dependency graph for vf_frei0r.c:

Go to the source code of this file.

Data Structures

struct  Frei0rContext
 

Macros

#define OFFSET(x)   offsetof(Frei0rContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Typedefs

typedef f0r_instance_t(* f0r_construct_f) (unsigned int width, unsigned int height)
 
typedef void(* f0r_destruct_f) (f0r_instance_t instance)
 
typedef void(* f0r_deinit_f) (void)
 
typedef int(* f0r_init_f) (void)
 
typedef void(* f0r_get_plugin_info_f) (f0r_plugin_info_t *info)
 
typedef void(* f0r_get_param_info_f) (f0r_param_info_t *info, int param_index)
 
typedef void(* f0r_update_f) (f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe)
 
typedef 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)
 
typedef void(* f0r_set_param_value_f) (f0r_instance_t instance, f0r_param_t param, int param_index)
 
typedef void(* f0r_get_param_value_f) (f0r_instance_t instance, f0r_param_t param, int param_index)
 
typedef struct Frei0rContext Frei0rContext
 

Functions

static voidload_sym (AVFilterContext *ctx, const char *sym_name)
 
static int set_param (AVFilterContext *ctx, f0r_param_info_t info, int index, char *param)
 
static int set_params (AVFilterContext *ctx, const char *params)
 
static int load_path (AVFilterContext *ctx, void **handle_ptr, const char *prefix, const char *name)
 
static av_cold int frei0r_init (AVFilterContext *ctx, const char *dl_name, int type)
 
static av_cold int filter_init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_input_props (AVFilterLink *inlink)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold int source_init (AVFilterContext *ctx)
 
static int source_config_props (AVFilterLink *outlink)
 
static int source_request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption filter_options []
 
static const AVClass filter_class
 
static const AVFilterPad avfilter_vf_frei0r_inputs []
 
static const AVFilterPad avfilter_vf_frei0r_outputs []
 
AVFilter avfilter_vf_frei0r
 
static const AVOption src_options []
 
static const AVClass src_class
 
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs []
 
AVFilter avfilter_vsrc_frei0r_src
 

Detailed Description

frei0r wrapper

Definition in file vf_frei0r.c.

Macro Definition Documentation

Definition at line 409 of file vf_frei0r.c.

#define OFFSET (   x)    offsetof(Frei0rContext, x)

Definition at line 408 of file vf_frei0r.c.

Typedef Documentation

typedef f0r_instance_t(* f0r_construct_f) (unsigned int width, unsigned int height)

Definition at line 45 of file vf_frei0r.c.

typedef void(* f0r_deinit_f) (void)

Definition at line 47 of file vf_frei0r.c.

typedef void(* f0r_destruct_f) (f0r_instance_t instance)

Definition at line 46 of file vf_frei0r.c.

typedef void(* f0r_get_param_info_f) (f0r_param_info_t *info, int param_index)

Definition at line 50 of file vf_frei0r.c.

typedef void(* f0r_get_param_value_f) (f0r_instance_t instance, f0r_param_t param, int param_index)

Definition at line 54 of file vf_frei0r.c.

typedef void(* f0r_get_plugin_info_f) (f0r_plugin_info_t *info)

Definition at line 49 of file vf_frei0r.c.

typedef int(* f0r_init_f) (void)

Definition at line 48 of file vf_frei0r.c.

typedef void(* f0r_set_param_value_f) (f0r_instance_t instance, f0r_param_t param, int param_index)

Definition at line 53 of file vf_frei0r.c.

typedef 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 at line 52 of file vf_frei0r.c.

typedef void(* f0r_update_f) (f0r_instance_t instance, double time, const uint32_t *inframe, uint32_t *outframe)

Definition at line 51 of file vf_frei0r.c.

typedef struct Frei0rContext Frei0rContext

Function Documentation

static int config_input_props ( AVFilterLink inlink)
static

Definition at line 350 of file vf_frei0r.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 386 of file vf_frei0r.c.

static av_cold int filter_init ( AVFilterContext ctx)
static

Definition at line 331 of file vf_frei0r.c.

static av_cold int frei0r_init ( AVFilterContext ctx,
const char *  dl_name,
int  type 
)
static

Definition at line 224 of file vf_frei0r.c.

Referenced by filter_init(), and source_init().

static int load_path ( AVFilterContext ctx,
void **  handle_ptr,
const char *  prefix,
const char *  name 
)
static

Definition at line 213 of file vf_frei0r.c.

Referenced by frei0r_init().

static void* load_sym ( AVFilterContext ctx,
const char *  sym_name 
)
static

Definition at line 81 of file vf_frei0r.c.

Referenced by frei0r_init().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 363 of file vf_frei0r.c.

static int set_param ( AVFilterContext ctx,
f0r_param_info_t  info,
int  index,
char *  param 
)
static

Definition at line 90 of file vf_frei0r.c.

Referenced by set_params().

static int set_params ( AVFilterContext ctx,
const char *  params 
)
static

Definition at line 139 of file vf_frei0r.c.

Referenced by config_input_props(), and source_config_props().

static int source_config_props ( AVFilterLink outlink)
static

Definition at line 477 of file vf_frei0r.c.

static av_cold int source_init ( AVFilterContext ctx)
static

Definition at line 457 of file vf_frei0r.c.

static int source_request_frame ( AVFilterLink outlink)
static

Definition at line 497 of file vf_frei0r.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 338 of file vf_frei0r.c.

Variable Documentation

AVFilter avfilter_vf_frei0r
Initial value:
= {
.name = "frei0r",
.description = NULL_IF_CONFIG_SMALL("Apply a frei0r effect."),
.query_formats = query_formats,
.init = filter_init,
.uninit = uninit,
.priv_size = sizeof(Frei0rContext),
.priv_class = &filter_class,
}
static av_cold int filter_init(AVFilterContext *ctx)
Definition: vf_frei0r.c:331
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static const AVFilterPad avfilter_vf_frei0r_outputs[]
Definition: vf_frei0r.c:433
static int query_formats(AVFilterContext *ctx)
Definition: vf_frei0r.c:363
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_frei0r.c:338
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
struct Frei0rContext Frei0rContext
static const AVFilterPad avfilter_vf_frei0r_inputs[]
Definition: vf_frei0r.c:423
static const AVClass filter_class
Definition: vf_frei0r.c:416
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs

Definition at line 441 of file vf_frei0r.c.

const AVFilterPad avfilter_vf_frei0r_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input_props,
.filter_frame = filter_frame,
},
{ NULL }
}
static int config_input_props(AVFilterLink *inlink)
Definition: vf_frei0r.c:350
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_frei0r.c:386

Definition at line 423 of file vf_frei0r.c.

const AVFilterPad avfilter_vf_frei0r_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 433 of file vf_frei0r.c.

AVFilter avfilter_vsrc_frei0r_src
Initial value:
= {
.name = "frei0r_src",
.description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."),
.priv_size = sizeof(Frei0rContext),
.priv_class = &src_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:117
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static int query_formats(AVFilterContext *ctx)
Definition: vf_frei0r.c:363
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_frei0r.c:338
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
Definition: vf_frei0r.c:529
struct Frei0rContext Frei0rContext
static const AVClass src_class
Definition: vf_frei0r.c:522
NULL
Definition: eval.c:55
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
static av_cold int source_init(AVFilterContext *ctx)
Definition: vf_frei0r.c:457

Definition at line 539 of file vf_frei0r.c.

const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = source_request_frame,
.config_props = source_config_props
},
{ NULL }
}
static int source_config_props(AVFilterLink *outlink)
Definition: vf_frei0r.c:477
NULL
Definition: eval.c:55
static int source_request_frame(AVFilterLink *outlink)
Definition: vf_frei0r.c:497

Definition at line 529 of file vf_frei0r.c.

const AVClass filter_class
static
Initial value:
= {
.class_name = "frei0r",
.item_name = av_default_item_name,
.option = filter_options,
}
av_default_item_name
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVOption filter_options[]
Definition: vf_frei0r.c:410

Definition at line 416 of file vf_frei0r.c.

const AVOption filter_options[]
static
Initial value:
= {
{ "filter_name", NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ NULL },
}
#define FLAGS
Definition: vf_frei0r.c:409
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: vf_frei0r.c:408
const char const char * params
Definition: avisynth_c.h:675

Definition at line 410 of file vf_frei0r.c.

const AVClass src_class
static
Initial value:
= {
.class_name = "frei0r_src",
.item_name = av_default_item_name,
.option = src_options,
}
av_default_item_name
static const AVOption src_options[]
Definition: vf_frei0r.c:514
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 522 of file vf_frei0r.c.

const AVOption src_options[]
static
Initial value:
= {
{ "size", "Dimensions of the generated video.", OFFSET(size), AV_OPT_TYPE_STRING, { .str = "" }, .flags = FLAGS },
{ "framerate", NULL, OFFSET(framerate), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = FLAGS },
{ "filter_name", NULL, OFFSET(dl_name), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ "filter_params", NULL, OFFSET(params), AV_OPT_TYPE_STRING, .flags = FLAGS },
{ NULL },
}
#define FLAGS
Definition: vf_frei0r.c:409
int size
NULL
Definition: eval.c:55
#define OFFSET(x)
Definition: vf_frei0r.c:408
const char const char * params
Definition: avisynth_c.h:675

Definition at line 514 of file vf_frei0r.c.