Merge commit 'dd7fc37c71955b78a2687f29e871f714d18de386'
* commit 'dd7fc37c71955b78a2687f29e871f714d18de386': af_join: switch to an AVOptions-based system. Conflicts: doc/filters.texi libavfilter/af_join.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		@@ -1245,7 +1245,7 @@ Number of input streams. Defaults to 2.
 | 
				
			|||||||
Desired output channel layout. Defaults to stereo.
 | 
					Desired output channel layout. Defaults to stereo.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@item map
 | 
					@item map
 | 
				
			||||||
Map channels from inputs to output. The argument is a comma-separated list of
 | 
					Map channels from inputs to output. The argument is a '|'-separated list of
 | 
				
			||||||
mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
 | 
					mappings, each in the @code{@var{input_idx}.@var{in_channel}-@var{out_channel}}
 | 
				
			||||||
form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
 | 
					form. @var{input_idx} is the 0-based index of the input stream. @var{in_channel}
 | 
				
			||||||
can be either the name of the input channel (e.g. FL for front left) or its
 | 
					can be either the name of the input channel (e.g. FL for front left) or its
 | 
				
			||||||
@@ -1265,7 +1265,7 @@ ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
 | 
				
			|||||||
To build a 5.1 output from 6 single-channel streams:
 | 
					To build a 5.1 output from 6 single-channel streams:
 | 
				
			||||||
@example
 | 
					@example
 | 
				
			||||||
ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
 | 
					ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
 | 
				
			||||||
'join=inputs=6:channel_layout=5.1:map=0.0-FL\,1.0-FR\,2.0-FC\,3.0-SL\,4.0-SR\,5.0-LFE'
 | 
					'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
 | 
				
			||||||
out
 | 
					out
 | 
				
			||||||
@end example
 | 
					@end example
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -103,14 +103,23 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
 | 
				
			|||||||
static int parse_maps(AVFilterContext *ctx)
 | 
					static int parse_maps(AVFilterContext *ctx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    JoinContext *s = ctx->priv;
 | 
					    JoinContext *s = ctx->priv;
 | 
				
			||||||
 | 
					    char separator = '|';
 | 
				
			||||||
    char *cur      = s->map;
 | 
					    char *cur      = s->map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if FF_API_OLD_FILTER_OPTS
 | 
				
			||||||
 | 
					    if (cur && strchr(cur, ',')) {
 | 
				
			||||||
 | 
					        av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to "
 | 
				
			||||||
 | 
					               "separate the mappings.\n");
 | 
				
			||||||
 | 
					        separator = ',';
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (cur && *cur) {
 | 
					    while (cur && *cur) {
 | 
				
			||||||
        char *sep, *next, *p;
 | 
					        char *sep, *next, *p;
 | 
				
			||||||
        uint64_t in_channel = 0, out_channel = 0;
 | 
					        uint64_t in_channel = 0, out_channel = 0;
 | 
				
			||||||
        int input_idx, out_ch_idx, in_ch_idx;
 | 
					        int input_idx, out_ch_idx, in_ch_idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        next = strchr(cur, ',');
 | 
					        next = strchr(cur, separator);
 | 
				
			||||||
        if (next)
 | 
					        if (next)
 | 
				
			||||||
            *next++ = 0;
 | 
					            *next++ = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -183,11 +192,6 @@ static int join_init(AVFilterContext *ctx, const char *args)
 | 
				
			|||||||
    JoinContext *s = ctx->priv;
 | 
					    JoinContext *s = ctx->priv;
 | 
				
			||||||
    int ret, i;
 | 
					    int ret, i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    s->class = &join_class;
 | 
					 | 
				
			||||||
    av_opt_set_defaults(s);
 | 
					 | 
				
			||||||
    if ((ret = av_set_options_string(s, args, "=", ":")) < 0)
 | 
					 | 
				
			||||||
        return ret;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
 | 
					    if (!(s->channel_layout = av_get_channel_layout(s->channel_layout_str))) {
 | 
				
			||||||
        av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
 | 
					        av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n",
 | 
				
			||||||
               s->channel_layout_str);
 | 
					               s->channel_layout_str);
 | 
				
			||||||
@@ -513,6 +517,7 @@ AVFilter avfilter_af_join = {
 | 
				
			|||||||
    .description    = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
 | 
					    .description    = NULL_IF_CONFIG_SMALL("Join multiple audio streams into "
 | 
				
			||||||
                                           "multi-channel output"),
 | 
					                                           "multi-channel output"),
 | 
				
			||||||
    .priv_size      = sizeof(JoinContext),
 | 
					    .priv_size      = sizeof(JoinContext),
 | 
				
			||||||
 | 
					    .priv_class     = &join_class,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .init           = join_init,
 | 
					    .init           = join_init,
 | 
				
			||||||
    .uninit         = join_uninit,
 | 
					    .uninit         = join_uninit,
 | 
				
			||||||
@@ -520,5 +525,4 @@ AVFilter avfilter_af_join = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    .inputs  = NULL,
 | 
					    .inputs  = NULL,
 | 
				
			||||||
    .outputs = avfilter_af_join_outputs,
 | 
					    .outputs = avfilter_af_join_outputs,
 | 
				
			||||||
    .priv_class = &join_class,
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -693,6 +693,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
 | 
				
			|||||||
        !strcmp(filter->filter->name, "hqdn3d"     ) ||
 | 
					        !strcmp(filter->filter->name, "hqdn3d"     ) ||
 | 
				
			||||||
        !strcmp(filter->filter->name, "idet"       ) ||
 | 
					        !strcmp(filter->filter->name, "idet"       ) ||
 | 
				
			||||||
        !strcmp(filter->filter->name,  "il"        ) ||
 | 
					        !strcmp(filter->filter->name,  "il"        ) ||
 | 
				
			||||||
 | 
					        !strcmp(filter->filter->name,  "join"      ) ||
 | 
				
			||||||
        !strcmp(filter->filter->name,  "kerndeint" ) ||
 | 
					        !strcmp(filter->filter->name,  "kerndeint" ) ||
 | 
				
			||||||
        !strcmp(filter->filter->name, "ocv"        ) ||
 | 
					        !strcmp(filter->filter->name, "ocv"        ) ||
 | 
				
			||||||
        !strcmp(filter->filter->name, "life"       ) ||
 | 
					        !strcmp(filter->filter->name, "life"       ) ||
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user