FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_swaprect.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  SwapRectContext
 

Macros

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

Enumerations

enum  {
  VAR_W, VAR_H, VAR_A, VAR_N,
  VAR_T, VAR_POS, VAR_SAR, VAR_DAR,
  VAR_VARS_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (swaprect)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption swaprect_options []
 
static const char *const var_names [] = { "w", "h", "a", "n", "t", "pos", "sar", "dar", NULL }
 
static const AVFilterPad inputs []
 
static const AVFilterPad outputs []
 
const AVFilter ff_vf_swaprect
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 44 of file vf_swaprect.c.

◆ FLAGS

Definition at line 45 of file vf_swaprect.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VAR_W 
VAR_H 
VAR_A 
VAR_N 
VAR_T 
VAR_POS 
VAR_SAR 
VAR_DAR 
VAR_VARS_NB 

Definition at line 68 of file vf_swaprect.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( swaprect  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 58 of file vf_swaprect.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 70 of file vf_swaprect.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 191 of file vf_swaprect.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 212 of file vf_swaprect.c.

Variable Documentation

◆ swaprect_options

const AVOption swaprect_options[]
static
Initial value:
= {
{ "w", "set rect width", OFFSET(w), AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
{ "h", "set rect height", OFFSET(h), AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
{ "x1", "set 1st rect x top left coordinate", OFFSET(x1), AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
{ "y1", "set 1st rect y top left coordinate", OFFSET(y1), AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
{ "x2", "set 2nd rect x top left coordinate", OFFSET(x2), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags = FLAGS },
{ "y2", "set 2nd rect y top left coordinate", OFFSET(y2), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags = FLAGS },
{ NULL },
}

Definition at line 46 of file vf_swaprect.c.

◆ var_names

const char* const var_names[] = { "w", "h", "a", "n", "t", "pos", "sar", "dar", NULL }
static

Definition at line 67 of file vf_swaprect.c.

Referenced by filter_frame().

◆ inputs

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

Definition at line 218 of file vf_swaprect.c.

◆ outputs

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

Definition at line 228 of file vf_swaprect.c.

◆ ff_vf_swaprect

const AVFilter ff_vf_swaprect
Initial value:
= {
.name = "swaprect",
.description = NULL_IF_CONFIG_SMALL("Swap 2 rectangular objects in video."),
.priv_size = sizeof(SwapRectContext),
.priv_class = &swaprect_class,
.process_command = ff_filter_process_command,
}

Definition at line 235 of file vf_swaprect.c.

FLAGS
#define FLAGS
Definition: vf_swaprect.c:45
outputs
static const AVFilterPad outputs[]
Definition: vf_swaprect.c:228
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_swaprect.c:212
w
uint8_t w
Definition: llviddspenc.c:38
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:171
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_swaprect.c:58
SwapRectContext
Definition: vf_swaprect.c:31
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:194
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:115
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:842
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:142
OFFSET
#define OFFSET(x)
Definition: vf_swaprect.c:44
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:195
inputs
static const AVFilterPad inputs[]
Definition: vf_swaprect.c:218
h
h
Definition: vp9dsp_template.c:2038
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_swaprect.c:70
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_swaprect.c:191
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:68