FFmpeg
af_aresample.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Stefano Sabatini
3  * Copyright (c) 2011 Mina Nagy Zaki
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * resampling audio filter
25  */
26 
27 #include "libavutil/avstring.h"
29 #include "libavutil/opt.h"
30 #include "libavutil/samplefmt.h"
31 #include "libavutil/avassert.h"
33 #include "avfilter.h"
34 #include "audio.h"
35 #include "internal.h"
36 
37 typedef struct AResampleContext {
38  const AVClass *class;
40  double ratio;
41  struct SwrContext *swr;
42  int64_t next_pts;
43  int more_data;
45 
47 {
48  AResampleContext *aresample = ctx->priv;
49 
50  aresample->next_pts = AV_NOPTS_VALUE;
51  aresample->swr = swr_alloc();
52  if (!aresample->swr)
53  return AVERROR(ENOMEM);
54 
55  return 0;
56 }
57 
59 {
60  AResampleContext *aresample = ctx->priv;
61  swr_free(&aresample->swr);
62 }
63 
65 {
66  AResampleContext *aresample = ctx->priv;
67  enum AVSampleFormat out_format;
68  int64_t out_rate, out_layout;
69 
70  AVFilterLink *inlink = ctx->inputs[0];
71  AVFilterLink *outlink = ctx->outputs[0];
72 
73  AVFilterFormats *in_formats, *out_formats;
74  AVFilterFormats *in_samplerates, *out_samplerates;
75  AVFilterChannelLayouts *in_layouts, *out_layouts;
76  int ret;
77 
78  if (aresample->sample_rate_arg > 0)
79  av_opt_set_int(aresample->swr, "osr", aresample->sample_rate_arg, 0);
80  av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
81  av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
82  av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
83 
84  in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
85  if ((ret = ff_formats_ref(in_formats, &inlink->outcfg.formats)) < 0)
86  return ret;
87 
88  in_samplerates = ff_all_samplerates();
89  if ((ret = ff_formats_ref(in_samplerates, &inlink->outcfg.samplerates)) < 0)
90  return ret;
91 
92  in_layouts = ff_all_channel_counts();
93  if ((ret = ff_channel_layouts_ref(in_layouts, &inlink->outcfg.channel_layouts)) < 0)
94  return ret;
95 
96  if(out_rate > 0) {
97  int ratelist[] = { out_rate, -1 };
98  out_samplerates = ff_make_format_list(ratelist);
99  } else {
100  out_samplerates = ff_all_samplerates();
101  }
102 
103  if ((ret = ff_formats_ref(out_samplerates, &outlink->incfg.samplerates)) < 0)
104  return ret;
105 
106  if(out_format != AV_SAMPLE_FMT_NONE) {
107  int formatlist[] = { out_format, -1 };
108  out_formats = ff_make_format_list(formatlist);
109  } else
110  out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO);
111  if ((ret = ff_formats_ref(out_formats, &outlink->incfg.formats)) < 0)
112  return ret;
113 
114  if(out_layout) {
115  int64_t layout_list[] = { out_layout, -1 };
116  out_layouts = ff_make_format64_list(layout_list);
117  } else
118  out_layouts = ff_all_channel_counts();
119 
120  return ff_channel_layouts_ref(out_layouts, &outlink->incfg.channel_layouts);
121 }
122 
123 
124 static int config_output(AVFilterLink *outlink)
125 {
126  int ret;
127  AVFilterContext *ctx = outlink->src;
128  AVFilterLink *inlink = ctx->inputs[0];
129  AResampleContext *aresample = ctx->priv;
130  int64_t out_rate, out_layout;
131  enum AVSampleFormat out_format;
132  char inchl_buf[128], outchl_buf[128];
133 
134  aresample->swr = swr_alloc_set_opts(aresample->swr,
135  outlink->channel_layout, outlink->format, outlink->sample_rate,
136  inlink->channel_layout, inlink->format, inlink->sample_rate,
137  0, ctx);
138  if (!aresample->swr)
139  return AVERROR(ENOMEM);
140  if (!inlink->channel_layout)
141  av_opt_set_int(aresample->swr, "ich", inlink->channels, 0);
142  if (!outlink->channel_layout)
143  av_opt_set_int(aresample->swr, "och", outlink->channels, 0);
144 
145  ret = swr_init(aresample->swr);
146  if (ret < 0)
147  return ret;
148 
149  av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
150  av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
151  av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
152  outlink->time_base = (AVRational) {1, out_rate};
153 
154  av_assert0(outlink->sample_rate == out_rate);
155  av_assert0(outlink->channel_layout == out_layout || !outlink->channel_layout);
156  av_assert0(outlink->format == out_format);
157 
158  aresample->ratio = (double)outlink->sample_rate / inlink->sample_rate;
159 
160  av_get_channel_layout_string(inchl_buf, sizeof(inchl_buf), inlink ->channels, inlink ->channel_layout);
161  av_get_channel_layout_string(outchl_buf, sizeof(outchl_buf), outlink->channels, outlink->channel_layout);
162 
163  av_log(ctx, AV_LOG_VERBOSE, "ch:%d chl:%s fmt:%s r:%dHz -> ch:%d chl:%s fmt:%s r:%dHz\n",
164  inlink ->channels, inchl_buf, av_get_sample_fmt_name(inlink->format), inlink->sample_rate,
165  outlink->channels, outchl_buf, av_get_sample_fmt_name(outlink->format), outlink->sample_rate);
166  return 0;
167 }
168 
169 static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
170 {
171  AResampleContext *aresample = inlink->dst->priv;
172  const int n_in = insamplesref->nb_samples;
173  int64_t delay;
174  int n_out = n_in * aresample->ratio + 32;
175  AVFilterLink *const outlink = inlink->dst->outputs[0];
176  AVFrame *outsamplesref;
177  int ret;
178 
179  delay = swr_get_delay(aresample->swr, outlink->sample_rate);
180  if (delay > 0)
181  n_out += FFMIN(delay, FFMAX(4096, n_out));
182 
183  outsamplesref = ff_get_audio_buffer(outlink, n_out);
184 
185  if(!outsamplesref) {
186  av_frame_free(&insamplesref);
187  return AVERROR(ENOMEM);
188  }
189 
190  av_frame_copy_props(outsamplesref, insamplesref);
191  outsamplesref->format = outlink->format;
192  outsamplesref->channels = outlink->channels;
193  outsamplesref->channel_layout = outlink->channel_layout;
194  outsamplesref->sample_rate = outlink->sample_rate;
195 
196  if(insamplesref->pts != AV_NOPTS_VALUE) {
197  int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den);
198  int64_t outpts= swr_next_pts(aresample->swr, inpts);
199  aresample->next_pts =
200  outsamplesref->pts = ROUNDED_DIV(outpts, inlink->sample_rate);
201  } else {
202  outsamplesref->pts = AV_NOPTS_VALUE;
203  }
204  n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
205  (void *)insamplesref->extended_data, n_in);
206  if (n_out <= 0) {
207  av_frame_free(&outsamplesref);
208  av_frame_free(&insamplesref);
209  return 0;
210  }
211 
212  aresample->more_data = outsamplesref->nb_samples == n_out; // Indicate that there is probably more data in our buffers
213 
214  outsamplesref->nb_samples = n_out;
215 
216  ret = ff_filter_frame(outlink, outsamplesref);
217  av_frame_free(&insamplesref);
218  return ret;
219 }
220 
221 static int flush_frame(AVFilterLink *outlink, int final, AVFrame **outsamplesref_ret)
222 {
223  AVFilterContext *ctx = outlink->src;
224  AResampleContext *aresample = ctx->priv;
225  AVFilterLink *const inlink = outlink->src->inputs[0];
226  AVFrame *outsamplesref;
227  int n_out = 4096;
228  int64_t pts;
229 
230  outsamplesref = ff_get_audio_buffer(outlink, n_out);
231  *outsamplesref_ret = outsamplesref;
232  if (!outsamplesref)
233  return AVERROR(ENOMEM);
234 
235  pts = swr_next_pts(aresample->swr, INT64_MIN);
236  pts = ROUNDED_DIV(pts, inlink->sample_rate);
237 
238  n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out, final ? NULL : (void*)outsamplesref->extended_data, 0);
239  if (n_out <= 0) {
240  av_frame_free(&outsamplesref);
241  return (n_out == 0) ? AVERROR_EOF : n_out;
242  }
243 
244  outsamplesref->sample_rate = outlink->sample_rate;
245  outsamplesref->nb_samples = n_out;
246 
247  outsamplesref->pts = pts;
248 
249  return 0;
250 }
251 
252 static int request_frame(AVFilterLink *outlink)
253 {
254  AVFilterContext *ctx = outlink->src;
255  AResampleContext *aresample = ctx->priv;
256  int ret;
257 
258  // First try to get data from the internal buffers
259  if (aresample->more_data) {
260  AVFrame *outsamplesref;
261 
262  if (flush_frame(outlink, 0, &outsamplesref) >= 0) {
263  return ff_filter_frame(outlink, outsamplesref);
264  }
265  }
266  aresample->more_data = 0;
267 
268  // Second request more data from the input
269  ret = ff_request_frame(ctx->inputs[0]);
270 
271  // Third if we hit the end flush
272  if (ret == AVERROR_EOF) {
273  AVFrame *outsamplesref;
274 
275  if ((ret = flush_frame(outlink, 1, &outsamplesref)) < 0)
276  return ret;
277 
278  return ff_filter_frame(outlink, outsamplesref);
279  }
280  return ret;
281 }
282 
283 static const AVClass *resample_child_class_iterate(void **iter)
284 {
285  const AVClass *c = *iter ? NULL : swr_get_class();
286  *iter = (void*)(uintptr_t)c;
287  return c;
288 }
289 
290 static void *resample_child_next(void *obj, void *prev)
291 {
292  AResampleContext *s = obj;
293  return prev ? NULL : s->swr;
294 }
295 
296 #define OFFSET(x) offsetof(AResampleContext, x)
297 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
298 
299 static const AVOption options[] = {
300  {"sample_rate", NULL, OFFSET(sample_rate_arg), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS },
301  {NULL}
302 };
303 
304 static const AVClass aresample_class = {
305  .class_name = "aresample",
306  .item_name = av_default_item_name,
307  .option = options,
308  .version = LIBAVUTIL_VERSION_INT,
309  .child_class_iterate = resample_child_class_iterate,
311 };
312 
313 static const AVFilterPad aresample_inputs[] = {
314  {
315  .name = "default",
316  .type = AVMEDIA_TYPE_AUDIO,
317  .filter_frame = filter_frame,
318  },
319 };
320 
321 static const AVFilterPad aresample_outputs[] = {
322  {
323  .name = "default",
324  .config_props = config_output,
325  .request_frame = request_frame,
326  .type = AVMEDIA_TYPE_AUDIO,
327  },
328 };
329 
331  .name = "aresample",
332  .description = NULL_IF_CONFIG_SMALL("Resample audio data."),
333  .preinit = preinit,
334  .uninit = uninit,
335  .query_formats = query_formats,
336  .priv_size = sizeof(AResampleContext),
337  .priv_class = &aresample_class,
340 };
ff_get_audio_buffer
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition: audio.c:88
AVFilterChannelLayouts
A list of supported channel layouts.
Definition: formats.h:85
AVFilterFormatsConfig::samplerates
AVFilterFormats * samplerates
Lists of supported sample rates, only for audio.
Definition: avfilter.h:455
SwrContext::outpts
int64_t outpts
output PTS
Definition: swresample_internal.h:160
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
ff_make_format_list
AVFilterFormats * ff_make_format_list(const int *fmts)
Create a list of supported formats.
Definition: formats.c:380
AVFilterFormatsConfig::channel_layouts
AVFilterChannelLayouts * channel_layouts
Lists of supported channel layouts, only for audio.
Definition: avfilter.h:460
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1019
ff_channel_layouts_ref
int ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
Add *ref as a new reference to f.
Definition: formats.c:548
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
FLAGS
#define FLAGS
Definition: af_aresample.c:297
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:112
ff_all_channel_counts
AVFilterChannelLayouts * ff_all_channel_counts(void)
Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.
Definition: formats.c:523
av_get_channel_layout_string
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout)
Return a description of a channel layout.
Definition: channel_layout.c:217
ff_make_format64_list
AVFilterChannelLayouts * ff_make_format64_list(const int64_t *fmts)
Definition: formats.c:389
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:303
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:396
AVOption
AVOption.
Definition: opt.h:247
ff_request_frame
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:421
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_aresample.c:124
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
preinit
static av_cold int preinit(AVFilterContext *ctx)
Definition: af_aresample.c:46
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:153
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:64
aresample_inputs
static const AVFilterPad aresample_inputs[]
Definition: af_aresample.c:313
samplefmt.h
pts
static int64_t pts
Definition: transcode_aac.c:653
ff_all_formats
AVFilterFormats * ff_all_formats(enum AVMediaType type)
Return a list of all formats supported by FFmpeg for the given media type.
Definition: formats.c:432
swr_next_pts
int64_t swr_next_pts(struct SwrContext *s, int64_t pts)
Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...
Definition: swresample.c:917
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:50
swr_get_delay
int64_t swr_get_delay(struct SwrContext *s, int64_t base)
Gets the delay the next input sample will experience relative to the next output sample.
Definition: swresample.c:867
options
static const AVOption options[]
Definition: af_aresample.c:299
avassert.h
resample_child_next
static void * resample_child_next(void *obj, void *prev)
Definition: af_aresample.c:290
av_cold
#define av_cold
Definition: attributes.h:90
swr_init
av_cold int swr_init(struct SwrContext *s)
Initialize context after user parameters have been set.
Definition: swresample.c:152
s
#define s(width, name)
Definition: cbs_vp9.c:257
AVFrame::channels
int channels
number of audio channels, only used for audio.
Definition: frame.h:592
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ff_formats_ref
int ff_formats_ref(AVFilterFormats *f, AVFilterFormats **ref)
Add *ref as a new reference to formats.
Definition: formats.c:553
swr_alloc
av_cold struct SwrContext * swr_alloc(void)
Allocate SwrContext.
Definition: options.c:150
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
resample_child_class_iterate
static const AVClass * resample_child_class_iterate(void **iter)
Definition: af_aresample.c:283
swr_convert
int attribute_align_arg swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_count, const uint8_t *in_arg[SWR_CH_MAX], int in_count)
Definition: swresample.c:714
ctx
AVFormatContext * ctx
Definition: movenc.c:48
channels
channels
Definition: aptx.h:33
av_get_sample_fmt_name
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition: samplefmt.c:49
SwrContext
The libswresample context.
Definition: swresample_internal.h:95
swr_alloc_set_opts
struct SwrContext * swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)
Allocate SwrContext if needed and set/reset common parameters.
Definition: swresample.c:59
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:152
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
av_frame_copy_props
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition: frame.c:537
AResampleContext::sample_rate_arg
int sample_rate_arg
Definition: af_aresample.c:39
swr_get_class
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext.
Definition: options.c:145
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVFilterContext::inputs
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:354
ROUNDED_DIV
#define ROUNDED_DIV(a, b)
Definition: common.h:49
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
av_opt_get_sample_fmt
int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt)
Definition: opt.c:1012
av_opt_get_int
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
Definition: opt.c:915
swresample.h
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
av_opt_set_int
int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
Definition: opt.c:589
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_aresample.c:58
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
AVClass::child_next
void *(* child_next)(void *obj, void *prev)
Return next AVOptions-enabled child or NULL.
Definition: log.h:131
AVFrame::sample_rate
int sample_rate
Sample rate of the audio data.
Definition: frame.h:458
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AResampleContext::ratio
double ratio
Definition: af_aresample.c:40
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
aresample_outputs
static const AVFilterPad aresample_outputs[]
Definition: af_aresample.c:321
swr_free
av_cold void swr_free(SwrContext **ss)
Free the given SwrContext and set the pointer to NULL.
Definition: swresample.c:137
AVFrame::format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
Definition: frame.h:376
AVFrame::channel_layout
uint64_t channel_layout
Channel layout of the audio data.
Definition: frame.h:463
AResampleContext
Definition: af_aresample.c:37
AResampleContext::swr
struct SwrContext * swr
Definition: af_aresample.c:41
internal.h
flush_frame
static int flush_frame(AVFilterLink *outlink, int final, AVFrame **outsamplesref_ret)
Definition: af_aresample.c:221
aresample_class
static const AVClass aresample_class
Definition: af_aresample.c:304
AVFrame::nb_samples
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:369
AVFrame::extended_data
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:350
OFFSET
#define OFFSET(x)
Definition: af_aresample.c:296
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref)
Definition: af_aresample.c:169
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:56
av_rescale
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
Definition: mathematics.c:128
AVFilter
Filter definition.
Definition: avfilter.h:149
AResampleContext::next_pts
int64_t next_pts
Definition: af_aresample.c:42
ret
ret
Definition: filter_design.txt:187
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
ff_all_samplerates
AVFilterFormats * ff_all_samplerates(void)
Definition: formats.c:508
channel_layout.h
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
avfilter.h
AVFilterContext
An instance of a filter.
Definition: avfilter.h:346
audio.h
AVFilterFormatsConfig::formats
AVFilterFormats * formats
List of supported formats (pixel or sample).
Definition: avfilter.h:450
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_aresample.c:64
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:153
ff_af_aresample
const AVFilter ff_af_aresample
Definition: af_aresample.c:330
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
request_frame
static int request_frame(AVFilterLink *outlink)
Definition: af_aresample.c:252
AResampleContext::more_data
int more_data
Definition: af_aresample.c:43
avstring.h