FFmpeg  2.1.1
af_join.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 /**
20  * @file
21  * Audio join filter
22  *
23  * Join multiple audio inputs as different channels in
24  * a single output
25  */
26 
27 #include "libavutil/avassert.h"
28 #include "libavutil/channel_layout.h"
29 #include "libavutil/common.h"
30 #include "libavutil/opt.h"
31 
32 #include "audio.h"
33 #include "avfilter.h"
34 #include "formats.h"
35 #include "internal.h"
36 
37 typedef struct ChannelMap {
38  int input; ///< input stream index
39  int in_channel_idx; ///< index of in_channel in the input stream data
40  uint64_t in_channel; ///< layout describing the input channel
41  uint64_t out_channel; ///< layout describing the output channel
42 } ChannelMap;
43 
44 typedef struct JoinContext {
45  const AVClass *class;
46 
47  int inputs;
48  char *map;
50  uint64_t channel_layout;
51 
54 
55  /**
56  * Temporary storage for input frames, until we get one on each input.
57  */
59 
60  /**
61  * Temporary storage for buffer references, for assembling the output frame.
62  */
64 } JoinContext;
65 
66 #define OFFSET(x) offsetof(JoinContext, x)
67 #define A AV_OPT_FLAG_AUDIO_PARAM
68 #define F AV_OPT_FLAG_FILTERING_PARAM
69 static const AVOption join_options[] = {
70  { "inputs", "Number of input streams.", OFFSET(inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 1, INT_MAX, A|F },
71  { "channel_layout", "Channel layout of the "
72  "output stream.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, A|F },
73  { "map", "A comma-separated list of channels maps in the format "
74  "'input_stream.input_channel-output_channel.",
75  OFFSET(map), AV_OPT_TYPE_STRING, .flags = A|F },
76  { NULL }
77 };
78 
80 
82 {
83  AVFilterContext *ctx = link->dst;
84  JoinContext *s = ctx->priv;
85  int i;
86 
87  for (i = 0; i < ctx->nb_inputs; i++)
88  if (link == ctx->inputs[i])
89  break;
90  av_assert0(i < ctx->nb_inputs);
91  av_assert0(!s->input_frames[i]);
92  s->input_frames[i] = frame;
93 
94  return 0;
95 }
96 
97 static int parse_maps(AVFilterContext *ctx)
98 {
99  JoinContext *s = ctx->priv;
100  char separator = '|';
101  char *cur = s->map;
102 
103 #if FF_API_OLD_FILTER_OPTS
104  if (cur && strchr(cur, ',')) {
105  av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "
106  "separate the mappings.\n");
107  separator = ',';
108  }
109 #endif
110 
111  while (cur && *cur) {
112  char *sep, *next, *p;
113  uint64_t in_channel = 0, out_channel = 0;
114  int input_idx, out_ch_idx, in_ch_idx;
115 
116  next = strchr(cur, separator);
117  if (next)
118  *next++ = 0;
119 
120  /* split the map into input and output parts */
121  if (!(sep = strchr(cur, '-'))) {
122  av_log(ctx, AV_LOG_ERROR, "Missing separator '-' in channel "
123  "map '%s'\n", cur);
124  return AVERROR(EINVAL);
125  }
126  *sep++ = 0;
127 
128 #define PARSE_CHANNEL(str, var, inout) \
129  if (!(var = av_get_channel_layout(str))) { \
130  av_log(ctx, AV_LOG_ERROR, "Invalid " inout " channel: %s.\n", str);\
131  return AVERROR(EINVAL); \
132  } \
133  if (av_get_channel_layout_nb_channels(var) != 1) { \
134  av_log(ctx, AV_LOG_ERROR, "Channel map describes more than one " \
135  inout " channel.\n"); \
136  return AVERROR(EINVAL); \
137  }
138 
139  /* parse output channel */
140  PARSE_CHANNEL(sep, out_channel, "output");
141  if (!(out_channel & s->channel_layout)) {
142  av_log(ctx, AV_LOG_ERROR, "Output channel '%s' is not present in "
143  "requested channel layout.\n", sep);
144  return AVERROR(EINVAL);
145  }
146 
148  out_channel);
149  if (s->channels[out_ch_idx].input >= 0) {
150  av_log(ctx, AV_LOG_ERROR, "Multiple maps for output channel "
151  "'%s'.\n", sep);
152  return AVERROR(EINVAL);
153  }
154 
155  /* parse input channel */
156  input_idx = strtol(cur, &cur, 0);
157  if (input_idx < 0 || input_idx >= s->inputs) {
158  av_log(ctx, AV_LOG_ERROR, "Invalid input stream index: %d.\n",
159  input_idx);
160  return AVERROR(EINVAL);
161  }
162 
163  if (*cur)
164  cur++;
165 
166  in_ch_idx = strtol(cur, &p, 0);
167  if (p == cur) {
168  /* channel specifier is not a number,
169  * try to parse as channel name */
170  PARSE_CHANNEL(cur, in_channel, "input");
171  }
172 
173  s->channels[out_ch_idx].input = input_idx;
174  if (in_channel)
175  s->channels[out_ch_idx].in_channel = in_channel;
176  else
177  s->channels[out_ch_idx].in_channel_idx = in_ch_idx;
178 
179  cur = next;
180  }
181  return 0;
182 }
183 
185 {
186  JoinContext *s = ctx->priv;
187  int ret, i;
188 
190  av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
191  s->channel_layout_str);
192  return AVERROR(EINVAL);
193  }
194 
196  s->channels = av_mallocz(sizeof(*s->channels) * s->nb_channels);
197  s->buffers = av_mallocz(sizeof(*s->buffers) * s->nb_channels);
198  s->input_frames = av_mallocz(sizeof(*s->input_frames) * s->inputs);
199  if (!s->channels || !s->buffers|| !s->input_frames)
200  return AVERROR(ENOMEM);
201 
202  for (i = 0; i < s->nb_channels; i++) {
204  s->channels[i].input = -1;
205  }
206 
207  if ((ret = parse_maps(ctx)) < 0)
208  return ret;
209 
210  for (i = 0; i < s->inputs; i++) {
211  char name[32];
212  AVFilterPad pad = { 0 };
213 
214  snprintf(name, sizeof(name), "input%d", i);
215  pad.type = AVMEDIA_TYPE_AUDIO;
216  pad.name = av_strdup(name);
218 
219  pad.needs_fifo = 1;
220 
221  ff_insert_inpad(ctx, i, &pad);
222  }
223 
224  return 0;
225 }
226 
228 {
229  JoinContext *s = ctx->priv;
230  int i;
231 
232  for (i = 0; i < ctx->nb_inputs; i++) {
233  av_freep(&ctx->input_pads[i].name);
234  av_frame_free(&s->input_frames[i]);
235  }
236 
237  av_freep(&s->channels);
238  av_freep(&s->buffers);
239  av_freep(&s->input_frames);
240 }
241 
243 {
244  JoinContext *s = ctx->priv;
246  int i;
247 
250 
251  for (i = 0; i < ctx->nb_inputs; i++)
253  &ctx->inputs[i]->out_channel_layouts);
254 
257 
258  return 0;
259 }
260 
262  uint64_t *inputs)
263 {
264  int i;
265 
266  for (i = 0; i < ctx->nb_inputs; i++) {
267  AVFilterLink *link = ctx->inputs[i];
268 
269  if (ch->out_channel & link->channel_layout &&
270  !(ch->out_channel & inputs[i])) {
271  ch->input = i;
272  ch->in_channel = ch->out_channel;
273  inputs[i] |= ch->out_channel;
274  return;
275  }
276  }
277 }
278 
280  uint64_t *inputs)
281 {
282  int i;
283 
284  for (i = 0; i < ctx->nb_inputs; i++) {
285  AVFilterLink *link = ctx->inputs[i];
286 
287  if ((inputs[i] & link->channel_layout) != link->channel_layout) {
288  uint64_t unused = link->channel_layout & ~inputs[i];
289 
290  ch->input = i;
292  inputs[i] |= ch->in_channel;
293  return;
294  }
295  }
296 }
297 
298 static int join_config_output(AVFilterLink *outlink)
299 {
300  AVFilterContext *ctx = outlink->src;
301  JoinContext *s = ctx->priv;
302  uint64_t *inputs; // nth element tracks which channels are used from nth input
303  int i, ret = 0;
304 
305  /* initialize inputs to user-specified mappings */
306  if (!(inputs = av_mallocz(sizeof(*inputs) * ctx->nb_inputs)))
307  return AVERROR(ENOMEM);
308  for (i = 0; i < s->nb_channels; i++) {
309  ChannelMap *ch = &s->channels[i];
310  AVFilterLink *inlink;
311 
312  if (ch->input < 0)
313  continue;
314 
315  inlink = ctx->inputs[ch->input];
316 
317  if (!ch->in_channel)
319  ch->in_channel_idx);
320 
321  if (!(ch->in_channel & inlink->channel_layout)) {
322  av_log(ctx, AV_LOG_ERROR, "Requested channel %s is not present in "
323  "input stream #%d.\n", av_get_channel_name(ch->in_channel),
324  ch->input);
325  ret = AVERROR(EINVAL);
326  goto fail;
327  }
328 
329  inputs[ch->input] |= ch->in_channel;
330  }
331 
332  /* guess channel maps when not explicitly defined */
333  /* first try unused matching channels */
334  for (i = 0; i < s->nb_channels; i++) {
335  ChannelMap *ch = &s->channels[i];
336 
337  if (ch->input < 0)
338  guess_map_matching(ctx, ch, inputs);
339  }
340 
341  /* if the above failed, try to find _any_ unused input channel */
342  for (i = 0; i < s->nb_channels; i++) {
343  ChannelMap *ch = &s->channels[i];
344 
345  if (ch->input < 0)
346  guess_map_any(ctx, ch, inputs);
347 
348  if (ch->input < 0) {
349  av_log(ctx, AV_LOG_ERROR, "Could not find input channel for "
350  "output channel '%s'.\n",
352  goto fail;
353  }
354 
356  ch->in_channel);
357  }
358 
359  /* print mappings */
360  av_log(ctx, AV_LOG_VERBOSE, "mappings: ");
361  for (i = 0; i < s->nb_channels; i++) {
362  ChannelMap *ch = &s->channels[i];
363  av_log(ctx, AV_LOG_VERBOSE, "%d.%s => %s ", ch->input,
366  }
367  av_log(ctx, AV_LOG_VERBOSE, "\n");
368 
369  for (i = 0; i < ctx->nb_inputs; i++) {
370  if (!inputs[i])
371  av_log(ctx, AV_LOG_WARNING, "No channels are used from input "
372  "stream %d.\n", i);
373  }
374 
375 fail:
376  av_freep(&inputs);
377  return ret;
378 }
379 
380 static int join_request_frame(AVFilterLink *outlink)
381 {
382  AVFilterContext *ctx = outlink->src;
383  JoinContext *s = ctx->priv;
384  AVFrame *frame;
385  int linesize = INT_MAX;
386  int nb_samples = 0;
387  int nb_buffers = 0;
388  int i, j, ret;
389 
390  /* get a frame on each input */
391  for (i = 0; i < ctx->nb_inputs; i++) {
392  AVFilterLink *inlink = ctx->inputs[i];
393 
394  if (!s->input_frames[i] &&
395  (ret = ff_request_frame(inlink)) < 0)
396  return ret;
397 
398  /* request the same number of samples on all inputs */
399  if (i == 0) {
400  nb_samples = s->input_frames[0]->nb_samples;
401 
402  for (j = 1; !i && j < ctx->nb_inputs; j++)
403  ctx->inputs[j]->request_samples = nb_samples;
404  }
405  }
406 
407  /* setup the output frame */
408  frame = av_frame_alloc();
409  if (!frame)
410  return AVERROR(ENOMEM);
411  if (s->nb_channels > FF_ARRAY_ELEMS(frame->data)) {
412  frame->extended_data = av_mallocz(s->nb_channels *
413  sizeof(*frame->extended_data));
414  if (!frame->extended_data) {
415  ret = AVERROR(ENOMEM);
416  goto fail;
417  }
418  }
419 
420  /* copy the data pointers */
421  for (i = 0; i < s->nb_channels; i++) {
422  ChannelMap *ch = &s->channels[i];
423  AVFrame *cur = s->input_frames[ch->input];
424  AVBufferRef *buf;
425 
426  frame->extended_data[i] = cur->extended_data[ch->in_channel_idx];
427  linesize = FFMIN(linesize, cur->linesize[0]);
428 
429  /* add the buffer where this plan is stored to the list if it's
430  * not already there */
432  if (!buf) {
433  ret = AVERROR(EINVAL);
434  goto fail;
435  }
436  for (j = 0; j < nb_buffers; j++)
437  if (s->buffers[j]->buffer == buf->buffer)
438  break;
439  if (j == i)
440  s->buffers[nb_buffers++] = buf;
441  }
442 
443  /* create references to the buffers we copied to output */
444  if (nb_buffers > FF_ARRAY_ELEMS(frame->buf)) {
445  frame->nb_extended_buf = nb_buffers - FF_ARRAY_ELEMS(frame->buf);
446  frame->extended_buf = av_mallocz(sizeof(*frame->extended_buf) *
447  frame->nb_extended_buf);
448  if (!frame->extended_buf) {
449  frame->nb_extended_buf = 0;
450  ret = AVERROR(ENOMEM);
451  goto fail;
452  }
453  }
454  for (i = 0; i < FFMIN(FF_ARRAY_ELEMS(frame->buf), nb_buffers); i++) {
455  frame->buf[i] = av_buffer_ref(s->buffers[i]);
456  if (!frame->buf[i]) {
457  ret = AVERROR(ENOMEM);
458  goto fail;
459  }
460  }
461  for (i = 0; i < frame->nb_extended_buf; i++) {
462  frame->extended_buf[i] = av_buffer_ref(s->buffers[i +
463  FF_ARRAY_ELEMS(frame->buf)]);
464  if (!frame->extended_buf[i]) {
465  ret = AVERROR(ENOMEM);
466  goto fail;
467  }
468  }
469 
470  frame->nb_samples = nb_samples;
471  frame->channel_layout = outlink->channel_layout;
472  av_frame_set_channels(frame, outlink->channels);
473  frame->format = outlink->format;
474  frame->sample_rate = outlink->sample_rate;
475  frame->pts = s->input_frames[0]->pts;
476  frame->linesize[0] = linesize;
477  if (frame->data != frame->extended_data) {
478  memcpy(frame->data, frame->extended_data, sizeof(*frame->data) *
479  FFMIN(FF_ARRAY_ELEMS(frame->data), s->nb_channels));
480  }
481 
482  ret = ff_filter_frame(outlink, frame);
483 
484  for (i = 0; i < ctx->nb_inputs; i++)
485  av_frame_free(&s->input_frames[i]);
486 
487  return ret;
488 
489 fail:
490  av_frame_free(&frame);
491  return ret;
492 }
493 
495  {
496  .name = "default",
497  .type = AVMEDIA_TYPE_AUDIO,
498  .config_props = join_config_output,
499  .request_frame = join_request_frame,
500  },
501  { NULL }
502 };
503 
505  .name = "join",
506  .description = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
507  "multi-channel output."),
508  .priv_size = sizeof(JoinContext),
509  .priv_class = &join_class,
510  .init = join_init,
511  .uninit = join_uninit,
513  .inputs = NULL,
514  .outputs = avfilter_af_join_outputs,
516 };
const char * name
Definition: avisynth_c.h:675
const char * s
Definition: avisynth_c.h:668
uint64_t in_channel
layout describing the input channel
Definition: af_channelmap.c:41
This structure describes decoded (raw) audio or video data.
Definition: frame.h:96
AVOption.
Definition: opt.h:253
const char * name
Filter name.
Definition: avfilter.h:468
void * priv
private data for use by the filter
Definition: avfilter.h:648
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: avcodec.h:4153
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:111
char * av_strdup(const char *s) av_malloc_attrib
Duplicate the string s.
Definition: mem.c:256
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:425
int nb_extended_buf
Number of elements in extended_buf.
Definition: frame.h:384
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:140
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...
enum AVMediaType type
AVFilterPad type.
Definition: internal.h:71
static int query_formats(AVFilterContext *ctx)
Definition: af_aconvert.c:79
AVBufferRef ** buffers
Temporary storage for buffer references, for assembling the output frame.
Definition: af_join.c:63
#define av_cold
Definition: avcodec.h:653
void av_frame_set_channels(AVFrame *frame, int val)
AVBufferRef * av_frame_get_plane_buffer(AVFrame *frame, int plane)
Get the buffer reference a given data plane is stored in.
Definition: frame.c:513
char * map
Definition: af_join.c:48
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:234
const char * name
Pad name.
Definition: internal.h:66
int nb_channels
Definition: af_join.c:52
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1118
static av_cold void join_uninit(AVFilterContext *ctx)
Definition: af_join.c:227
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:334
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index)
Get the channel with the given index in channel_layout.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:182
static av_cold int join_init(AVFilterContext *ctx)
Definition: af_join.c:184
void ff_channel_layouts_ref(AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
Add *ref as a new reference to f.
Definition: formats.c:413
static void guess_map_matching(AVFilterContext *ctx, ChannelMap *ch, uint64_t *inputs)
Definition: af_join.c:261
int av_get_channel_layout_channel_index(uint64_t channel_layout, uint64_t channel)
Get the index of a channel in channel_layout.
int input
input stream index
Definition: af_join.c:38
#define AV_LOG_VERBOSE
Detailed information.
Definition: avcodec.h:4163
void ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:531
#define A(x)
Definition: vp56_arith.h:28
static AVFrame * frame
Definition: demuxing.c:51
static int join_query_formats(AVFilterContext *ctx)
Definition: af_join.c:242
A filter pad used for either input or output.
Definition: internal.h:60
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: avcodec.h:4147
int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout)
Definition: formats.c:336
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:151
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:110
int(* filter_frame)(AVFilterLink *link, AVFrame *frame)
Filtering callback.
Definition: internal.h:99
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:123
uint64_t channel_layout
Channel layout of the audio data.
Definition: frame.h:354
goto fail
Definition: avfilter.c:963
#define FF_ARRAY_ELEMS(a)
Definition: avcodec.h:929
static const AVOption join_options[]
Definition: af_join.c:69
unsigned nb_inputs
number of input pads
Definition: avfilter.h:639
ret
Definition: avfilter.c:961
#define FFMIN(a, b)
Definition: avcodec.h:925
AVFilterFormats * ff_planar_sample_fmts(void)
Construct a formats list containing all planar sample formats.
Definition: formats.c:370
AVBufferRef ** extended_buf
For planar audio which requires more than AV_NUM_DATA_POINTERS AVBufferRef pointers, this array will hold all the references which cannot fit into AVFrame.buf.
Definition: frame.h:380
AVFilterChannelLayouts * ff_all_channel_layouts(void)
Construct an empty AVFilterChannelLayouts/AVFilterFormats struct – representing any channel layout (w...
Definition: formats.c:388
static const AVFilterPad avfilter_af_join_outputs[]
Definition: af_join.c:494
int in_channel_idx
index of in_channel in the input stream data
Definition: af_channelmap.c:43
A list of supported channel layouts.
Definition: formats.h:85
Main libavfilter public API header.
AVFilterLink ** outputs
array of pointers to output links
Definition: avfilter.h:642
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
Definition: frame.h:157
AVBuffer * buffer
Definition: buffer.h:82
AVFilterPad * input_pads
array of input pads
Definition: avfilter.h:634
int inputs
Definition: af_join.c:47
void * buf
Definition: avisynth_c.h:594
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
Definition: frame.h:366
Describe the class of an AVClass context structure.
Definition: log.h:50
int sample_rate
Sample rate of the audio data.
Definition: frame.h:349
#define PARSE_CHANNEL(str, var, inout)
Filter definition.
Definition: avfilter.h:464
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:102
AVFilterLink ** inputs
array of pointers to input links
Definition: avfilter.h:635
uint64_t out_channel
layout describing the output channel
Definition: af_channelmap.c:42
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:124
#define snprintf
Definition: snprintf.h:34
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
AVFilterFormats * ff_all_samplerates(void)
Definition: formats.c:382
static int flags
Definition: cpu.c:45
AVFrame ** input_frames
Temporary storage for input frames, until we get one on each input.
Definition: af_join.c:58
const char * av_get_channel_name(uint64_t channel)
Get the name of a given channel.
ChannelMap * channels
Definition: af_join.c:53
#define F
Definition: af_join.c:68
void ff_set_common_samplerates(AVFilterContext *ctx, AVFilterFormats *samplerates)
Definition: formats.c:519
A reference to a data buffer.
Definition: buffer.h:81
#define OFFSET(x)
Definition: af_join.c:66
static void guess_map_any(AVFilterContext *ctx, ChannelMap *ch, uint64_t *inputs)
Definition: af_join.c:279
static int parse_maps(AVFilterContext *ctx)
Definition: af_join.c:97
static int join_request_frame(AVFilterLink *outlink)
Definition: af_join.c:380
char * channel_layout_str
Definition: af_join.c:49
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
Definition: buffer.c:91
#define AVFILTER_DEFINE_CLASS(fname)
Definition: internal.h:301
AVFilter avfilter_af_join
Definition: af_join.c:504
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
#define AVERROR(e)
An instance of a filter.
Definition: avfilter.h:627
static int join_config_output(AVFilterLink *outlink)
Definition: af_join.c:298
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
int needs_fifo
The filter expects a fifo to be inserted on its input link, typically because it has a delay...
Definition: internal.h:143
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
Definition: avfilter.c:335
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: af_join.c:81
internal API functions
uint64_t channel_layout
Definition: af_join.c:50
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:150
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:107
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:241
static int ff_insert_inpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new input pad for the filter.
Definition: internal.h:257