FFmpeg  4.3
Data Structures | Macros | Typedefs | Functions | Variables
vf_frei0r.c File Reference
#include <dlfcn.h>
#include <frei0r.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "config.h"
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/eval.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"

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)
 

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)
 
 AVFILTER_DEFINE_CLASS (frei0r)
 
static av_cold int source_init (AVFilterContext *ctx)
 
static int source_config_props (AVFilterLink *outlink)
 
static int source_request_frame (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (frei0r_src)
 

Variables

static const AVOption frei0r_options []
 
static const AVFilterPad avfilter_vf_frei0r_inputs []
 
static const AVFilterPad avfilter_vf_frei0r_outputs []
 
AVFilter ff_vf_frei0r
 
static const AVOption frei0r_src_options []
 
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs []
 
AVFilter ff_vsrc_frei0r_src
 

Detailed Description

frei0r wrapper

Definition in file vf_frei0r.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 374 of file vf_frei0r.c.

◆ FLAGS

Definition at line 375 of file vf_frei0r.c.

Typedef Documentation

◆ f0r_construct_f

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

Definition at line 45 of file vf_frei0r.c.

◆ f0r_destruct_f

typedef void(* f0r_destruct_f) (f0r_instance_t instance)

Definition at line 46 of file vf_frei0r.c.

◆ f0r_deinit_f

typedef void(* f0r_deinit_f) (void)

Definition at line 47 of file vf_frei0r.c.

◆ f0r_init_f

typedef int(* f0r_init_f) (void)

Definition at line 48 of file vf_frei0r.c.

◆ f0r_get_plugin_info_f

typedef void(* f0r_get_plugin_info_f) (f0r_plugin_info_t *info)

Definition at line 49 of file vf_frei0r.c.

◆ f0r_get_param_info_f

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

Definition at line 50 of file vf_frei0r.c.

◆ f0r_update_f

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.

◆ f0r_update2_f

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.

◆ f0r_set_param_value_f

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.

◆ f0r_get_param_value_f

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.

Function Documentation

◆ load_sym()

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

Definition at line 80 of file vf_frei0r.c.

Referenced by frei0r_init().

◆ set_param()

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

Definition at line 89 of file vf_frei0r.c.

Referenced by set_params().

◆ set_params()

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

Definition at line 143 of file vf_frei0r.c.

Referenced by config_input_props(), and source_config_props().

◆ load_path()

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

Definition at line 173 of file vf_frei0r.c.

Referenced by frei0r_init().

◆ frei0r_init()

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

Definition at line 184 of file vf_frei0r.c.

Referenced by filter_init(), and source_init().

◆ filter_init()

static av_cold int filter_init ( AVFilterContext ctx)
static

Definition at line 293 of file vf_frei0r.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 300 of file vf_frei0r.c.

◆ config_input_props()

static int config_input_props ( AVFilterLink inlink)
static

Definition at line 312 of file vf_frei0r.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 327 of file vf_frei0r.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 352 of file vf_frei0r.c.

◆ AVFILTER_DEFINE_CLASS() [1/2]

AVFILTER_DEFINE_CLASS ( frei0r  )

◆ source_init()

static av_cold int source_init ( AVFilterContext ctx)
static

Definition at line 414 of file vf_frei0r.c.

◆ source_config_props()

static int source_config_props ( AVFilterLink outlink)
static

Definition at line 424 of file vf_frei0r.c.

◆ source_request_frame()

static int source_request_frame ( AVFilterLink outlink)
static

Definition at line 451 of file vf_frei0r.c.

◆ AVFILTER_DEFINE_CLASS() [2/2]

AVFILTER_DEFINE_CLASS ( frei0r_src  )

Variable Documentation

◆ frei0r_options

const AVOption frei0r_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 }
}

Definition at line 376 of file vf_frei0r.c.

◆ avfilter_vf_frei0r_inputs

const AVFilterPad avfilter_vf_frei0r_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input_props,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 384 of file vf_frei0r.c.

◆ avfilter_vf_frei0r_outputs

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

Definition at line 394 of file vf_frei0r.c.

◆ ff_vf_frei0r

AVFilter ff_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 = &frei0r_class,
}

Definition at line 402 of file vf_frei0r.c.

◆ frei0r_src_options

const AVOption frei0r_src_options[]
static
Initial value:
= {
{ "size", "Dimensions of the generated video.", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "320x240" }, .flags = FLAGS },
{ "framerate", NULL, OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, .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 },
}

Definition at line 468 of file vf_frei0r.c.

◆ avfilter_vsrc_frei0r_src_outputs

const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = source_request_frame,
.config_props = source_config_props
},
{ NULL }
}

Definition at line 478 of file vf_frei0r.c.

◆ ff_vsrc_frei0r_src

AVFilter ff_vsrc_frei0r_src
Initial value:
= {
.name = "frei0r_src",
.description = NULL_IF_CONFIG_SMALL("Generate a frei0r source."),
.priv_size = sizeof(Frei0rContext),
.priv_class = &frei0r_src_class,
}

Definition at line 488 of file vf_frei0r.c.

Frei0rContext
Definition: vf_frei0r.c:56
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:236
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_frei0r.c:300
source_init
static av_cold int source_init(AVFilterContext *ctx)
Definition: vf_frei0r.c:414
framerate
int framerate
Definition: h264_levels.c:65
source_request_frame
static int source_request_frame(AVFilterLink *outlink)
Definition: vf_frei0r.c:451
OFFSET
#define OFFSET(x)
Definition: vf_frei0r.c:374
source_config_props
static int source_config_props(AVFilterLink *outlink)
Definition: vf_frei0r.c:424
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_frei0r.c:352
config_input_props
static int config_input_props(AVFilterLink *inlink)
Definition: vf_frei0r.c:312
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:233
filter_init
static av_cold int filter_init(AVFilterContext *ctx)
Definition: vf_frei0r.c:293
inputs
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: filter_design.txt:243
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_frei0r.c:327
FLAGS
#define FLAGS
Definition: vf_frei0r.c:375
avfilter_vf_frei0r_outputs
static const AVFilterPad avfilter_vf_frei0r_outputs[]
Definition: vf_frei0r.c:394
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
avfilter_vsrc_frei0r_src_outputs
static const AVFilterPad avfilter_vsrc_frei0r_src_outputs[]
Definition: vf_frei0r.c:478
avfilter_vf_frei0r_inputs
static const AVFilterPad avfilter_vf_frei0r_inputs[]
Definition: vf_frei0r.c:384
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227