FFmpeg  4.3
Data Structures | Macros | Functions | Variables
vsrc_sierpinski.c File Reference
#include "avfilter.h"
#include "formats.h"
#include "video.h"
#include "internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
#include <float.h>
#include <math.h>

Go to the source code of this file.

Data Structures

struct  SierpinskiContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (sierpinski)
 
static int query_formats (AVFilterContext *ctx)
 
static int fill_sierpinski (SierpinskiContext *s, int x, int y)
 
static int draw_triangle_slice (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int draw_carpet_slice (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int config_output (AVFilterLink *inlink)
 
static void draw_sierpinski (AVFilterContext *ctx, AVFrame *frame)
 
static int sierpinski_request_frame (AVFilterLink *link)
 

Variables

static const AVOption sierpinski_options []
 
static const AVFilterPad sierpinski_outputs []
 
AVFilter ff_vsrc_sierpinski
 

Detailed Description

Sierpinski carpet fractal renderer

Definition in file vsrc_sierpinski.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 56 of file vsrc_sierpinski.c.

◆ FLAGS

Definition at line 57 of file vsrc_sierpinski.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( sierpinski  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 74 of file vsrc_sierpinski.c.

◆ fill_sierpinski()

static int fill_sierpinski ( SierpinskiContext s,
int  x,
int  y 
)
static

Definition at line 87 of file vsrc_sierpinski.c.

Referenced by draw_carpet_slice().

◆ draw_triangle_slice()

static int draw_triangle_slice ( AVFilterContext ctx,
void arg,
int  job,
int  nb_jobs 
)
static

Definition at line 103 of file vsrc_sierpinski.c.

Referenced by config_output().

◆ draw_carpet_slice()

static int draw_carpet_slice ( AVFilterContext ctx,
void arg,
int  job,
int  nb_jobs 
)
static

Definition at line 128 of file vsrc_sierpinski.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink inlink)
static

Definition at line 153 of file vsrc_sierpinski.c.

◆ draw_sierpinski()

static void draw_sierpinski ( AVFilterContext ctx,
AVFrame frame 
)
static

Definition at line 174 of file vsrc_sierpinski.c.

Referenced by sierpinski_request_frame().

◆ sierpinski_request_frame()

static int sierpinski_request_frame ( AVFilterLink link)
static

Definition at line 200 of file vsrc_sierpinski.c.

Variable Documentation

◆ sierpinski_options

const AVOption sierpinski_options[]
static
Initial value:
= {
{"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, 0, 0, FLAGS },
{"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, 0, 0, FLAGS },
{"rate", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
{"r", "set frame rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
{"seed", "set the seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT32_MAX, FLAGS },
{"jump", "set the jump", OFFSET(jump), AV_OPT_TYPE_INT, {.i64=100}, 1, 10000, FLAGS },
{"type","set fractal type",OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "type" },
{"carpet", "sierpinski carpet", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "type" },
{"triangle", "sierpinski triangle", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "type" },
{NULL},
}

Definition at line 59 of file vsrc_sierpinski.c.

◆ sierpinski_outputs

const AVFilterPad sierpinski_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = sierpinski_request_frame,
.config_props = config_output,
},
{ NULL }
}

Definition at line 216 of file vsrc_sierpinski.c.

◆ ff_vsrc_sierpinski

AVFilter ff_vsrc_sierpinski
Initial value:
= {
.name = "sierpinski",
.description = NULL_IF_CONFIG_SMALL("Render a Sierpinski fractal."),
.priv_size = sizeof(SierpinskiContext),
.priv_class = &sierpinski_class,
}

Definition at line 226 of file vsrc_sierpinski.c.

AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:236
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
FLAGS
#define FLAGS
Definition: vsrc_sierpinski.c:57
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
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vsrc_sierpinski.c:74
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
seed
static unsigned int seed
Definition: videogen.c:78
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
sierpinski_outputs
static const AVFilterPad sierpinski_outputs[]
Definition: vsrc_sierpinski.c:216
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
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
config_output
static int config_output(AVFilterLink *inlink)
Definition: vsrc_sierpinski.c:153
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:116
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:564
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:232
sierpinski_request_frame
static int sierpinski_request_frame(AVFilterLink *link)
Definition: vsrc_sierpinski.c:200
SierpinskiContext
Definition: vsrc_sierpinski.c:39
OFFSET
#define OFFSET(x)
Definition: vsrc_sierpinski.c:56