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

Go to the source code of this file.

Data Structures

struct  FieldOrderContext
 

Macros

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

Functions

static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
 AVFILTER_DEFINE_CLASS (fieldorder)
 

Variables

static const AVOption fieldorder_options []
 
static const AVFilterPad avfilter_vf_fieldorder_inputs []
 
static const AVFilterPad avfilter_vf_fieldorder_outputs []
 
const AVFilter ff_vf_fieldorder
 

Detailed Description

video field order filter, heavily influenced by vf_pad.c

Definition in file vf_fieldorder.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 150 of file vf_fieldorder.c.

◆ FLAGS

Definition at line 151 of file vf_fieldorder.c.

Function Documentation

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

accept any input pixel format that is not hardware accelerated, not a bitstream format, and does not have vertically sub-sampled chroma

Definition at line 41 of file vf_fieldorder.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 62 of file vf_fieldorder.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Move every line up one line, working from the top to the bottom of the frame. The original top line is lost. The new last line is created as a copy of the penultimate line from that field.

Move every line down one line, working from the bottom to the top of the frame. The original bottom line is lost. The new first line is created as a copy of the second line from that field.

Definition at line 70 of file vf_fieldorder.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( fieldorder  )

Variable Documentation

◆ fieldorder_options

const AVOption fieldorder_options[]
static
Initial value:
= {
{ "order", "output field order", OFFSET(dst_tff), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "order" },
{ "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, .flags=FLAGS, .unit = "order" },
{ "tff", "top field first", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, .flags=FLAGS, .unit = "order" },
{ NULL }
}

Definition at line 153 of file vf_fieldorder.c.

◆ avfilter_vf_fieldorder_inputs

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

Definition at line 162 of file vf_fieldorder.c.

◆ avfilter_vf_fieldorder_outputs

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

Definition at line 171 of file vf_fieldorder.c.

◆ ff_vf_fieldorder

const AVFilter ff_vf_fieldorder
Initial value:
= {
.name = "fieldorder",
.description = NULL_IF_CONFIG_SMALL("Set the field order."),
.priv_size = sizeof(FieldOrderContext),
.priv_class = &fieldorder_class,
}

Definition at line 178 of file vf_fieldorder.c.

avfilter_vf_fieldorder_outputs
static const AVFilterPad avfilter_vf_fieldorder_outputs[]
Definition: vf_fieldorder.c:171
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_fieldorder.c:70
OFFSET
#define OFFSET(x)
Definition: vf_fieldorder.c:150
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
NULL
#define NULL
Definition: coverity.c:32
FLAGS
#define FLAGS
Definition: vf_fieldorder.c:151
FieldOrderContext
Definition: vf_fieldorder.c:35
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:115
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_fieldorder.c:62
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:152
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
avfilter_vf_fieldorder_inputs
static const AVFilterPad avfilter_vf_fieldorder_inputs[]
Definition: vf_fieldorder.c:162
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_fieldorder.c:41