67 #define OFFSET(x) offsetof(JoinContext, x)
68 #define A AV_OPT_FLAG_AUDIO_PARAM
69 #define F AV_OPT_FLAG_FILTERING_PARAM
72 {
"channel_layout",
"Channel layout of the "
74 {
"map",
"A comma-separated list of channels maps in the format "
75 "'input_stream.input_channel-output_channel.",
89 if (link == ctx->
inputs[i])
101 char separator =
'|';
104 #if FF_API_OLD_FILTER_OPTS
105 if (cur && strchr(cur,
',')) {
107 "separate the mappings.\n");
112 while (cur && *cur) {
113 char *sep, *next, *p;
114 uint64_t in_channel = 0, out_channel = 0;
115 int input_idx, out_ch_idx, in_ch_idx;
117 next = strchr(cur, separator);
122 if (!(sep = strchr(cur,
'-'))) {
129 #define PARSE_CHANNEL(str, var, inout) \
130 if (!(var = av_get_channel_layout(str))) { \
131 av_log(ctx, AV_LOG_ERROR, "Invalid " inout " channel: %s.\n", str);\
132 return AVERROR(EINVAL); \
134 if (av_get_channel_layout_nb_channels(var) != 1) { \
135 av_log(ctx, AV_LOG_ERROR, "Channel map describes more than one " \
136 inout " channel.\n"); \
137 return AVERROR(EINVAL); \
144 "requested channel layout.\n", sep);
157 input_idx = strtol(cur, &cur, 0);
158 if (input_idx < 0 || input_idx >= s->
inputs) {
167 in_ch_idx = strtol(cur, &p, 0);
214 for (i = 0; i < s->
inputs; i++) {
218 snprintf(name,
sizeof(name),
"input%d", i);
356 "output channel '%s'.\n",
391 int linesize = INT_MAX;
408 for (j = 1; !i && j < ctx->
nb_inputs; j++)
442 for (j = 0; j < nb_buffers; j++)
462 if (!frame->
buf[i]) {
513 "multi-channel output."),
515 .priv_class = &join_class,
522 .
outputs = avfilter_af_join_outputs,