FFmpeg
Loading...
Searching...
No Matches
vf_tpad.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"
#include "drawutils.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  TPadContext
 

Macros

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

Enumerations

enum  PadMode { MODE_ADD = 0 , MODE_CLONE , NB_MODE }
 

Functions

 AVFILTER_DEFINE_CLASS (tpad)
 
static int needs_drawing (const TPadContext *s)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static int activate (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption tpad_options []
 
static const AVFilterPad tpad_inputs []
 
const FFFilter ff_vf_tpad
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 54 of file vf_tpad.c.

◆ VF

Definition at line 55 of file vf_tpad.c.

Enumeration Type Documentation

◆ PadMode

enum PadMode
Enumerator
MODE_ADD 
MODE_CLONE 
NB_MODE 

Definition at line 30 of file vf_tpad.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( tpad )

◆ needs_drawing()

static int needs_drawing ( const TPadContext * s)
static

Definition at line 72 of file vf_tpad.c.

Referenced by config_input(), and query_formats().

◆ query_formats()

static int query_formats ( const AVFilterContext * ctx,
AVFilterFormatsConfig ** cfg_in,
AVFilterFormatsConfig ** cfg_out )
static

Definition at line 79 of file vf_tpad.c.

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 92 of file vf_tpad.c.

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 204 of file vf_tpad.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 228 of file vf_tpad.c.

Variable Documentation

◆ tpad_options

const AVOption tpad_options[]
static
Initial value:
= {
{ "start", "set the number of frames to delay input", OFFSET(pad_start), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, VF },
{ "stop", "set the number of frames to add after input finished", OFFSET(pad_stop), AV_OPT_TYPE_INT, {.i64=0}, -1, INT_MAX, VF },
{ "start_mode", "set the mode of added frames to start", OFFSET(start_mode), AV_OPT_TYPE_INT, {.i64=MODE_ADD}, 0, NB_MODE-1, VF, .unit = "mode" },
{ "add", "add solid-color frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_ADD}, 0, 0, VF, .unit = "mode" },
{ "clone", "clone first/last frame", 0, AV_OPT_TYPE_CONST, {.i64=MODE_CLONE}, 0, 0, VF, .unit = "mode" },
{ "stop_mode", "set the mode of added frames to end", OFFSET(stop_mode), AV_OPT_TYPE_INT, {.i64=MODE_ADD}, 0, NB_MODE-1, VF, .unit = "mode" },
{ "start_duration", "set the duration to delay input", OFFSET(start_duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, VF },
{ "stop_duration", "set the duration to pad input", OFFSET(stop_duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, VF },
{ "color", "set the color of the added frames", OFFSET(rgba_color), AV_OPT_TYPE_COLOR, {.str="black"}, 0, 0, VF },
{ NULL }
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition opt.h:318
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition opt.h:322
#define VF
Definition af_afir.c:733
@ NB_MODE
@ MODE_ADD
Definition vf_tpad.c:31
@ MODE_CLONE
Definition vf_tpad.c:32

Definition at line 57 of file vf_tpad.c.

◆ tpad_inputs

const AVFilterPad tpad_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 235 of file vf_tpad.c.

◆ ff_vf_tpad

const FFFilter ff_vf_tpad
Initial value:
= {
.p.name = "tpad",
.p.description = NULL_IF_CONFIG_SMALL("Temporarily pad video frames."),
.p.priv_class = &tpad_class,
.priv_size = sizeof(TPadContext),
}
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
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_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
static const AVFilterPad tpad_inputs[]
Definition vf_tpad.c:235
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 243 of file vf_tpad.c.