FFmpeg
Loading...
Searching...
No Matches
af_amerge.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Nicolas George <nicolas.george@normalesup.org>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21/**
22 * @file
23 * Audio merging filter
24 */
25
26#include "libavutil/avassert.h"
27#include "libavutil/avstring.h"
28#include "libavutil/bprint.h"
30#include "libavutil/mem.h"
31#include "libavutil/opt.h"
32#include "avfilter.h"
33#include "filters.h"
34#include "audio.h"
35#include "formats.h"
36
37#define SWR_CH_MAX 64
38
39typedef struct AMergeContext {
40 const AVClass *class;
42 int route[SWR_CH_MAX]; /**< channels routing, see copy_samples */
43 int bps;
44 struct amerge_input {
45 int nb_ch; /**< number of channels for the input */
46 } *in;
47 int layout_mode; /**< the method for determining the output channel layout */
49
50#define OFFSET(x) offsetof(AMergeContext, x)
51#define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
52
59
60static const AVOption amerge_options[] = {
61 { "inputs", "specify the number of inputs", OFFSET(nb_inputs),
62 AV_OPT_TYPE_INT, { .i64 = 2 }, 1, SWR_CH_MAX, FLAGS },
63 { "layout_mode", "method used to determine the output channel layout", OFFSET(layout_mode),
64 AV_OPT_TYPE_INT, { .i64 = LM_LEGACY }, 0, NB_LAYOUTMODES - 1, FLAGS, .unit = "layout_mode"},
65 { "legacy", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = LM_LEGACY }, 0, 0, FLAGS, .unit = "layout_mode" },
66 { "reset", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = LM_RESET }, 0, 0, FLAGS, .unit = "layout_mode" },
67 { "normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = LM_NORMAL }, 0, 0, FLAGS, .unit = "layout_mode" },
68 { NULL }
69};
70
72
74{
75 AMergeContext *s = ctx->priv;
76
77 av_freep(&s->in);
78}
79
80#define INLAYOUT(ctx, i) (&(ctx)->inputs[i]->incfg.channel_layouts->channel_layouts[0])
81
83{
84 static const enum AVSampleFormat packed_sample_fmts[] = {
91 };
92 AMergeContext *s = ctx->priv;
93 AVChannelLayout outlayout = { 0 };
94 uint64_t outmask = 0;
96 int i, ret, nb_ch = 0;
97 int native_layout_routes[SWR_CH_MAX] = { 0 };
98
99 for (i = 0; i < s->nb_inputs; i++) {
100 if (!ctx->inputs[i]->incfg.channel_layouts ||
101 !ctx->inputs[i]->incfg.channel_layouts->nb_channel_layouts) {
103 "No channel layout for input %d\n", i + 1);
104 return AVERROR(EAGAIN);
105 }
106 if (ctx->inputs[i]->incfg.channel_layouts->nb_channel_layouts > 1) {
107 char buf[256];
108 av_channel_layout_describe(INLAYOUT(ctx, i), buf, sizeof(buf));
109 av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1);
110 }
111 s->in[i].nb_ch = INLAYOUT(ctx, i)->nb_channels;
112 nb_ch += s->in[i].nb_ch;
113 }
114 if (nb_ch > SWR_CH_MAX) {
115 av_log(ctx, AV_LOG_ERROR, "Too many channels (max %d)\n", SWR_CH_MAX);
116 return AVERROR(EINVAL);
117 }
118 ret = av_channel_layout_custom_init(&outlayout, nb_ch);
119 if (ret < 0)
120 return ret;
121 for (int i = 0, ch_idx = 0; i < s->nb_inputs; i++) {
122 for (int j = 0; j < s->in[i].nb_ch; j++) {
124 if (INLAYOUT(ctx, i)->order == AV_CHANNEL_ORDER_CUSTOM)
125 outlayout.u.map[ch_idx] = INLAYOUT(ctx, i)->u.map[j];
126 else
127 outlayout.u.map[ch_idx].id = (id == AV_CHAN_NONE ? AV_CHAN_UNKNOWN : id);
128 if (id >= 0 && id < 64) {
129 outmask |= (1ULL << id);
130 native_layout_routes[id] = ch_idx;
131 }
132 s->route[ch_idx] = ch_idx;
133 ch_idx++;
134 }
135 }
136 switch (s->layout_mode) {
137 case LM_LEGACY:
138 av_channel_layout_uninit(&outlayout);
139 if (av_popcount64(outmask) != nb_ch) {
141 "Input channel layouts overlap: "
142 "output layout will be determined by the number of distinct input channels\n");
143 av_channel_layout_default(&outlayout, nb_ch);
144 if (!KNOWN(&outlayout) && nb_ch)
145 av_channel_layout_from_mask(&outlayout, 0xFFFFFFFFFFFFFFFFULL >> (64 - nb_ch));
146 } else {
147 for (int c = 0, ch_idx = 0; c < 64; c++)
148 if ((1ULL << c) & outmask)
149 s->route[native_layout_routes[c]] = ch_idx++;
150 av_channel_layout_from_mask(&outlayout, outmask);
151 }
152 break;
153 case LM_RESET:
154 av_channel_layout_uninit(&outlayout);
155 outlayout.order = AV_CHANNEL_ORDER_UNSPEC;
156 outlayout.nb_channels = nb_ch;
157 break;
158 case LM_NORMAL:
160 if (ret < 0)
161 goto out;
162 break;
163 default:
164 av_unreachable("Invalid layout_mode");
165 }
166 if ((ret = ff_set_sample_formats_from_list(ctx, packed_sample_fmts)) < 0)
167 goto out;
168 for (i = 0; i < s->nb_inputs; i++) {
169 layouts = NULL;
170 if ((ret = ff_add_channel_layout(&layouts, INLAYOUT(ctx, i))) < 0)
171 goto out;
172 if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0)
173 goto out;
174 }
175 layouts = NULL;
176 if ((ret = ff_add_channel_layout(&layouts, &outlayout)) < 0)
177 goto out;
178 if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0)
179 goto out;
180
182out:
183 av_channel_layout_uninit(&outlayout);
184 return ret;
185}
186
187static int config_output(AVFilterLink *outlink)
188{
189 AVFilterContext *ctx = outlink->src;
190 AMergeContext *s = ctx->priv;
191 AVBPrint bp;
192 int i;
193
194 s->bps = av_get_bytes_per_sample(outlink->format);
195 outlink->time_base = ctx->inputs[0]->time_base;
196
198 for (i = 0; i < s->nb_inputs; i++) {
199 av_bprintf(&bp, "%sin%d:", i ? " + " : "", i);
200 av_channel_layout_describe_bprint(&ctx->inputs[i]->ch_layout, &bp);
201 }
202 av_bprintf(&bp, " -> out:");
204 av_log(ctx, AV_LOG_VERBOSE, "%s\n", bp.str);
205
206 return 0;
207}
208
209/**
210 * Copy samples from several input streams to one output stream.
211 * @param nb_inputs number of inputs
212 * @param in inputs; used only for the nb_ch field;
213 * @param route routing values;
214 * input channel i goes to output channel route[i];
215 * i < in[0].nb_ch are the channels from the first output;
216 * i >= in[0].nb_ch are the channels from the second output
217 * @param ins pointer to the samples of each inputs, in packed format;
218 * will be left at the end of the copied samples
219 * @param outs pointer to the samples of the output, in packet format;
220 * must point to a buffer big enough;
221 * will be left at the end of the copied samples
222 * @param ns number of samples to copy
223 * @param bps bytes per sample
224 */
225static inline void copy_samples(int nb_inputs, struct amerge_input in[],
226 int *route, uint8_t *ins[],
227 uint8_t **outs, int ns, int bps)
228{
229 int *route_cur;
230 int i, c, nb_ch = 0;
231
232 for (i = 0; i < nb_inputs; i++)
233 nb_ch += in[i].nb_ch;
234 while (ns--) {
235 route_cur = route;
236 for (i = 0; i < nb_inputs; i++) {
237 for (c = 0; c < in[i].nb_ch; c++) {
238 memcpy((*outs) + bps * *(route_cur++), ins[i], bps);
239 ins[i] += bps;
240 }
241 }
242 *outs += nb_ch * bps;
243 }
244}
245
246static void free_frames(int nb_inputs, AVFrame **input_frames)
247{
248 int i;
249 for (i = 0; i < nb_inputs; i++)
250 av_frame_free(&input_frames[i]);
251}
252
253static int try_push_frame(AVFilterContext *ctx, int nb_samples)
254{
255 AMergeContext *s = ctx->priv;
256 AVFilterLink *outlink = ctx->outputs[0];
257 int i, ret;
258 AVFrame *outbuf, *inbuf[SWR_CH_MAX] = { NULL };
259 uint8_t *outs, *ins[SWR_CH_MAX];
260
261 for (i = 0; i < ctx->nb_inputs; i++) {
262 ret = ff_inlink_consume_samples(ctx->inputs[i], nb_samples, nb_samples, &inbuf[i]);
263 if (ret < 0) {
264 free_frames(i, inbuf);
265 return ret;
266 }
267 ins[i] = inbuf[i]->data[0];
268 }
269
270 outbuf = ff_get_audio_buffer(outlink, nb_samples);
271 if (!outbuf) {
272 free_frames(s->nb_inputs, inbuf);
273 return AVERROR(ENOMEM);
274 }
275
276 outs = outbuf->data[0];
277 outbuf->pts = inbuf[0]->pts;
278
279 outbuf->nb_samples = nb_samples;
280 outbuf->duration = av_rescale_q(outbuf->nb_samples,
281 av_make_q(1, outlink->sample_rate),
282 outlink->time_base);
283
284 if ((ret = av_channel_layout_copy(&outbuf->ch_layout, &outlink->ch_layout)) < 0) {
285 free_frames(s->nb_inputs, inbuf);
286 av_frame_free(&outbuf);
287 return ret;
288 }
289
290 while (nb_samples) {
291 /* Unroll the most common sample formats: speed +~350% for the loop,
292 +~13% overall (including two common decoders) */
293 switch (s->bps) {
294 case 1:
295 copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, nb_samples, 1);
296 break;
297 case 2:
298 copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, nb_samples, 2);
299 break;
300 case 4:
301 copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, nb_samples, 4);
302 break;
303 default:
304 copy_samples(s->nb_inputs, s->in, s->route, ins, &outs, nb_samples, s->bps);
305 break;
306 }
307
308 nb_samples = 0;
309 }
310
311 free_frames(s->nb_inputs, inbuf);
312 return ff_filter_frame(outlink, outbuf);
313}
314
316{
317 int i, status;
318 int ret, nb_samples;
319 int64_t pts;
320
322
323 nb_samples = ff_inlink_queued_samples(ctx->inputs[0]);
324 for (i = 1; i < ctx->nb_inputs && nb_samples > 0; i++) {
325 nb_samples = FFMIN(ff_inlink_queued_samples(ctx->inputs[i]), nb_samples);
326 }
327
328 if (nb_samples) {
329 ret = try_push_frame(ctx, nb_samples);
330 if (ret < 0)
331 return ret;
332 }
333
334 for (i = 0; i < ctx->nb_inputs; i++) {
335 if (ff_inlink_queued_samples(ctx->inputs[i]))
336 continue;
337
338 if (ff_inlink_acknowledge_status(ctx->inputs[i], &status, &pts)) {
339 ff_outlink_set_status(ctx->outputs[0], status, pts);
340 return 0;
341 } else if (ff_outlink_frame_wanted(ctx->outputs[0])) {
342 ff_inlink_request_frame(ctx->inputs[i]);
343 return 0;
344 }
345 }
346
347 return 0;
348}
349
351{
352 AMergeContext *s = ctx->priv;
353 int i, ret;
354
355 s->in = av_calloc(s->nb_inputs, sizeof(*s->in));
356 if (!s->in)
357 return AVERROR(ENOMEM);
358 for (i = 0; i < s->nb_inputs; i++) {
359 char *name = av_asprintf("in%d", i);
360 AVFilterPad pad = {
361 .name = name,
362 .type = AVMEDIA_TYPE_AUDIO,
363 };
364 if (!name)
365 return AVERROR(ENOMEM);
366 if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
367 return ret;
368 }
369 return 0;
370}
371
372static const AVFilterPad amerge_outputs[] = {
373 {
374 .name = "default",
375 .type = AVMEDIA_TYPE_AUDIO,
376 .config_props = config_output,
377 },
378};
379
381 .p.name = "amerge",
382 .p.description = NULL_IF_CONFIG_SMALL("Merge two or more audio streams into "
383 "a single multi-channel stream."),
384 .p.inputs = NULL,
385 .p.priv_class = &amerge_class,
387 .priv_size = sizeof(AMergeContext),
388 .init = init,
389 .uninit = uninit,
393};
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition aeval.c:246
static int try_push_frame(AVFilterContext *ctx, int nb_samples)
Definition af_amerge.c:253
const FFFilter ff_af_amerge
Definition af_amerge.c:380
LayoutModes
Definition af_amerge.c:53
@ LM_NORMAL
Definition af_amerge.c:56
@ LM_LEGACY
Definition af_amerge.c:54
@ LM_RESET
Definition af_amerge.c:55
@ NB_LAYOUTMODES
Definition af_amerge.c:57
static int query_formats(AVFilterContext *ctx)
Definition af_amerge.c:82
#define INLAYOUT(ctx, i)
Definition af_amerge.c:80
static const AVOption amerge_options[]
Definition af_amerge.c:60
static int activate(AVFilterContext *ctx)
Definition af_amerge.c:315
static av_cold void uninit(AVFilterContext *ctx)
Definition af_amerge.c:73
#define OFFSET(x)
Definition af_amerge.c:50
static int config_output(AVFilterLink *outlink)
Definition af_amerge.c:187
static const AVFilterPad amerge_outputs[]
Definition af_amerge.c:372
static void free_frames(int nb_inputs, AVFrame **input_frames)
Definition af_amerge.c:246
#define SWR_CH_MAX
Definition af_amerge.c:37
static void copy_samples(int nb_inputs, struct amerge_input in[], int *route, uint8_t *ins[], uint8_t **outs, int ns, int bps)
Copy samples from several input streams to one output stream.
Definition af_amerge.c:225
static FILE * out
static AVFormatContext * ctx
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition audio.c:74
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_unreachable(msg)
Asserts that are used as compiler optimization hints depending upon ASSERT_LEVEL and NBDEBUG.
Definition avassert.h:109
int ff_append_inpad_free_name(AVFilterContext *f, AVFilterPad *p)
Definition avfilter.c:132
int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
Test and acknowledge the change of status on the link.
Definition avfilter.c:1467
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
int ff_outlink_frame_wanted(AVFilterLink *link)
Test if a frame is wanted on an output link.
Definition avfilter.c:1690
int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, AVFrame **rframe)
Take samples from the link's FIFO and update the link's stats.
Definition avfilter.c:1540
int ff_inlink_queued_samples(AVFilterLink *link)
Definition avfilter.c:1495
void ff_inlink_request_frame(AVFilterLink *link)
Mark that a frame is wanted on the link.
Definition avfilter.c:1623
Main libavfilter public API header.
char * av_asprintf(const char *fmt,...)
Definition avstring.c:115
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:122
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition bprint.c:69
AVBPrint public header.
#define AV_BPRINT_SIZE_AUTOMATIC
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
Public libavutil channel layout APIs header.
#define FLAGS
Definition cmdutils.c:598
#define av_popcount64
Definition common.h:157
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
enum AVCodecID id
Definition dts2pts.c:607
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
int ff_add_channel_layout(AVFilterChannelLayouts **l, const AVChannelLayout *channel_layout)
Definition formats.c:588
int ff_set_sample_formats_from_list(AVFilterContext *ctx, const enum AVSampleFormat *fmts)
Equivalent to ff_set_common_formats(ctx, ff_make_sample_format_list(fmts))
Definition formats.c:974
int ff_set_common_all_samplerates(AVFilterContext *ctx)
Equivalent to ff_set_common_samplerates(ctx, ff_all_samplerates())
Definition formats.c:899
int ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
Add *ref as a new reference to f.
Definition formats.c:751
#define KNOWN(l)
Definition formats.h:111
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition avfilter.h:155
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrder order, int flags)
Change the AVChannelOrder of a channel layout.
int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, AVBPrint *bp)
bprint variant of av_channel_layout_describe().
#define AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL
The specified retype target order is ignored and the simplest possible (canonical) order is used for ...
int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int nb_channels)
Initialize a custom channel layout with the specified number of channels.
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
AVChannel
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
Make a copy of a channel layout.
@ AV_CHANNEL_ORDER_CUSTOM
The channel order does not correspond to any other predefined order and is stored as an explicit map.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
@ AV_CHAN_NONE
Invalid channel index.
@ AV_CHAN_UNKNOWN
Channel contains data, but its position is unknown.
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_VERBOSE
Detailed information.
Definition log.h:226
#define AV_LOG_INFO
Standard information.
Definition log.h:221
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
static AVRational av_make_q(int num, int den)
Create an AVRational.
Definition rational.h:71
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
Definition samplefmt.c:108
AVSampleFormat
Audio sample formats.
Definition samplefmt.h:55
@ AV_SAMPLE_FMT_FLT
float
Definition samplefmt.h:60
@ AV_SAMPLE_FMT_S32
signed 32 bits
Definition samplefmt.h:59
@ AV_SAMPLE_FMT_NONE
Definition samplefmt.h:56
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition samplefmt.h:57
@ AV_SAMPLE_FMT_DBL
double
Definition samplefmt.h:61
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition samplefmt.h:58
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_QUERY_FUNC(func)
Definition filters.h:238
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition filters.h:629
#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter)
Forward the status on an output link to all input links.
Definition filters.h:652
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#define FFMIN(a, b)
Definition macros.h:49
void * av_calloc(size_t nmemb, size_t size)
Definition mem.c:264
Memory handling functions.
enum MovChannelLayoutTag * layouts
Definition mov_chan.c:335
unsigned bps
Definition movenc.c:2088
AVOptions.
const char * name
Definition qsvenc.c:142
int nb_ch
number of channels for the input
Definition af_amerge.c:45
struct AMergeContext::amerge_input * in
int layout_mode
the method for determining the output channel layout
Definition af_amerge.c:47
int route[SWR_CH_MAX]
channels routing, see copy_samples
Definition af_amerge.c:42
enum AVChannel id
An AVChannelLayout holds information about the channel layout of audio data.
enum AVChannelOrder order
Channel order used in this layout.
union AVChannelLayout::@162063043056170047076125117143030261346263330336 u
Details about which channels are present in this layout.
int nb_channels
Number of channels in this layout.
AVChannelCustom * map
This member must be used when the channel order is AV_CHANNEL_ORDER_CUSTOM.
Describe the class of an AVClass context structure.
Definition log.h:76
A list of supported channel layouts.
Definition formats.h:85
An instance of a filter.
Definition avfilter.h:273
A filter pad used for either input or output.
Definition filters.h:40
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
int nb_samples
number of audio samples (per channel) described by this frame
Definition frame.h:552
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition frame.h:574
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
int64_t duration
Duration of the frame, in the same units as pts.
Definition frame.h:820
AVChannelLayout ch_layout
Channel layout of the audio data.
Definition frame.h:815
AVOption.
Definition opt.h:428
#define av_freep(p)
#define av_log(a,...)
static int64_t pts
static double c[64]