FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_cover_rect.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "filters.h"
#include "video.h"
#include "lavfutils.h"

Go to the source code of this file.

Data Structures

struct  CoverContext
 

Macros

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

Enumerations

enum  mode {
  FF_EBUR128_MODE_M = (1 << 0), FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M, FF_EBUR128_MODE_I = (1 << 2) | FF_EBUR128_MODE_M, FF_EBUR128_MODE_LRA = (1 << 3) | FF_EBUR128_MODE_S,
  FF_EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | FF_EBUR128_MODE_M, MODE_NONE, MODE_RO, MODE_RW,
  MODE_TOGGLE, MODE_RANDOM, NB_MODES, MODE_COVER,
  MODE_BLUR, NB_MODES, MODE_HARD, MODE_SOFT,
  MODE_MEDIUM, MODE_HARD, MODE_SOFT, NB_MODES
}
 

Functions

 AVFILTER_DEFINE_CLASS (cover_rect)
 
static int config_input (AVFilterLink *inlink)
 
static void cover_rect (CoverContext *cover, AVFrame *in, int offx, int offy)
 
static void blur (CoverContext *cover, AVFrame *in, int offx, int offy)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 

Variables

static const AVOption cover_rect_options []
 
static const AVFilterPad cover_rect_inputs []
 
const AVFilter ff_vf_cover_rect
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 46 of file vf_cover_rect.c.

◆ FLAGS

Definition at line 47 of file vf_cover_rect.c.

Enumeration Type Documentation

◆ mode

enum mode
Todo:
switch to dualinput
Enumerator
FF_EBUR128_MODE_M 

can resurrrect and call ff_ebur128_loudness_momentary

FF_EBUR128_MODE_S 

can call ff_ebur128_loudness_shortterm

FF_EBUR128_MODE_I 

can call ff_ebur128_loudness_global_* and ff_ebur128_relative_threshold

FF_EBUR128_MODE_LRA 

can call ff_ebur128_loudness_range

FF_EBUR128_MODE_SAMPLE_PEAK 

can call ff_ebur128_sample_peak

MODE_NONE 
MODE_RO 
MODE_RW 
MODE_TOGGLE 
MODE_RANDOM 
NB_MODES 
MODE_COVER 
MODE_BLUR 
NB_MODES 
MODE_HARD 
MODE_SOFT 
MODE_MEDIUM 
MODE_HARD 
MODE_SOFT 
NB_MODES 

Definition at line 32 of file vf_cover_rect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( cover_rect  )

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 58 of file vf_cover_rect.c.

◆ cover_rect()

static void cover_rect ( CoverContext cover,
AVFrame in,
int  offx,
int  offy 
)
static

Definition at line 63 of file vf_cover_rect.c.

Referenced by filter_frame().

◆ blur()

static void blur ( CoverContext cover,
AVFrame in,
int  offx,
int  offy 
)
static

Definition at line 81 of file vf_cover_rect.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 124 of file vf_cover_rect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 188 of file vf_cover_rect.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 197 of file vf_cover_rect.c.

Variable Documentation

◆ cover_rect_options

const AVOption cover_rect_options[]
static
Initial value:
= {
{ "cover", "cover bitmap filename", OFFSET(cover_filename), AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
{ "mode", "set removal mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_BLUR}, 0, NB_MODES - 1, FLAGS, .unit = "mode" },
{ "cover", "cover area with bitmap", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_COVER}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
{ "blur", "blur area", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_BLUR}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" },
{ NULL }
}

Definition at line 48 of file vf_cover_rect.c.

◆ cover_rect_inputs

const AVFilterPad cover_rect_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
}

Definition at line 226 of file vf_cover_rect.c.

◆ ff_vf_cover_rect

const AVFilter ff_vf_cover_rect
Initial value:
= {
.name = "cover_rect",
.description = NULL_IF_CONFIG_SMALL("Find and cover a user specified object."),
.priv_size = sizeof(CoverContext),
.init = init,
.priv_class = &cover_rect_class,
}

Definition at line 235 of file vf_cover_rect.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
mode
Definition: swscale.c:52
OFFSET
#define OFFSET(x)
Definition: vf_cover_rect.c:46
cover_rect_inputs
static const AVFilterPad cover_rect_inputs[]
Definition: vf_cover_rect.c:226
ff_video_default_filterpad
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition: video.c:37
NB_MODES
@ NB_MODES
Definition: vf_cover_rect.c:35
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_YUVJ420P
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:85
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:94
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_cover_rect.c:188
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_cover_rect.c:58
MODE_BLUR
@ MODE_BLUR
Definition: vf_cover_rect.c:34
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: filters.h:248
CoverContext
Definition: vf_cover_rect.c:38
MODE_COVER
@ MODE_COVER
Definition: vf_cover_rect.c:33
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_cover_rect.c:197
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FLAGS
#define FLAGS
Definition: vf_cover_rect.c:47
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
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_cover_rect.c:124
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299