FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_addroi.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  AddROIContext
 

Macros

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

Enumerations

enum  {
  X, Y, W, H,
  NB_PARAMS
}
 
enum  { VAR_IW, VAR_IH, NB_VARS }
 

Functions

static int addroi_config_input (AVFilterLink *inlink)
 
static int addroi_filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold int addroi_init (AVFilterContext *avctx)
 
static av_cold void addroi_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (addroi)
 

Variables

static const char addroi_param_names []
 
static const char *const addroi_var_names []
 
static const AVOption addroi_options []
 
static const AVFilterPad addroi_inputs []
 
const AVFilter ff_vf_addroi
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 218 of file vf_addroi.c.

◆ FLAGS

Definition at line 219 of file vf_addroi.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NB_PARAMS 

Definition at line 26 of file vf_addroi.c.

◆ anonymous enum

anonymous enum
Enumerator
VAR_IW 
VAR_IH 
NB_VARS 

Definition at line 34 of file vf_addroi.c.

Function Documentation

◆ addroi_config_input()

static int addroi_config_input ( AVFilterLink inlink)
static

Definition at line 56 of file vf_addroi.c.

◆ addroi_filter_frame()

static int addroi_filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 95 of file vf_addroi.c.

◆ addroi_init()

static av_cold int addroi_init ( AVFilterContext avctx)
static

Definition at line 187 of file vf_addroi.c.

◆ addroi_uninit()

static av_cold void addroi_uninit ( AVFilterContext avctx)
static

Definition at line 207 of file vf_addroi.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( addroi  )

Variable Documentation

◆ addroi_param_names

const char addroi_param_names[]
static
Initial value:
= {
'x', 'y', 'w', 'h',
}

Definition at line 30 of file vf_addroi.c.

Referenced by addroi_config_input(), and addroi_init().

◆ addroi_var_names

const char* const addroi_var_names[]
static
Initial value:
= {
"iw",
"ih",
}

Definition at line 39 of file vf_addroi.c.

Referenced by addroi_init().

◆ addroi_options

const AVOption addroi_options[]
static
Initial value:
= {
{ "x", "Region distance from left edge of frame.",
OFFSET(region_str[X]), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "y", "Region distance from top edge of frame.",
OFFSET(region_str[Y]), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "w", "Region width.",
OFFSET(region_str[W]), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "h", "Region height.",
OFFSET(region_str[H]), AV_OPT_TYPE_STRING, { .str = "0" }, .flags = FLAGS },
{ "qoffset", "Quantisation offset to apply in the region.",
OFFSET(qoffset), AV_OPT_TYPE_RATIONAL, { .dbl = -0.1 }, -1, +1, FLAGS },
{ "clear", "Remove any existing regions of interest before adding the new one.",
OFFSET(clear), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
}

Definition at line 220 of file vf_addroi.c.

◆ addroi_inputs

const AVFilterPad addroi_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = addroi_config_input,
.filter_frame = addroi_filter_frame,
},
}

Definition at line 241 of file vf_addroi.c.

◆ ff_vf_addroi

const AVFilter ff_vf_addroi
Initial value:
= {
.name = "addroi",
.description = NULL_IF_CONFIG_SMALL("Add region of interest to frame."),
.init = addroi_init,
.uninit = addroi_uninit,
.priv_size = sizeof(AddROIContext),
.priv_class = &addroi_class,
}

Definition at line 250 of file vf_addroi.c.

FLAGS
#define FLAGS
Definition: vf_addroi.c:219
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:240
OFFSET
#define OFFSET(x)
Definition: vf_addroi.c:218
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
addroi_init
static av_cold int addroi_init(AVFilterContext *avctx)
Definition: vf_addroi.c:187
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
X
@ X
Definition: vf_addroi.c:27
Y
@ Y
Definition: vf_addroi.c:27
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
addroi_config_input
static int addroi_config_input(AVFilterLink *inlink)
Definition: vf_addroi.c:56
W
@ W
Definition: vf_addroi.c:27
H
@ H
Definition: vf_addroi.c:27
addroi_inputs
static const AVFilterPad addroi_inputs[]
Definition: vf_addroi.c:241
addroi_filter_frame
static int addroi_filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_addroi.c:95
AddROIContext
Definition: vf_addroi.c:44
addroi_uninit
static av_cold void addroi_uninit(AVFilterContext *avctx)
Definition: vf_addroi.c:207
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:133
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239