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 []
 
AVFilter ff_vf_addroi
 

Macro Definition Documentation

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

Definition at line 217 of file vf_addroi.c.

Definition at line 218 of file vf_addroi.c.

Enumeration Type Documentation

anonymous enum
Enumerator
NB_PARAMS 

Definition at line 25 of file vf_addroi.c.

anonymous enum
Enumerator
VAR_IW 
VAR_IH 
NB_VARS 

Definition at line 33 of file vf_addroi.c.

Function Documentation

static int addroi_config_input ( AVFilterLink inlink)
static

Definition at line 55 of file vf_addroi.c.

static int addroi_filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 94 of file vf_addroi.c.

static av_cold int addroi_init ( AVFilterContext avctx)
static

Definition at line 186 of file vf_addroi.c.

static av_cold void addroi_uninit ( AVFilterContext avctx)
static

Definition at line 206 of file vf_addroi.c.

AVFILTER_DEFINE_CLASS ( addroi  )

Variable Documentation

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().

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

Definition at line 38 of file vf_addroi.c.

Referenced by addroi_init().

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 }
}
#define NULL
Definition: coverity.c:32
Definition: vf_addroi.c:26
Definition: vf_addroi.c:26
Definition: vf_addroi.c:26
#define OFFSET(x)
Definition: vf_addroi.c:217
#define FLAGS
Definition: vf_addroi.c:218
Definition: vf_addroi.c:26

Definition at line 219 of file vf_addroi.c.

const AVFilterPad addroi_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = addroi_config_input,
.filter_frame = addroi_filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int addroi_filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_addroi.c:94
static int addroi_config_input(AVFilterLink *inlink)
Definition: vf_addroi.c:55

Definition at line 240 of file vf_addroi.c.

const AVFilterPad addroi_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
#define NULL
Definition: coverity.c:32

Definition at line 250 of file vf_addroi.c.

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,
}
static av_cold void addroi_uninit(AVFilterContext *avctx)
Definition: vf_addroi.c:206
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static const AVFilterPad addroi_outputs[]
Definition: vf_addroi.c:250
static av_cold int addroi_init(AVFilterContext *avctx)
Definition: vf_addroi.c:186
static const AVFilterPad addroi_inputs[]
Definition: vf_addroi.c:240

Definition at line 258 of file vf_addroi.c.