67 #define OFFSET(x) offsetof(JoinContext, x)
68 #define A AV_OPT_FLAG_AUDIO_PARAM
71 {
"channel_layout",
"Channel layout of the "
73 {
"map",
"A comma-separated list of channels maps in the format "
74 "'input_stream.input_channel-output_channel.",
93 if (link == ctx->
inputs[i])
105 char separator =
'|';
108 #if FF_API_OLD_FILTER_OPTS
109 if (cur && strchr(cur,
',')) {
111 "separate the mappings.\n");
116 while (cur && *cur) {
117 char *sep, *next, *p;
118 uint64_t in_channel = 0, out_channel = 0;
119 int input_idx, out_ch_idx, in_ch_idx;
121 next = strchr(cur, separator);
126 if (!(sep = strchr(cur,
'-'))) {
133 #define PARSE_CHANNEL(str, var, inout) \
134 if (!(var = av_get_channel_layout(str))) { \
135 av_log(ctx, AV_LOG_ERROR, "Invalid " inout " channel: %s.\n", str);\
136 return AVERROR(EINVAL); \
138 if (av_get_channel_layout_nb_channels(var) != 1) { \
139 av_log(ctx, AV_LOG_ERROR, "Channel map describes more than one " \
140 inout " channel.\n"); \
141 return AVERROR(EINVAL); \
148 "requested channel layout.\n", sep);
161 input_idx = strtol(cur, &cur, 0);
162 if (input_idx < 0 || input_idx >= s->
inputs) {
171 in_ch_idx = strtol(cur, &p, 0);
218 for (i = 0; i < s->
inputs; i++) {
222 snprintf(name,
sizeof(name),
"input%d", i);
360 "output channel '%s'.\n",
395 int linesize = INT_MAX;
412 for (j = 1; !i && j < ctx->
nb_inputs; j++)
446 for (j = 0; j < nb_buffers; j++)
450 s->
buffers[nb_buffers++] = buf;
466 if (!frame->
buf[i]) {
515 "multi-channel output"),
517 .priv_class = &join_class,
524 .
outputs = avfilter_af_join_outputs,