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