FFmpeg  4.3
Data Structures | Macros | Functions | Variables
vsrc_gradients.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  GradientsContext
 

Macros

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

Functions

 AVFILTER_DEFINE_CLASS (gradients)
 
static int query_formats (AVFilterContext *ctx)
 
static uint32_t lerp_color (uint8_t c0[4], uint8_t c1[4], float x)
 
static uint64_t lerp_color16 (uint8_t c0[4], uint8_t c1[4], float x)
 
static uint32_t lerp_colors (uint8_t arr[3][4], int nb_colors, float step)
 
static uint64_t lerp_colors16 (uint8_t arr[3][4], int nb_colors, float step)
 
static float project (float origin_x, float origin_y, float dest_x, float dest_y, int point_x, int point_y)
 
static int draw_gradients_slice (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int draw_gradients_slice16 (AVFilterContext *ctx, void *arg, int job, int nb_jobs)
 
static int config_output (AVFilterLink *inlink)
 
static int gradients_request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption gradients_options []
 
static const AVFilterPad gradients_outputs []
 
AVFilter ff_vsrc_gradients
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 52 of file vsrc_gradients.c.

◆ FLAGS

Definition at line 53 of file vsrc_gradients.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( gradients  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 80 of file vsrc_gradients.c.

◆ lerp_color()

static uint32_t lerp_color ( uint8_t  c0[4],
uint8_t  c1[4],
float  x 
)
static

Definition at line 94 of file vsrc_gradients.c.

Referenced by lerp_colors().

◆ lerp_color16()

static uint64_t lerp_color16 ( uint8_t  c0[4],
uint8_t  c1[4],
float  x 
)
static

Definition at line 104 of file vsrc_gradients.c.

Referenced by lerp_colors16().

◆ lerp_colors()

static uint32_t lerp_colors ( uint8_t  arr[3][4],
int  nb_colors,
float  step 
)
static

Definition at line 114 of file vsrc_gradients.c.

Referenced by draw_gradients_slice().

◆ lerp_colors16()

static uint64_t lerp_colors16 ( uint8_t  arr[3][4],
int  nb_colors,
float  step 
)
static

Definition at line 132 of file vsrc_gradients.c.

Referenced by draw_gradients_slice16().

◆ project()

static float project ( float  origin_x,
float  origin_y,
float  dest_x,
float  dest_y,
int  point_x,
int  point_y 
)
static

Definition at line 150 of file vsrc_gradients.c.

Referenced by draw_gradients_slice(), and draw_gradients_slice16().

◆ draw_gradients_slice()

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

Definition at line 170 of file vsrc_gradients.c.

◆ draw_gradients_slice16()

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

Definition at line 193 of file vsrc_gradients.c.

◆ config_output()

static int config_output ( AVFilterLink inlink)
static

Definition at line 214 of file vsrc_gradients.c.

◆ gradients_request_frame()

static int gradients_request_frame ( AVFilterLink outlink)
static

Definition at line 245 of file vsrc_gradients.c.

Variable Documentation

◆ gradients_options

const AVOption gradients_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 },
{"c0", "set 1st color", OFFSET(color_rgba[0]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c1", "set 2nd color", OFFSET(color_rgba[1]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c2", "set 3rd color", OFFSET(color_rgba[2]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c3", "set 4th color", OFFSET(color_rgba[3]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c4", "set 5th color", OFFSET(color_rgba[4]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c5", "set 6th color", OFFSET(color_rgba[5]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c6", "set 7th color", OFFSET(color_rgba[6]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"c7", "set 8th color", OFFSET(color_rgba[7]), AV_OPT_TYPE_COLOR, {.str = "random"}, 0, 0, FLAGS },
{"x0", "set gradient line source x0", OFFSET(x0), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, FLAGS },
{"y0", "set gradient line source y0", OFFSET(y0), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, FLAGS },
{"x1", "set gradient line destination x1", OFFSET(x1), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, FLAGS },
{"y1", "set gradient line destination y1", OFFSET(y1), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, FLAGS },
{"nb_colors", "set the number of colors", OFFSET(nb_colors), AV_OPT_TYPE_INT, {.i64=2}, 2, 8, FLAGS },
{"n", "set the number of colors", OFFSET(nb_colors), AV_OPT_TYPE_INT, {.i64=2}, 2, 8, FLAGS },
{"seed", "set the seed", OFFSET(seed), AV_OPT_TYPE_INT64, {.i64=-1}, -1, UINT32_MAX, FLAGS },
{NULL},
}

Definition at line 55 of file vsrc_gradients.c.

◆ gradients_outputs

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

Definition at line 271 of file vsrc_gradients.c.

◆ ff_vsrc_gradients

AVFilter ff_vsrc_gradients
Initial value:
= {
.name = "gradients",
.description = NULL_IF_CONFIG_SMALL("Draw a gradients."),
.priv_size = sizeof(GradientsContext),
.priv_class = &gradients_class,
}

Definition at line 281 of file vsrc_gradients.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vsrc_gradients.c:80
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:236
config_output
static int config_output(AVFilterLink *inlink)
Definition: vsrc_gradients.c:214
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
OFFSET
#define OFFSET(x)
Definition: vsrc_gradients.c:52
NULL
#define NULL
Definition: coverity.c:32
gradients_outputs
static const AVFilterPad gradients_outputs[]
Definition: vsrc_gradients.c:271
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:238
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:233
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
FLAGS
#define FLAGS
Definition: vsrc_gradients.c:53
GradientsContext
Definition: vsrc_gradients.c:34
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
gradients_request_frame
static int gradients_request_frame(AVFilterLink *outlink)
Definition: vsrc_gradients.c:245
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