FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_fieldhint.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/file_open.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  FieldHintContext
 

Macros

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

Enumerations

enum  HintModes { ABSOLUTE_HINT, RELATIVE_HINT, PATTERN_HINT, NB_HINTS }
 

Functions

 AVFILTER_DEFINE_CLASS (fieldhint)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption fieldhint_options []
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_fieldhint
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 55 of file vf_fieldhint.c.

◆ FLAGS

Definition at line 56 of file vf_fieldhint.c.

Enumeration Type Documentation

◆ HintModes

enum HintModes
Enumerator
ABSOLUTE_HINT 
RELATIVE_HINT 
PATTERN_HINT 
NB_HINTS 

Definition at line 32 of file vf_fieldhint.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( fieldhint  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 69 of file vf_fieldhint.c.

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 88 of file vf_fieldhint.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 100 of file vf_fieldhint.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 117 of file vf_fieldhint.c.

Referenced by request_frame().

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 275 of file vf_fieldhint.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 296 of file vf_fieldhint.c.

Variable Documentation

◆ fieldhint_options

const AVOption fieldhint_options[]
static
Initial value:
= {
{ "hint", "set hint file", OFFSET(hint_file_str), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ "mode", "set hint mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_HINTS-1, FLAGS, .unit = "mode" },
{ "absolute", 0, 0, AV_OPT_TYPE_CONST, {.i64=ABSOLUTE_HINT}, 0, 0, FLAGS, .unit = "mode" },
{ "relative", 0, 0, AV_OPT_TYPE_CONST, {.i64=RELATIVE_HINT}, 0, 0, FLAGS, .unit = "mode" },
{ "pattern", 0, 0, AV_OPT_TYPE_CONST, {.i64=PATTERN_HINT}, 0, 0, FLAGS, .unit = "mode" },
{ NULL }
}

Definition at line 58 of file vf_fieldhint.c.

◆ inputs

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

Definition at line 309 of file vf_fieldhint.c.

◆ outputs

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

Definition at line 318 of file vf_fieldhint.c.

◆ ff_vf_fieldhint

const AVFilter ff_vf_fieldhint
Initial value:
= {
.name = "fieldhint",
.description = NULL_IF_CONFIG_SMALL("Field matching using hints."),
.priv_size = sizeof(FieldHintContext),
.priv_class = &fieldhint_class,
.init = init,
}

Definition at line 326 of file vf_fieldhint.c.

FieldHintContext
Definition: vf_fieldhint.c:39
inputs
static const AVFilterPad inputs[]
Definition: vf_fieldhint.c:309
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: vf_fieldhint.c:88
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
mode
Definition: swscale.c:52
FLAGS
#define FLAGS
Definition: vf_fieldhint.c:56
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_fieldhint.c:69
OFFSET
#define OFFSET(x)
Definition: vf_fieldhint.c:55
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_fieldhint.c:275
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
ABSOLUTE_HINT
@ ABSOLUTE_HINT
Definition: vf_fieldhint.c:33
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
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_fieldhint.c:100
PATTERN_HINT
@ PATTERN_HINT
Definition: vf_fieldhint.c:35
NB_HINTS
@ NB_HINTS
Definition: vf_fieldhint.c:36
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
outputs
static const AVFilterPad outputs[]
Definition: vf_fieldhint.c:318
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
RELATIVE_HINT
@ RELATIVE_HINT
Definition: vf_fieldhint.c:34
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_fieldhint.c:117
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_fieldhint.c:296
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
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299