46 #define OFFSET(x) offsetof(APadContext, x)
47 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
50 {
"packet_size",
"set silence packet size",
OFFSET(packet_size),
AV_OPT_TYPE_INT, { .i64 = 4096 }, 0, INT_MAX,
A },
51 {
"pad_len",
"set number of samples of silence to add",
OFFSET(pad_len),
AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX,
A },
52 {
"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 },
64 av_log(ctx,
AV_LOG_ERROR,
"Both whole and pad length are set, this is not possible\n");
107 "padding n_out:%d pad_len_left:%"PRId64
"\n", n_out, apad->
pad_len_left);
159 .priv_class = &apad_class,
This structure describes decoded (raw) audio or video data.
static const AVFilterPad outputs[]
Main libavfilter public API header.
static const AVFilterPad apad_inputs[]
int is_disabled
the enabled state from the last expression evaluation
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
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).
#define AVERROR_EOF
End of file.
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)
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 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.
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. ...
void * priv
private data for use by the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
simple assert() macros that are a bit more flexible than ISO C assert().
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
audio channel layout utility functions
AVFilterContext * src
source filter
static int request_frame(AVFilterLink *outlink)
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.
int av_frame_get_channels(const AVFrame *frame)
static const AVFilterPad inputs[]
rational number numerator/denominator
const char * name
Filter name.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
static const AVOption apad_options[]
AVFilterContext * dst
dest filter
AVFILTER_DEFINE_CLASS(apad)
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
uint8_t ** extended_data
pointers to the data planes/channels.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_NOPTS_VALUE
Undefined timestamp value.