FFmpeg
Loading...
Searching...
No Matches
vf_pad_vaapi.c File Reference
#include "libavutil/colorspace.h"
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "filters.h"
#include "vaapi_vpp.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  PadVAAPIContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  var_name {
  VAR_IN_W , VAR_IW , VAR_IN_H , VAR_IH ,
  VAR_OUT_W , VAR_OW , VAR_OUT_H , VAR_OH ,
  VAR_X , VAR_Y , VAR_A , VAR_SAR ,
  VAR_DAR , VARS_NB
}
 

Functions

static int pad_vaapi_config_output (AVFilterLink *outlink)
 
static int pad_vaapi_filter_frame (AVFilterLink *link, AVFrame *input_frame)
 
static av_cold int pad_vaapi_init (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (pad_vaapi)
 

Variables

static const char *const var_names []
 
static const AVOption pad_vaapi_options []
 
static const AVFilterPad pad_vaapi_inputs []
 
static const AVFilterPad pad_vaapi_outputs []
 
const FFFilter ff_vf_pad_vaapi
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 238 of file vf_pad_vaapi.c.

◆ FLAGS

Definition at line 239 of file vf_pad_vaapi.c.

Enumeration Type Documentation

◆ var_name

enum var_name
Enumerator
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
VAR_OH 
VAR_X 
VAR_Y 
VAR_A 
VAR_SAR 
VAR_DAR 
VARS_NB 

Definition at line 41 of file vf_pad_vaapi.c.

Function Documentation

◆ pad_vaapi_config_output()

static int pad_vaapi_config_output ( AVFilterLink * outlink)
static

Definition at line 69 of file vf_pad_vaapi.c.

◆ pad_vaapi_filter_frame()

static int pad_vaapi_filter_frame ( AVFilterLink * link,
AVFrame * input_frame )
static

Definition at line 171 of file vf_pad_vaapi.c.

◆ pad_vaapi_init()

static av_cold int pad_vaapi_init ( AVFilterContext * avctx)
static

Definition at line 227 of file vf_pad_vaapi.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( pad_vaapi )

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"in_w", "iw",
"in_h", "ih",
"out_w", "ow",
"out_h", "oh",
"x",
"y",
"a",
"sar",
"dar",
}
#define NULL
Definition coverity.c:32

Definition at line 28 of file vf_pad_vaapi.c.

◆ pad_vaapi_options

const AVOption pad_vaapi_options[]
static
Initial value:
= {
{ "width", "set the pad area width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, FLAGS },
{ "w", "set the pad area width", OFFSET(w_expr), AV_OPT_TYPE_STRING, {.str = "iw"}, 0, 0, FLAGS },
{ "height", "set the pad area height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, 0, 0, FLAGS },
{ "h", "set the pad area height", OFFSET(h_expr), AV_OPT_TYPE_STRING, {.str = "ih"}, 0, 0, FLAGS },
{ "x", "set the x offset for the input image position", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, INT16_MAX, FLAGS },
{ "y", "set the y offset for the input image position", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, INT16_MAX, FLAGS },
{ "color", "set the color of the padded area border", OFFSET(pad_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS },
{ "aspect", "pad to fit an aspect instead of a resolution", OFFSET(aspect), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT16_MAX, FLAGS },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define OFFSET(x)
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
Definition opt.h:279
@ 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:275
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322

Definition at line 241 of file vf_pad_vaapi.c.

◆ pad_vaapi_inputs

const AVFilterPad pad_vaapi_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = pad_vaapi_filter_frame,
.config_props = &ff_vaapi_vpp_config_input,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Definition vaapi_vpp.c:71
static int pad_vaapi_filter_frame(AVFilterLink *link, AVFrame *input_frame)

Definition at line 255 of file vf_pad_vaapi.c.

◆ pad_vaapi_outputs

const AVFilterPad pad_vaapi_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &pad_vaapi_config_output,
},
}
static int pad_vaapi_config_output(AVFilterLink *outlink)

Definition at line 264 of file vf_pad_vaapi.c.

◆ ff_vf_pad_vaapi

const FFFilter ff_vf_pad_vaapi
Initial value:
= {
.p.name = "pad_vaapi",
.p.description = NULL_IF_CONFIG_SMALL("Pad the input video."),
.p.priv_class = &pad_vaapi_class,
.priv_size = sizeof(PadVAAPIContext),
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition filters.h:208
#define FILTER_QUERY_FUNC2(func)
Definition filters.h:241
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition vaapi_vpp.c:29
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
Definition vaapi_vpp.c:728
static av_cold int pad_vaapi_init(AVFilterContext *avctx)
static const AVFilterPad pad_vaapi_inputs[]
static const AVFilterPad pad_vaapi_outputs[]

Definition at line 272 of file vf_pad_vaapi.c.