FFmpeg
Loading...
Searching...
No Matches
vf_zoompan.c File Reference
#include "libavutil/eval.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"
#include "libswscale/swscale.h"

Go to the source code of this file.

Data Structures

struct  ZPContext
 

Macros

#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_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_IN , VAR_ON , VAR_DURATION , VAR_PDURATION ,
  VAR_IN_TIME , VAR_IT , VAR_TIME , VAR_OUT_TIME ,
  VAR_OT , VAR_FRAME , VAR_ZOOM , VAR_PZOOM ,
  VAR_X , VAR_PX , VAR_Y , VAR_PY ,
  VAR_A , VAR_SAR , VAR_DAR , VAR_HSUB ,
  VAR_VSUB , VARS_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (zoompan)
 
static av_cold int init (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int output_single_frame (AVFilterContext *ctx, AVFrame *in, double *var_values, int i, double *zoom, double *dx, double *dy)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const char *const var_names []
 
static const AVOption zoompan_options []
 
static enum AVPixelFormat pix_fmts []
 
static const AVFilterPad outputs []
 
const FFFilter ff_vf_zoompan
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(ZPContext, x)

Definition at line 101 of file vf_zoompan.c.

◆ FLAGS

Definition at line 102 of file vf_zoompan.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_IN 
VAR_ON 
VAR_DURATION 
VAR_PDURATION 
VAR_IN_TIME 
VAR_IT 
VAR_TIME 
VAR_OUT_TIME 
VAR_OT 
VAR_FRAME 
VAR_ZOOM 
VAR_PZOOM 
VAR_X 
VAR_PX 
VAR_Y 
VAR_PY 
VAR_A 
VAR_SAR 
VAR_DAR 
VAR_HSUB 
VAR_VSUB 
VARS_NB 

Definition at line 53 of file vf_zoompan.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( zoompan )

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 116 of file vf_zoompan.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 124 of file vf_zoompan.c.

◆ output_single_frame()

static int output_single_frame ( AVFilterContext * ctx,
AVFrame * in,
double * var_values,
int i,
double * zoom,
double * dx,
double * dy )
static

Definition at line 153 of file vf_zoompan.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 259 of file vf_zoompan.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 344 of file vf_zoompan.c.

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"in_w", "iw",
"in_h", "ih",
"out_w", "ow",
"out_h", "oh",
"in",
"on",
"duration",
"pduration",
"in_time", "it",
"out_time", "time", "ot",
"frame",
"zoom",
"pzoom",
"x", "px",
"y", "py",
"a",
"sar",
"dar",
"hsub",
"vsub",
}
#define NULL
Definition coverity.c:32

Definition at line 29 of file vf_zoompan.c.

◆ zoompan_options

const AVOption zoompan_options[]
static
Initial value:
= {
{ "zoom", "set the zoom expression", OFFSET(zoom_expr_str), AV_OPT_TYPE_STRING, {.str = "1" }, .flags = FLAGS },
{ "z", "set the zoom expression", OFFSET(zoom_expr_str), AV_OPT_TYPE_STRING, {.str = "1" }, .flags = FLAGS },
{ "x", "set the x expression", OFFSET(x_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },
{ "y", "set the y expression", OFFSET(y_expr_str), AV_OPT_TYPE_STRING, {.str="0"}, .flags = FLAGS },
{ "d", "set the duration expression", OFFSET(duration_expr_str), AV_OPT_TYPE_STRING, {.str="90"}, .flags = FLAGS },
{ "s", "set the output image size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, .flags = FLAGS },
{ "fps", "set the output framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, .flags = FLAGS },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define OFFSET(x)
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition opt.h:302
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ 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
uint8_t w
Definition llvidencdsp.c:39
float framerate
Definition av1_levels.c:29

Definition at line 103 of file vf_zoompan.c.

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static
Initial value:
= {
}
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
Definition pixfmt.h:106
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition pixfmt.h:108
@ AV_PIX_FMT_YUVJ440P
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
Definition pixfmt.h:107
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition pixfmt.h:79
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
Definition pixfmt.h:80
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition pixfmt.h:174
@ AV_PIX_FMT_YUVJ411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor ...
Definition pixfmt.h:283
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition pixfmt.h:173
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85

Definition at line 330 of file vf_zoompan.c.

◆ outputs

const AVFilterPad outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int config_output(AVBitStreamFilterLink *outlink)

Definition at line 356 of file vf_zoompan.c.

◆ ff_vf_zoompan

const FFFilter ff_vf_zoompan
Initial value:
= {
.p.name = "zoompan",
.p.description = NULL_IF_CONFIG_SMALL("Apply Zoom & Pan effect."),
.p.priv_class = &zoompan_class,
.priv_size = sizeof(ZPContext),
.init = init,
}
static const AVFilterPad outputs[]
Definition af_aap.c:310
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS_ARRAY(array)
Definition filters.h:244
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static enum AVPixelFormat pix_fmts[]
Definition libkvazaar.c:296
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37

Definition at line 364 of file vf_zoompan.c.