FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_field.c File Reference
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  FieldContext
 

Macros

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

Enumerations

enum  FieldType { FIELD_TYPE_TOP = 0, FIELD_TYPE_BOTTOM }
 

Functions

 AVFILTER_DEFINE_CLASS (field)
 
static int config_props_output (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *inpicref)
 

Variables

static const AVOption field_options []
 
static const AVFilterPad field_inputs []
 
static const AVFilterPad field_outputs []
 
const AVFilter ff_vf_field
 

Detailed Description

field filter, based on libmpcodecs/vf_field.c by Rich Felker

Definition in file vf_field.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 40 of file vf_field.c.

◆ FLAGS

Definition at line 41 of file vf_field.c.

Enumeration Type Documentation

◆ FieldType

enum FieldType
Enumerator
FIELD_TYPE_TOP 
FIELD_TYPE_BOTTOM 

Definition at line 32 of file vf_field.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( field  )

◆ config_props_output()

static int config_props_output ( AVFilterLink outlink)
static

Definition at line 52 of file vf_field.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame inpicref 
)
static

Definition at line 69 of file vf_field.c.

Variable Documentation

◆ field_options

const AVOption field_options[]
static
Initial value:
= {
{"type", "set field type (top or bottom)", OFFSET(type), AV_OPT_TYPE_INT, {.i64=FIELD_TYPE_TOP}, 0, 1, FLAGS, .unit = "field_type" },
{"top", "select top field", 0, AV_OPT_TYPE_CONST, {.i64=FIELD_TYPE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "field_type"},
{"bottom", "select bottom field", 0, AV_OPT_TYPE_CONST, {.i64=FIELD_TYPE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "field_type"},
{NULL}
}

Definition at line 43 of file vf_field.c.

◆ field_inputs

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

Definition at line 91 of file vf_field.c.

◆ field_outputs

const AVFilterPad field_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_props_output,
},
}

Definition at line 99 of file vf_field.c.

◆ ff_vf_field

const AVFilter ff_vf_field
Initial value:
= {
.name = "field",
.description = NULL_IF_CONFIG_SMALL("Extract a field from the input video."),
.priv_size = sizeof(FieldContext),
.priv_class = &field_class,
}

Definition at line 107 of file vf_field.c.

FLAGS
#define FLAGS
Definition: vf_field.c:41
field_inputs
static const AVFilterPad field_inputs[]
Definition: vf_field.c:91
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
Definition: vf_field.c:69
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
OFFSET
#define OFFSET(x)
Definition: vf_field.c:40
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
FieldContext
Definition: vf_field.c:34
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
config_props_output
static int config_props_output(AVFilterLink *outlink)
Definition: vf_field.c:52
field_outputs
static const AVFilterPad field_outputs[]
Definition: vf_field.c:99
FIELD_TYPE_TOP
@ FIELD_TYPE_TOP
Definition: vf_field.c:32
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
FIELD_TYPE_BOTTOM
@ FIELD_TYPE_BOTTOM
Definition: vf_field.c:32
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244