FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_tiltandshift.c File Reference
#include <string.h>
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  TiltandshiftContext
 

Macros

#define OFFSET(x)   offsetof(TiltandshiftContext, x)
 
#define V   AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  PaddingOption { TILT_NONE, TILT_FRAME, TILT_BLACK, TILT_OPT_MAX }
 

Functions

static int list_add_frame (TiltandshiftContext *s, AVFrame *frame)
 
static void list_remove_head (TiltandshiftContext *s)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int config_props (AVFilterLink *outlink)
 
static void copy_column (AVFilterLink *outlink, uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], int ncol, int tilt)
 
static int output_frame (AVFilterLink *outlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 
 AVFILTER_DEFINE_CLASS (tiltandshift)
 

Variables

static enum AVPixelFormat pix_fmts []
 
static const AVOption tiltandshift_options []
 
static const AVFilterPad tiltandshift_inputs []
 
static const AVFilterPad tiltandshift_outputs []
 
const AVFilter ff_vf_tiltandshift
 

Detailed Description

Simple time and space inverter.

Definition in file vf_tiltandshift.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 310 of file vf_tiltandshift.c.

◆ V

#define V   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 311 of file vf_tiltandshift.c.

Enumeration Type Documentation

◆ PaddingOption

Enumerator
TILT_NONE 
TILT_FRAME 
TILT_BLACK 
TILT_OPT_MAX 

Definition at line 39 of file vf_tiltandshift.c.

Function Documentation

◆ list_add_frame()

static int list_add_frame ( TiltandshiftContext s,
AVFrame frame 
)
static

Definition at line 76 of file vf_tiltandshift.c.

Referenced by filter_frame().

◆ list_remove_head()

static void list_remove_head ( TiltandshiftContext s)
static

Definition at line 90 of file vf_tiltandshift.c.

Referenced by output_frame(), and uninit().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 108 of file vf_tiltandshift.c.

◆ config_props()

static int config_props ( AVFilterLink outlink)
static

Definition at line 116 of file vf_tiltandshift.c.

◆ copy_column()

static void copy_column ( AVFilterLink outlink,
uint8_t *  dst_data[4],
int  dst_linesizes[4],
const uint8_t *  src_data[4],
const int  src_linesizes[4],
int  ncol,
int  tilt 
)
static

Definition at line 169 of file vf_tiltandshift.c.

Referenced by output_frame().

◆ output_frame()

static int output_frame ( AVFilterLink outlink)
static

Definition at line 192 of file vf_tiltandshift.c.

Referenced by filter_frame(), and request_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 257 of file vf_tiltandshift.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 278 of file vf_tiltandshift.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( tiltandshift  )

Variable Documentation

◆ pix_fmts

enum AVPixelFormat pix_fmts[]
static

◆ tiltandshift_options

const AVOption tiltandshift_options[]
static
Initial value:
= {
{ "tilt", "Tilt the video horizontally while shifting", OFFSET(tilt), AV_OPT_TYPE_INT,
{ .i64 = 1 }, 0, 1, .flags = V, .unit = "tilt" },
{ "start", "Action at the start of input", OFFSET(start), AV_OPT_TYPE_INT,
{ .i64 = TILT_NONE }, 0, TILT_OPT_MAX, .flags = V, .unit = "start" },
{ "none", "Start immediately (default)", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_NONE }, INT_MIN, INT_MAX, .flags = V, .unit = "start" },
{ "frame", "Use the first frames", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_FRAME }, INT_MIN, INT_MAX, .flags = V, .unit = "start" },
{ "black", "Fill with black", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_BLACK }, INT_MIN, INT_MAX, .flags = V, .unit = "start" },
{ "end", "Action at the end of input", OFFSET(end), AV_OPT_TYPE_INT,
{ .i64 = TILT_NONE }, 0, TILT_OPT_MAX, .flags = V, .unit = "end" },
{ "none", "Do not pad at the end (default)", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_NONE }, INT_MIN, INT_MAX, .flags = V, .unit = "end" },
{ "frame", "Use the last frame", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_FRAME }, INT_MIN, INT_MAX, .flags = V, .unit = "end" },
{ "black", "Fill with black", 0, AV_OPT_TYPE_CONST,
{ .i64 = TILT_BLACK }, INT_MIN, INT_MAX, .flags = V, .unit = "end" },
{ "hold", "Number of columns to hold at the start of the video", OFFSET(hold), AV_OPT_TYPE_INT,
{ .i64 = 0 }, 0, INT_MAX, .flags = V, .unit = "hold" },
{ "pad", "Number of columns to pad at the end of the video", OFFSET(pad), AV_OPT_TYPE_INT,
{ .i64 = 0 }, 0, INT_MAX, .flags = V, .unit = "pad" },
{ NULL },
}

Definition at line 312 of file vf_tiltandshift.c.

◆ tiltandshift_inputs

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

Definition at line 344 of file vf_tiltandshift.c.

◆ tiltandshift_outputs

const AVFilterPad tiltandshift_outputs[]
static
Initial value:
= {
{
.name = "out",
.config_props = config_props,
.request_frame = request_frame,
},
}

Definition at line 352 of file vf_tiltandshift.c.

◆ ff_vf_tiltandshift

const AVFilter ff_vf_tiltandshift
Initial value:
= {
.name = "tiltandshift",
.description = NULL_IF_CONFIG_SMALL("Generate a tilt-and-shift'd video."),
.priv_size = sizeof(TiltandshiftContext),
.priv_class = &tiltandshift_class,
}

Definition at line 361 of file vf_tiltandshift.c.

TILT_NONE
@ TILT_NONE
Definition: vf_tiltandshift.c:40
tiltandshift_inputs
static const AVFilterPad tiltandshift_inputs[]
Definition: vf_tiltandshift.c:344
FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: internal.h:162
TiltandshiftContext
Definition: vf_tiltandshift.c:46
V
#define V
Definition: vf_tiltandshift.c:311
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_tiltandshift.c:108
TILT_BLACK
@ TILT_BLACK
Definition: vf_tiltandshift.c:42
TILT_OPT_MAX
@ TILT_OPT_MAX
Definition: vf_tiltandshift.c:43
OFFSET
#define OFFSET(x)
Definition: vf_tiltandshift.c:310
AV_PIX_FMT_YUVJ422P
@ 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
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_tiltandshift.c:257
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
AV_PIX_FMT_YUVJ444P
@ 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
NULL
#define NULL
Definition: coverity.c:32
AV_PIX_FMT_YUVJ420P
@ 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
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: vf_tiltandshift.c:278
tiltandshift_outputs
static const AVFilterPad tiltandshift_outputs[]
Definition: vf_tiltandshift.c:352
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: vf_tiltandshift.c:100
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
static int config_props(AVFilterLink *outlink)
Definition: vf_tiltandshift.c:116
AV_PIX_FMT_YUVJ440P
@ 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
TILT_FRAME
@ TILT_FRAME
Definition: vf_tiltandshift.c:41
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:79
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244