66 #define OFFSET(x) offsetof(JoinContext, x)
67 #define A AV_OPT_FLAG_AUDIO_PARAM
68 #define F AV_OPT_FLAG_FILTERING_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.",
88 if (link == ctx->
inputs[i])
100 char separator =
'|';
103 #if FF_API_OLD_FILTER_OPTS
104 if (cur && strchr(cur,
',')) {
106 "separate the mappings.\n");
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;
116 next = strchr(cur, separator);
121 if (!(sep = strchr(cur,
'-'))) {
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); \
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); \
143 "requested channel layout.\n", sep);
156 input_idx = strtol(cur, &cur, 0);
157 if (input_idx < 0 || input_idx >= s->
inputs) {
166 in_ch_idx = strtol(cur, &p, 0);
210 for (i = 0; i < s->
inputs; i++) {
214 snprintf(name,
sizeof(name),
"input%d", i);
350 "output channel '%s'.\n",
385 int linesize = INT_MAX;
402 for (j = 1; !i && j < ctx->
nb_inputs; j++)
436 for (j = 0; j < nb_buffers; j++)
456 if (!frame->
buf[i]) {
507 "multi-channel output."),
509 .priv_class = &join_class,
514 .
outputs = avfilter_af_join_outputs,