FFmpeg
Data Structures | Macros | Functions | Variables
af_apad.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "libavutil/avassert.h"
#include "avfilter.h"
#include "audio.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  APadContext
 

Macros

#define OFFSET(x)   offsetof(APadContext, x)
 
#define A   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (apad)
 
static av_cold int init (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static int request_frame (AVFilterLink *outlink)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption apad_options []
 
static const AVFilterPad apad_inputs []
 
static const AVFilterPad apad_outputs []
 
const AVFilter ff_af_apad
 

Detailed Description

audio pad filter.

Based on af_aresample.c

Definition in file af_apad.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 48 of file af_apad.c.

◆ A

Definition at line 49 of file af_apad.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( apad  )

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 62 of file af_apad.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 75 of file af_apad.c.

◆ request_frame()

static int request_frame ( AVFilterLink outlink)
static

Definition at line 90 of file af_apad.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 136 of file af_apad.c.

Variable Documentation

◆ apad_options

const AVOption apad_options[]
static
Initial value:
= {
{ "packet_size", "set silence packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, { .i64 = 4096 }, 0, INT_MAX, A },
{ "pad_len", "set number of samples of silence to add", OFFSET(pad_len), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, A },
{ "whole_len", "set minimum target number of samples in the audio stream", OFFSET(whole_len), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, A },
{ "pad_dur", "set duration of silence to add", OFFSET(pad_dur), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT64_MAX, A },
{ "whole_dur", "set minimum target duration in the audio stream", OFFSET(whole_dur), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT64_MAX, A },
{ NULL }
}

Definition at line 51 of file af_apad.c.

◆ apad_inputs

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

Definition at line 152 of file af_apad.c.

◆ apad_outputs

const AVFilterPad apad_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
}

Definition at line 161 of file af_apad.c.

◆ ff_af_apad

const AVFilter ff_af_apad
Initial value:
= {
.name = "apad",
.description = NULL_IF_CONFIG_SMALL("Pad audio with silence."),
.init = init,
.priv_size = sizeof(APadContext),
.priv_class = &apad_class,
}

Definition at line 171 of file af_apad.c.

config_output
static int config_output(AVFilterLink *outlink)
Definition: af_apad.c:136
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
OFFSET
#define OFFSET(x)
Definition: af_apad.c:48
init
static av_cold int init(AVFilterContext *ctx)
Definition: af_apad.c:62
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:226
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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:117
APadContext
Definition: af_apad.c:37
apad_inputs
static const AVFilterPad apad_inputs[]
Definition: af_apad.c:152
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_apad.c:90
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
apad_outputs
static const AVFilterPad apad_outputs[]
Definition: af_apad.c:161
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: af_apad.c:75
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
A
#define A
Definition: af_apad.c:49