29 #include "libavutil/avstring.h"
30 #include "libavutil/channel_layout.h"
31 #include "libavutil/opt.h"
32 #include "libavutil/samplefmt.h"
33 #include "libavutil/avassert.h"
47 #define OFFSET(x) offsetof(APadContext, x)
48 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
51 {
"packet_size",
"set silence packet size",
OFFSET(packet_size),
AV_OPT_TYPE_INT, { .i64 = 4096 }, 0, INT_MAX,
A },
52 {
"pad_len",
"number of samples of silence to add",
OFFSET(pad_len),
AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX,
A },
53 {
"whole_len",
"target number of samples in the audio stream",
OFFSET(whole_len),
AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX,
A },
65 av_log(ctx,
AV_LOG_ERROR,
"Both whole and pad length are set, this is not possible\n");
154 .priv_class = &apad_class,
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
static const AVFilterPad apad_inputs[]
uint8_t ** extended_data
pointers to the data planes/channels.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
int is_disabled
the enabled state from the last expression evaluation
const char * name
Pad name.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static const AVFilterPad apad_outputs[]
A filter pad used for either input or output.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int sample_rate
samples per second
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
AVFilterContext * src
source filter
int av_frame_get_channels(const AVFrame *frame)
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static int request_frame(AVFilterLink *outlink)
AVFilter avfilter_af_apad
Main libavfilter public API header.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
static av_cold int init(AVFilterContext *ctx)
Describe the class of an AVClass context structure.
int sample_rate
Sample rate of the audio data.
static const AVFilterPad inputs[]
AVFilterLink ** inputs
array of pointers to input links
rational number numerator/denominator
AVFilterContext * dst
dest filter
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt)
Fill an audio buffer with silence.
static const AVOption apad_options[]
#define AVFILTER_DEFINE_CLASS(fname)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_NOPTS_VALUE
Undefined timestamp value.