FFmpeg
Loading...
Searching...
No Matches
af_apad.c File Reference

audio pad filter. More...

#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 "filters.h"

Go to the source code of this file.

Data Structures

struct  APadContext
 

Macros

#define OFFSET(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 push_frame (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 

Variables

static const AVOption apad_options []
 
static const AVFilterPad apad_outputs []
 
const FFFilter 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)
Value:
offsetof(APadContext, x)

Definition at line 49 of file af_apad.c.

◆ A

Definition at line 50 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 63 of file af_apad.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * frame )
static

Definition at line 76 of file af_apad.c.

Referenced by activate().

◆ push_frame()

static int push_frame ( AVFilterLink * outlink)
static

Definition at line 91 of file af_apad.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 134 of file af_apad.c.

◆ config_output()

static int config_output ( AVFilterLink * outlink)
static

Definition at line 173 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 = -1 }, -1, INT64_MAX, A },
{ "whole_dur", "set minimum target duration in the audio stream", OFFSET(whole_dur), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, A },
{ NULL }
}
#define A(x)
Definition vpx_arith.h:28
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition opt.h:318
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition opt.h:262
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258

Definition at line 52 of file af_apad.c.

◆ apad_outputs

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

Definition at line 189 of file af_apad.c.

◆ ff_af_apad

const FFFilter ff_af_apad
Initial value:
= {
.p.name = "apad",
.p.description = NULL_IF_CONFIG_SMALL("Pad audio with silence."),
.p.priv_class = &apad_class,
.init = init,
.activate = activate,
.priv_size = sizeof(APadContext),
}
static const AVFilterPad apad_outputs[]
Definition af_apad.c:189
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition audio.c:34
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#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:204
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 197 of file af_apad.c.