FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_cover_rect.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "filters.h"
#include "internal.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 47 of file vf_cover_rect.c.

◆ FLAGS

Definition at line 48 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 33 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 59 of file vf_cover_rect.c.

◆ cover_rect()

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

Definition at line 64 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 82 of file vf_cover_rect.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 125 of file vf_cover_rect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 189 of file vf_cover_rect.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 198 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, "mode" },
{ "cover", "cover area with bitmap", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_COVER}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "blur", "blur area", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_BLUR}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ NULL }
}

Definition at line 49 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 227 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 236 of file vf_cover_rect.c.

OFFSET
#define OFFSET(x)
Definition: vf_cover_rect.c:47
cover_rect_inputs
static const AVFilterPad cover_rect_inputs[]
Definition: vf_cover_rect.c:227
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:36
NB_MODES
@ NB_MODES
Definition: vf_cover_rect.c:36
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:66
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:192
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: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:106
FILTER_PIXFMTS
#define FILTER_PIXFMTS(...)
Definition: internal.h:178
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_cover_rect.c:189
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_cover_rect.c:59
MODE_BLUR
@ MODE_BLUR
Definition: vf_cover_rect.c:35
CoverContext
Definition: vf_cover_rect.c:39
MODE_COVER
@ MODE_COVER
Definition: vf_cover_rect.c:34
mode
mode
Definition: ebur128.h:83
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_cover_rect.c:198
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:193
FLAGS
#define FLAGS
Definition: vf_cover_rect.c:48
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_cover_rect.c:125
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234