FFmpeg
Data Structures | Macros | Functions | Variables
vf_mix.c File Reference
#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "framesync.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  MixContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define FAST_TMIX_SLICE(type, stype, round)
 
#define MIX_SLICE(type, fun, clip)
 
#define CLIP8(x, min, max)   av_clip_uint8(x)
 
#define CLIP16(x, min, max)   av_clip(x, min, max)
 
#define CLIPF(x, min, max)   (x)
 
#define NOP(x)   (x)
 
#define OFFSET(x)   offsetof(MixContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 
#define TFLAGS   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int parse_weights (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static int mix_frames (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static int activate (AVFilterContext *ctx)
 

Variables

static const AVOption mix_options []
 
static const AVFilterPad outputs []
 

Macro Definition Documentation

◆ FAST_TMIX_SLICE

#define FAST_TMIX_SLICE (   type,
  stype,
  round 
)

Definition at line 160 of file vf_mix.c.

◆ MIX_SLICE

#define MIX_SLICE (   type,
  fun,
  clip 
)

Definition at line 199 of file vf_mix.c.

◆ CLIP8

#define CLIP8 (   x,
  min,
  max 
)    av_clip_uint8(x)

Definition at line 240 of file vf_mix.c.

◆ CLIP16

#define CLIP16 (   x,
  min,
  max 
)    av_clip(x, min, max)

Definition at line 241 of file vf_mix.c.

◆ CLIPF

#define CLIPF (   x,
  min,
  max 
)    (x)

Definition at line 242 of file vf_mix.c.

◆ NOP

#define NOP (   x)    (x)

Definition at line 243 of file vf_mix.c.

◆ OFFSET

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

Definition at line 435 of file vf_mix.c.

◆ FLAGS

Definition at line 436 of file vf_mix.c.

◆ TFLAGS

Definition at line 437 of file vf_mix.c.

Function Documentation

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 67 of file vf_mix.c.

◆ parse_weights()

static int parse_weights ( AVFilterContext ctx)
static

Definition at line 85 of file vf_mix.c.

Referenced by init(), and process_command().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 124 of file vf_mix.c.

◆ mix_frames()

static int mix_frames ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 245 of file vf_mix.c.

Referenced by process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 282 of file vf_mix.c.

Referenced by config_output().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 318 of file vf_mix.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 398 of file vf_mix.c.

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 417 of file vf_mix.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 429 of file vf_mix.c.

Variable Documentation

◆ mix_options

const AVOption mix_options[]
static
Initial value:
= {
{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT16_MAX, .flags = FLAGS },
{ "weights", "set weight for each input", OFFSET(weights_str), AV_OPT_TYPE_STRING, {.str="1 1"}, 0, 0, .flags = TFLAGS },
{ "scale", "set scale", OFFSET(scale), AV_OPT_TYPE_FLOAT, {.dbl=0}, 0, INT16_MAX, .flags = TFLAGS },
{ "planes", "set what planes to filter", OFFSET(planes), AV_OPT_TYPE_FLAGS, {.i64=15}, 0, 15, .flags = TFLAGS },
{ "duration", "how to determine end of stream", OFFSET(duration), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, .flags = FLAGS, .unit = "duration" },
{ "longest", "Duration of longest input", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, .unit = "duration" },
{ "shortest", "Duration of shortest input", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, .unit = "duration" },
{ "first", "Duration of first input", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, .unit = "duration" },
{ NULL },
}

Definition at line 439 of file vf_mix.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 451 of file vf_mix.c.

TFLAGS
#define TFLAGS
Definition: vf_mix.c:437
FLAGS
#define FLAGS
Definition: vf_mix.c:436
duration
int64_t duration
Definition: movenc.c:65
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_mix.c:318
planes
static const struct @465 planes[]
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition: opt.h:271
OFFSET
#define OFFSET(x)
Definition: vf_mix.c:435
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
scale
static void scale(int *out, const int *in, const int w, const int h, const int shift)
Definition: intra.c:291
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
Definition: opt.h:255
AV_OPT_TYPE_STRING
@ 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:276
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299