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"

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 []
 
static const AVFilterPad addroi_outputs []
 
const AVFilter ff_vf_addroi
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 217 of file vf_addroi.c.

◆ FLAGS

Definition at line 218 of file vf_addroi.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NB_PARAMS 

Definition at line 25 of file vf_addroi.c.

◆ anonymous enum

anonymous enum
Enumerator
VAR_IW 
VAR_IH 
NB_VARS 

Definition at line 33 of file vf_addroi.c.

Function Documentation

◆ addroi_config_input()

static int addroi_config_input ( AVFilterLink inlink)
static

Definition at line 55 of file vf_addroi.c.

◆ addroi_filter_frame()

static int addroi_filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 94 of file vf_addroi.c.

◆ addroi_init()

static av_cold int addroi_init ( AVFilterContext avctx)
static

Definition at line 186 of file vf_addroi.c.

◆ addroi_uninit()

static av_cold void addroi_uninit ( AVFilterContext avctx)
static

Definition at line 206 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 29 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 38 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 219 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,
},
{ NULL }
}

Definition at line 240 of file vf_addroi.c.

◆ addroi_outputs

const AVFilterPad addroi_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}

Definition at line 250 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 258 of file vf_addroi.c.

FLAGS
#define FLAGS
Definition: vf_addroi.c:218
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:229
addroi_outputs
static const AVFilterPad addroi_outputs[]
Definition: vf_addroi.c:250
OFFSET
#define OFFSET(x)
Definition: vf_addroi.c:217
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
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
addroi_init
static av_cold int addroi_init(AVFilterContext *avctx)
Definition: vf_addroi.c:186
NULL
#define NULL
Definition: coverity.c:32
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:116
W
@ W
Definition: vf_addroi.c:26
X
@ X
Definition: vf_addroi.c:26
addroi_config_input
static int addroi_config_input(AVFilterLink *inlink)
Definition: vf_addroi.c:55
addroi_inputs
static const AVFilterPad addroi_inputs[]
Definition: vf_addroi.c:240
addroi_filter_frame
static int addroi_filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_addroi.c:94
H
@ H
Definition: vf_addroi.c:26
AddROIContext
Definition: vf_addroi.c:43
addroi_uninit
static av_cold void addroi_uninit(AVFilterContext *avctx)
Definition: vf_addroi.c:206
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
Y
@ Y
Definition: vf_addroi.c:26
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228