It will allow to refernce it as a whole without clunky macros. Most of the changes have been automatically made with sed: sed -i ' s/-> *in_formats/->incfg.formats/g; s/-> *out_formats/->outcfg.formats/g; s/-> *in_channel_layouts/->incfg.channel_layouts/g; s/-> *out_channel_layouts/->outcfg.channel_layouts/g; s/-> *in_samplerates/->incfg.samplerates/g; s/-> *out_samplerates/->outcfg.samplerates/g; ' src/libavfilter/*(.)
Unified · Split
| @@ -362,7 +362,7 @@ static int aeval_query_formats(AVFilterContext *ctx) · 361 unmodified lines | |||
| 362 | 362 | ||
| 363 | // inlink supports any channel layout | 363 | // inlink supports any channel layout |
| 364 | layouts = ff_all_channel_counts(); | 364 | layouts = ff_all_channel_counts(); |
| 365 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 365 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 366 | return ret; | 366 | return ret; |
| 367 | 367 | ||
| 368 | if (eval->same_chlayout) { | 368 | if (eval->same_chlayout) { |
| @@ -376,7 +376,7 @@ static int aeval_query_formats(AVFilterContext *ctx) · 7 unmodified lines | |||
| 376 | eval->out_channel_layout ? eval->out_channel_layout : | 376 | eval->out_channel_layout ? eval->out_channel_layout : |
| 377 | FF_COUNT2LAYOUT(eval->nb_channels))) < 0) | 377 | FF_COUNT2LAYOUT(eval->nb_channels))) < 0) |
| 378 | return ret; | 378 | return ret; |
| 379 | if ((ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts)) < 0) | 379 | if ((ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts)) < 0) |
| 380 | return ret; | 380 | return ret; |
| 381 | } | 381 | } |
| 382 | 382 | ||
| @@ -731,7 +731,7 @@ static int query_formats(AVFilterContext *ctx) · 730 unmodified lines | |||
| 731 | if (s->response) { | 731 | if (s->response) { |
| 732 | AVFilterLink *videolink = ctx->outputs[1]; | 732 | AVFilterLink *videolink = ctx->outputs[1]; |
| 733 | formats = ff_make_format_list(pix_fmts); | 733 | formats = ff_make_format_list(pix_fmts); |
| 734 | if ((ret = ff_formats_ref(formats, &videolink->in_formats)) < 0) | 734 | if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0) |
| 735 | return ret; | 735 | return ret; |
| 736 | } | 736 | } |
| 737 | 737 | ||
| @@ -746,16 +746,16 @@ static int query_formats(AVFilterContext *ctx) · 8 unmodified lines | |||
| 746 | } else { | 746 | } else { |
| 747 | AVFilterChannelLayouts *mono = NULL; | 747 | AVFilterChannelLayouts *mono = NULL; |
| 748 | 748 | ||
| 749 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts)) < 0) | 749 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->outcfg.channel_layouts)) < 0) |
| 750 | return ret; | 750 | return ret; |
| 751 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0) | 751 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 752 | return ret; | 752 | return ret; |
| 753 | 753 | ||
| 754 | ret = ff_add_channel_layout(&mono, AV_CH_LAYOUT_MONO); | 754 | ret = ff_add_channel_layout(&mono, AV_CH_LAYOUT_MONO); |
| 755 | if (ret) | 755 | if (ret) |
| 756 | return ret; | 756 | return ret; |
| 757 | for (int i = 1; i < ctx->nb_inputs; i++) { | 757 | for (int i = 1; i < ctx->nb_inputs; i++) { |
| 758 | if ((ret = ff_channel_layouts_ref(mono, &ctx->inputs[i]->out_channel_layouts)) < 0) | 758 | if ((ret = ff_channel_layouts_ref(mono, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) |
| 759 | return ret; | 759 | return ret; |
| 760 | } | 760 | } |
| 761 | } | 761 | } |
| @@ -353,20 +353,20 @@ static int scquery_formats(AVFilterContext *ctx) · 352 unmodified lines | |||
| 353 | }; | 353 | }; |
| 354 | int ret, i; | 354 | int ret, i; |
| 355 | 355 | ||
| 356 | if (!ctx->inputs[0]->in_channel_layouts || | 356 | if (!ctx->inputs[0]->incfg.channel_layouts || |
| 357 | !ctx->inputs[0]->in_channel_layouts->nb_channel_layouts) { | 357 | !ctx->inputs[0]->incfg.channel_layouts->nb_channel_layouts) { |
| 358 | av_log(ctx, AV_LOG_WARNING, | 358 | av_log(ctx, AV_LOG_WARNING, |
| 359 | "No channel layout for input 1\n"); | 359 | "No channel layout for input 1\n"); |
| 360 | return AVERROR(EAGAIN); | 360 | return AVERROR(EAGAIN); |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | if ((ret = ff_add_channel_layout(&layouts, ctx->inputs[0]->in_channel_layouts->channel_layouts[0])) < 0 || | 363 | if ((ret = ff_add_channel_layout(&layouts, ctx->inputs[0]->incfg.channel_layouts->channel_layouts[0])) < 0 || |
| 364 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0) | 364 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 365 | return ret; | 365 | return ret; |
| 366 | 366 | ||
| 367 | for (i = 0; i < 2; i++) { | 367 | for (i = 0; i < 2; i++) { |
| 368 | layouts = ff_all_channel_counts(); | 368 | layouts = ff_all_channel_counts(); |
| 369 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts)) < 0) | 369 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) |
| 370 | return ret; | 370 | return ret; |
| 371 | } | 371 | } |
| 372 | 372 | ||
| @@ -95,7 +95,7 @@ static int query_formats(AVFilterContext *ctx) · 94 unmodified lines | |||
| 95 | AVFilterLink *videolink = ctx->outputs[1]; | 95 | AVFilterLink *videolink = ctx->outputs[1]; |
| 96 | 96 | ||
| 97 | formats = ff_make_format_list(pix_fmts); | 97 | formats = ff_make_format_list(pix_fmts); |
| 98 | if ((ret = ff_formats_ref(formats, &videolink->in_formats)) < 0) | 98 | if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0) |
| 99 | return ret; | 99 | return ret; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| @@ -81,14 +81,14 @@ static int query_formats(AVFilterContext *ctx) · 80 unmodified lines | |||
| 81 | int i, ret, overlap = 0, nb_ch = 0; | 81 | int i, ret, overlap = 0, nb_ch = 0; |
| 82 | 82 | ||
| 83 | for (i = 0; i < s->nb_inputs; i++) { | 83 | for (i = 0; i < s->nb_inputs; i++) { |
| 84 | if (!ctx->inputs[i]->in_channel_layouts || | 84 | if (!ctx->inputs[i]->incfg.channel_layouts || |
| 85 | !ctx->inputs[i]->in_channel_layouts->nb_channel_layouts) { | 85 | !ctx->inputs[i]->incfg.channel_layouts->nb_channel_layouts) { |
| 86 | av_log(ctx, AV_LOG_WARNING, | 86 | av_log(ctx, AV_LOG_WARNING, |
| 87 | "No channel layout for input %d\n", i + 1); | 87 | "No channel layout for input %d\n", i + 1); |
| 88 | return AVERROR(EAGAIN); | 88 | return AVERROR(EAGAIN); |
| 89 | } | 89 | } |
| 90 | inlayout[i] = ctx->inputs[i]->in_channel_layouts->channel_layouts[0]; | 90 | inlayout[i] = ctx->inputs[i]->incfg.channel_layouts->channel_layouts[0]; |
| 91 | if (ctx->inputs[i]->in_channel_layouts->nb_channel_layouts > 1) { | 91 | if (ctx->inputs[i]->incfg.channel_layouts->nb_channel_layouts > 1) { |
| 92 | char buf[256]; | 92 | char buf[256]; |
| 93 | av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]); | 93 | av_get_channel_layout_string(buf, sizeof(buf), 0, inlayout[i]); |
| 94 | av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1); | 94 | av_log(ctx, AV_LOG_INFO, "Using \"%s\" for input %d\n", buf, i + 1); |
| @@ -136,13 +136,13 @@ static int query_formats(AVFilterContext *ctx) · 41 unmodified lines | |||
| 136 | layouts = NULL; | 136 | layouts = NULL; |
| 137 | if ((ret = ff_add_channel_layout(&layouts, inlayout[i])) < 0) | 137 | if ((ret = ff_add_channel_layout(&layouts, inlayout[i])) < 0) |
| 138 | return ret; | 138 | return ret; |
| 139 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts)) < 0) | 139 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) |
| 140 | return ret; | 140 | return ret; |
| 141 | } | 141 | } |
| 142 | layouts = NULL; | 142 | layouts = NULL; |
| 143 | if ((ret = ff_add_channel_layout(&layouts, outlayout)) < 0) | 143 | if ((ret = ff_add_channel_layout(&layouts, outlayout)) < 0) |
| 144 | return ret; | 144 | return ret; |
| 145 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0) | 145 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 146 | return ret; | 146 | return ret; |
| 147 | 147 | ||
| 148 | return ff_set_common_samplerates(ctx, ff_all_samplerates()); | 148 | return ff_set_common_samplerates(ctx, ff_all_samplerates()); |
| @@ -231,23 +231,23 @@ static int query_formats(AVFilterContext *ctx) · 230 unmodified lines | |||
| 231 | if (s->draw_curves) { | 231 | if (s->draw_curves) { |
| 232 | AVFilterLink *videolink = ctx->outputs[1]; | 232 | AVFilterLink *videolink = ctx->outputs[1]; |
| 233 | formats = ff_make_format_list(pix_fmts); | 233 | formats = ff_make_format_list(pix_fmts); |
| 234 | if ((ret = ff_formats_ref(formats, &videolink->in_formats)) < 0) | 234 | if ((ret = ff_formats_ref(formats, &videolink->incfg.formats)) < 0) |
| 235 | return ret; | 235 | return ret; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | formats = ff_make_format_list(sample_fmts); | 238 | formats = ff_make_format_list(sample_fmts); |
| 239 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0 || | 239 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0 || |
| 240 | (ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 240 | (ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 241 | return ret; | 241 | return ret; |
| 242 | 242 | ||
| 243 | layouts = ff_all_channel_counts(); | 243 | layouts = ff_all_channel_counts(); |
| 244 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0 || | 244 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0 || |
| 245 | (ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts)) < 0) | 245 | (ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts)) < 0) |
| 246 | return ret; | 246 | return ret; |
| 247 | 247 | ||
| 248 | formats = ff_all_samplerates(); | 248 | formats = ff_all_samplerates(); |
| 249 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0 || | 249 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 || |
| 250 | (ret = ff_formats_ref(formats, &outlink->in_samplerates)) < 0) | 250 | (ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) |
| 251 | return ret; | 251 | return ret; |
| 252 | 252 | ||
| 253 | return 0; | 253 | return 0; |
| @@ -95,15 +95,15 @@ static int query_formats(AVFilterContext *ctx) · 94 unmodified lines | |||
| 95 | av_opt_get_int(aresample->swr, "ocl", 0, &out_layout); | 95 | av_opt_get_int(aresample->swr, "ocl", 0, &out_layout); |
| 96 | 96 | ||
| 97 | in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); | 97 | in_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); |
| 98 | if ((ret = ff_formats_ref(in_formats, &inlink->out_formats)) < 0) | 98 | if ((ret = ff_formats_ref(in_formats, &inlink->outcfg.formats)) < 0) |
| 99 | return ret; | 99 | return ret; |
| 100 | 100 | ||
| 101 | in_samplerates = ff_all_samplerates(); | 101 | in_samplerates = ff_all_samplerates(); |
| 102 | if ((ret = ff_formats_ref(in_samplerates, &inlink->out_samplerates)) < 0) | 102 | if ((ret = ff_formats_ref(in_samplerates, &inlink->outcfg.samplerates)) < 0) |
| 103 | return ret; | 103 | return ret; |
| 104 | 104 | ||
| 105 | in_layouts = ff_all_channel_counts(); | 105 | in_layouts = ff_all_channel_counts(); |
| 106 | if ((ret = ff_channel_layouts_ref(in_layouts, &inlink->out_channel_layouts)) < 0) | 106 | if ((ret = ff_channel_layouts_ref(in_layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 107 | return ret; | 107 | return ret; |
| 108 | 108 | ||
| 109 | if(out_rate > 0) { | 109 | if(out_rate > 0) { |
| @@ -113,7 +113,7 @@ static int query_formats(AVFilterContext *ctx) · 3 unmodified lines | |||
| 113 | out_samplerates = ff_all_samplerates(); | 113 | out_samplerates = ff_all_samplerates(); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | if ((ret = ff_formats_ref(out_samplerates, &outlink->in_samplerates)) < 0) | 116 | if ((ret = ff_formats_ref(out_samplerates, &outlink->incfg.samplerates)) < 0) |
| 117 | return ret; | 117 | return ret; |
| 118 | 118 | ||
| 119 | if(out_format != AV_SAMPLE_FMT_NONE) { | 119 | if(out_format != AV_SAMPLE_FMT_NONE) { |
| @@ -121,7 +121,7 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 121 | out_formats = ff_make_format_list(formatlist); | 121 | out_formats = ff_make_format_list(formatlist); |
| 122 | } else | 122 | } else |
| 123 | out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); | 123 | out_formats = ff_all_formats(AVMEDIA_TYPE_AUDIO); |
| 124 | if ((ret = ff_formats_ref(out_formats, &outlink->in_formats)) < 0) | 124 | if ((ret = ff_formats_ref(out_formats, &outlink->incfg.formats)) < 0) |
| 125 | return ret; | 125 | return ret; |
| 126 | 126 | ||
| 127 | if(out_layout) { | 127 | if(out_layout) { |
| @@ -130,7 +130,7 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 130 | } else | 130 | } else |
| 131 | out_layouts = ff_all_channel_counts(); | 131 | out_layouts = ff_all_channel_counts(); |
| 132 | 132 | ||
| 133 | return ff_channel_layouts_ref(out_layouts, &outlink->in_channel_layouts); | 133 | return ff_channel_layouts_ref(out_layouts, &outlink->incfg.channel_layouts); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | 136 | ||
| @@ -52,7 +52,7 @@ static av_cold int query_formats(AVFilterContext *ctx) · 51 unmodified lines | |||
| 52 | int sample_rates[] = { sr->sample_rate, -1 }; | 52 | int sample_rates[] = { sr->sample_rate, -1 }; |
| 53 | 53 | ||
| 54 | return ff_formats_ref(ff_make_format_list(sample_rates), | 54 | return ff_formats_ref(ff_make_format_list(sample_rates), |
| 55 | &ctx->outputs[0]->in_samplerates); | 55 | &ctx->outputs[0]->incfg.samplerates); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static av_cold int config_props(AVFilterLink *outlink) | 58 | static av_cold int config_props(AVFilterLink *outlink) |
| @@ -287,11 +287,11 @@ static int channelmap_query_formats(AVFilterContext *ctx) · 286 unmodified lines | |||
| 287 | (ret = ff_set_common_samplerates (ctx , ff_all_samplerates() )) < 0 || | 287 | (ret = ff_set_common_samplerates (ctx , ff_all_samplerates() )) < 0 || |
| 288 | (ret = ff_add_channel_layout(&channel_layouts, s->output_layout)) < 0 || | 288 | (ret = ff_add_channel_layout(&channel_layouts, s->output_layout)) < 0 || |
| 289 | (ret = ff_channel_layouts_ref(channel_layouts, | 289 | (ret = ff_channel_layouts_ref(channel_layouts, |
| 290 | &ctx->outputs[0]->in_channel_layouts)) < 0) | 290 | &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 291 | return ret; | 291 | return ret; |
| 292 | 292 | ||
| 293 | return ff_channel_layouts_ref(ff_all_channel_counts(), | 293 | return ff_channel_layouts_ref(ff_all_channel_counts(), |
| 294 | &ctx->inputs[0]->out_channel_layouts); | 294 | &ctx->inputs[0]->outcfg.channel_layouts); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) | 297 | static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) |
| @@ -117,7 +117,7 @@ static int query_formats(AVFilterContext *ctx) · 116 unmodified lines | |||
| 117 | return ret; | 117 | return ret; |
| 118 | 118 | ||
| 119 | if ((ret = ff_add_channel_layout(&in_layouts, s->channel_layout)) < 0 || | 119 | if ((ret = ff_add_channel_layout(&in_layouts, s->channel_layout)) < 0 || |
| 120 | (ret = ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->out_channel_layouts)) < 0) | 120 | (ret = ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->outcfg.channel_layouts)) < 0) |
| 121 | return ret; | 121 | return ret; |
| 122 | 122 | ||
| 123 | for (i = 0; i < ctx->nb_outputs; i++) { | 123 | for (i = 0; i < ctx->nb_outputs; i++) { |
| @@ -125,7 +125,7 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 125 | uint64_t channel = av_channel_layout_extract_channel(s->channel_layout, s->map[i]); | 125 | uint64_t channel = av_channel_layout_extract_channel(s->channel_layout, s->map[i]); |
| 126 | 126 | ||
| 127 | if ((ret = ff_add_channel_layout(&out_layouts, channel)) < 0 || | 127 | if ((ret = ff_add_channel_layout(&out_layouts, channel)) < 0 || |
| 128 | (ret = ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->in_channel_layouts)) < 0) | 128 | (ret = ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->incfg.channel_layouts)) < 0) |
| 129 | return ret; | 129 | return ret; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| @@ -1638,12 +1638,12 @@ static int query_formats(AVFilterContext *ctx) · 1637 unmodified lines | |||
| 1638 | return ret; | 1638 | return ret; |
| 1639 | 1639 | ||
| 1640 | in_formats = ff_make_format_list(sample_fmts_in); | 1640 | in_formats = ff_make_format_list(sample_fmts_in); |
| 1641 | ret = ff_formats_ref(in_formats, &inlink->out_formats); | 1641 | ret = ff_formats_ref(in_formats, &inlink->outcfg.formats); |
| 1642 | if (ret < 0) | 1642 | if (ret < 0) |
| 1643 | return ret; | 1643 | return ret; |
| 1644 | 1644 | ||
| 1645 | out_formats = ff_make_format_list(sample_fmts_out); | 1645 | out_formats = ff_make_format_list(sample_fmts_out); |
| 1646 | ret = ff_formats_ref(out_formats, &outlink->in_formats); | 1646 | ret = ff_formats_ref(out_formats, &outlink->incfg.formats); |
| 1647 | if (ret < 0) | 1647 | if (ret < 0) |
| 1648 | return ret; | 1648 | return ret; |
| 1649 | 1649 | ||
| @@ -698,14 +698,14 @@ static int query_formats(AVFilterContext *ctx) · 697 unmodified lines | |||
| 698 | if (!layouts) | 698 | if (!layouts) |
| 699 | return AVERROR(ENOMEM); | 699 | return AVERROR(ENOMEM); |
| 700 | 700 | ||
| 701 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts); | 701 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->outcfg.channel_layouts); |
| 702 | if (ret) | 702 | if (ret) |
| 703 | return ret; | 703 | return ret; |
| 704 | 704 | ||
| 705 | ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO); | 705 | ret = ff_add_channel_layout(&stereo_layout, AV_CH_LAYOUT_STEREO); |
| 706 | if (ret) | 706 | if (ret) |
| 707 | return ret; | 707 | return ret; |
| 708 | ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->in_channel_layouts); | 708 | ret = ff_channel_layouts_ref(stereo_layout, &ctx->outputs[0]->incfg.channel_layouts); |
| 709 | if (ret) | 709 | if (ret) |
| 710 | return ret; | 710 | return ret; |
| 711 | 711 | ||
| @@ -713,12 +713,12 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 713 | hrir_layouts = ff_all_channel_counts(); | 713 | hrir_layouts = ff_all_channel_counts(); |
| 714 | if (!hrir_layouts) | 714 | if (!hrir_layouts) |
| 715 | return AVERROR(ENOMEM); | 715 | return AVERROR(ENOMEM); |
| 716 | ret = ff_channel_layouts_ref(hrir_layouts, &ctx->inputs[1]->out_channel_layouts); | 716 | ret = ff_channel_layouts_ref(hrir_layouts, &ctx->inputs[1]->outcfg.channel_layouts); |
| 717 | if (ret) | 717 | if (ret) |
| 718 | return ret; | 718 | return ret; |
| 719 | } else { | 719 | } else { |
| 720 | for (i = 1; i < s->nb_inputs; i++) { | 720 | for (i = 1; i < s->nb_inputs; i++) { |
| 721 | ret = ff_channel_layouts_ref(stereo_layout, &ctx->inputs[i]->out_channel_layouts); | 721 | ret = ff_channel_layouts_ref(stereo_layout, &ctx->inputs[i]->outcfg.channel_layouts); |
| 722 | if (ret) | 722 | if (ret) |
| 723 | return ret; | 723 | return ret; |
| 724 | } | 724 | } |
| @@ -227,12 +227,12 @@ static int join_query_formats(AVFilterContext *ctx) · 226 unmodified lines | |||
| 227 | int i, ret; | 227 | int i, ret; |
| 228 | 228 | ||
| 229 | if ((ret = ff_add_channel_layout(&layouts, s->channel_layout)) < 0 || | 229 | if ((ret = ff_add_channel_layout(&layouts, s->channel_layout)) < 0 || |
| 230 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0) | 230 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 231 | return ret; | 231 | return ret; |
| 232 | 232 | ||
| 233 | for (i = 0; i < ctx->nb_inputs; i++) { | 233 | for (i = 0; i < ctx->nb_inputs; i++) { |
| 234 | layouts = ff_all_channel_layouts(); | 234 | layouts = ff_all_channel_layouts(); |
| 235 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts)) < 0) | 235 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) |
| 236 | return ret; | 236 | return ret; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| @@ -714,12 +714,12 @@ static int query_formats(AVFilterContext *ctx) · 713 unmodified lines | |||
| 714 | ret = ff_add_channel_layout(&layouts, inlayout); | 714 | ret = ff_add_channel_layout(&layouts, inlayout); |
| 715 | if (ret < 0) | 715 | if (ret < 0) |
| 716 | return ret; | 716 | return ret; |
| 717 | ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts); | 717 | ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts); |
| 718 | if (ret < 0) | 718 | if (ret < 0) |
| 719 | return ret; | 719 | return ret; |
| 720 | 720 | ||
| 721 | if (!s->nb_outputs) { | 721 | if (!s->nb_outputs) { |
| 722 | ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); | 722 | ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); |
| 723 | if (ret < 0) | 723 | if (ret < 0) |
| 724 | return ret; | 724 | return ret; |
| 725 | } | 725 | } |
| @@ -732,7 +732,7 @@ static int query_formats(AVFilterContext *ctx) · 6 unmodified lines | |||
| 732 | ret = ff_add_channel_layout(&layouts, outlayout); | 732 | ret = ff_add_channel_layout(&layouts, outlayout); |
| 733 | if (ret < 0) | 733 | if (ret < 0) |
| 734 | return ret; | 734 | return ret; |
| 735 | ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); | 735 | ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); |
| 736 | if (ret < 0) | 736 | if (ret < 0) |
| 737 | return ret; | 737 | return ret; |
| 738 | } | 738 | } |
| @@ -714,10 +714,10 @@ static int query_formats(AVFilterContext *ctx) · 713 unmodified lines | |||
| 714 | formats = ff_make_format_list(input_srate); | 714 | formats = ff_make_format_list(input_srate); |
| 715 | if (!formats) | 715 | if (!formats) |
| 716 | return AVERROR(ENOMEM); | 716 | return AVERROR(ENOMEM); |
| 717 | ret = ff_formats_ref(formats, &inlink->out_samplerates); | 717 | ret = ff_formats_ref(formats, &inlink->outcfg.samplerates); |
| 718 | if (ret < 0) | 718 | if (ret < 0) |
| 719 | return ret; | 719 | return ret; |
| 720 | ret = ff_formats_ref(formats, &outlink->in_samplerates); | 720 | ret = ff_formats_ref(formats, &outlink->incfg.samplerates); |
| 721 | if (ret < 0) | 721 | if (ret < 0) |
| 722 | return ret; | 722 | return ret; |
| 723 | } | 723 | } |
| @@ -524,12 +524,12 @@ static int query_formats(AVFilterContext *ctx) · 523 unmodified lines | |||
| 524 | ret = ff_add_channel_layout(&layouts, inlayout); | 524 | ret = ff_add_channel_layout(&layouts, inlayout); |
| 525 | if (ret < 0) | 525 | if (ret < 0) |
| 526 | return ret; | 526 | return ret; |
| 527 | ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts); | 527 | ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts); |
| 528 | if (ret < 0) | 528 | if (ret < 0) |
| 529 | return ret; | 529 | return ret; |
| 530 | 530 | ||
| 531 | if (!s->nb_outputs) { | 531 | if (!s->nb_outputs) { |
| 532 | ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); | 532 | ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); |
| 533 | if (ret < 0) | 533 | if (ret < 0) |
| 534 | return ret; | 534 | return ret; |
| 535 | } | 535 | } |
| @@ -542,7 +542,7 @@ static int query_formats(AVFilterContext *ctx) · 6 unmodified lines | |||
| 542 | ret = ff_add_channel_layout(&layouts, outlayout); | 542 | ret = ff_add_channel_layout(&layouts, outlayout); |
| 543 | if (ret < 0) | 543 | if (ret < 0) |
| 544 | return ret; | 544 | return ret; |
| 545 | ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); | 545 | ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); |
| 546 | if (ret < 0) | 546 | if (ret < 0) |
| 547 | return ret; | 547 | return ret; |
| 548 | } | 548 | } |
| @@ -266,7 +266,7 @@ static int query_formats(AVFilterContext *ctx) · 265 unmodified lines | |||
| 266 | 266 | ||
| 267 | // inlink supports any channel layout | 267 | // inlink supports any channel layout |
| 268 | layouts = ff_all_channel_counts(); | 268 | layouts = ff_all_channel_counts(); |
| 269 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 269 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 270 | return ret; | 270 | return ret; |
| 271 | 271 | ||
| 272 | // outlink supports only requested output channel layout | 272 | // outlink supports only requested output channel layout |
| @@ -275,7 +275,7 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 275 | pan->out_channel_layout ? pan->out_channel_layout : | 275 | pan->out_channel_layout ? pan->out_channel_layout : |
| 276 | FF_COUNT2LAYOUT(pan->nb_output_channels))) < 0) | 276 | FF_COUNT2LAYOUT(pan->nb_output_channels))) < 0) |
| 277 | return ret; | 277 | return ret; |
| 278 | return ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts); | 278 | return ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts); |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | static int config_props(AVFilterLink *link) | 281 | static int config_props(AVFilterLink *link) |
| @@ -102,12 +102,12 @@ static int query_formats(AVFilterContext *ctx) · 101 unmodified lines | |||
| 102 | !(out_layouts = ff_all_channel_layouts ( ))) | 102 | !(out_layouts = ff_all_channel_layouts ( ))) |
| 103 | return AVERROR(ENOMEM); | 103 | return AVERROR(ENOMEM); |
| 104 | 104 | ||
| 105 | if ((ret = ff_formats_ref (in_formats, &inlink->out_formats )) < 0 || | 105 | if ((ret = ff_formats_ref (in_formats, &inlink->outcfg.formats )) < 0 || |
| 106 | (ret = ff_formats_ref (out_formats, &outlink->in_formats )) < 0 || | 106 | (ret = ff_formats_ref (out_formats, &outlink->incfg.formats )) < 0 || |
| 107 | (ret = ff_formats_ref (in_samplerates, &inlink->out_samplerates )) < 0 || | 107 | (ret = ff_formats_ref (in_samplerates, &inlink->outcfg.samplerates )) < 0 || |
| 108 | (ret = ff_formats_ref (out_samplerates, &outlink->in_samplerates )) < 0 || | 108 | (ret = ff_formats_ref (out_samplerates, &outlink->incfg.samplerates )) < 0 || |
| 109 | (ret = ff_channel_layouts_ref (in_layouts, &inlink->out_channel_layouts)) < 0 || | 109 | (ret = ff_channel_layouts_ref (in_layouts, &inlink->outcfg.channel_layouts)) < 0 || |
| 110 | (ret = ff_channel_layouts_ref (out_layouts, &outlink->in_channel_layouts)) < 0) | 110 | (ret = ff_channel_layouts_ref (out_layouts, &outlink->incfg.channel_layouts)) < 0) |
| 111 | return ret; | 111 | return ret; |
| 112 | 112 | ||
| 113 | return 0; | 113 | return 0; |
| @@ -306,20 +306,20 @@ static int query_formats(AVFilterContext *ctx) · 305 unmodified lines | |||
| 306 | }; | 306 | }; |
| 307 | int ret, i; | 307 | int ret, i; |
| 308 | 308 | ||
| 309 | if (!ctx->inputs[0]->in_channel_layouts || | 309 | if (!ctx->inputs[0]->incfg.channel_layouts || |
| 310 | !ctx->inputs[0]->in_channel_layouts->nb_channel_layouts) { | 310 | !ctx->inputs[0]->incfg.channel_layouts->nb_channel_layouts) { |
| 311 | av_log(ctx, AV_LOG_WARNING, | 311 | av_log(ctx, AV_LOG_WARNING, |
| 312 | "No channel layout for input 1\n"); | 312 | "No channel layout for input 1\n"); |
| 313 | return AVERROR(EAGAIN); | 313 | return AVERROR(EAGAIN); |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | if ((ret = ff_add_channel_layout(&layouts, ctx->inputs[0]->in_channel_layouts->channel_layouts[0])) < 0 || | 316 | if ((ret = ff_add_channel_layout(&layouts, ctx->inputs[0]->incfg.channel_layouts->channel_layouts[0])) < 0 || |
| 317 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts)) < 0) | 317 | (ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts)) < 0) |
| 318 | return ret; | 318 | return ret; |
| 319 | 319 | ||
| 320 | for (i = 0; i < 2; i++) { | 320 | for (i = 0; i < 2; i++) { |
| 321 | layouts = ff_all_channel_counts(); | 321 | layouts = ff_all_channel_counts(); |
| 322 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->out_channel_layouts)) < 0) | 322 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->inputs[i]->outcfg.channel_layouts)) < 0) |
| 323 | return ret; | 323 | return ret; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| @@ -652,7 +652,7 @@ static int query_formats(AVFilterContext *ctx) · 651 unmodified lines | |||
| 652 | if (!layouts) | 652 | if (!layouts) |
| 653 | return AVERROR(ENOMEM); | 653 | return AVERROR(ENOMEM); |
| 654 | 654 | ||
| 655 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts); | 655 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->outcfg.channel_layouts); |
| 656 | if (ret) | 656 | if (ret) |
| 657 | return ret; | 657 | return ret; |
| 658 | 658 | ||
| @@ -661,7 +661,7 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 661 | if (ret) | 661 | if (ret) |
| 662 | return ret; | 662 | return ret; |
| 663 | 663 | ||
| 664 | ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts); | 664 | ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts); |
| 665 | if (ret) | 665 | if (ret) |
| 666 | return ret; | 666 | return ret; |
| 667 | 667 | ||
| @@ -175,7 +175,7 @@ static int query_formats(AVFilterContext *ctx) · 174 unmodified lines | |||
| 175 | if (ret) | 175 | if (ret) |
| 176 | return ret; | 176 | return ret; |
| 177 | 177 | ||
| 178 | ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->in_channel_layouts); | 178 | ret = ff_channel_layouts_ref(layouts, &ctx->outputs[0]->incfg.channel_layouts); |
| 179 | if (ret) | 179 | if (ret) |
| 180 | return ret; | 180 | return ret; |
| 181 | 181 | ||
| @@ -184,7 +184,7 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 184 | if (ret) | 184 | if (ret) |
| 185 | return ret; | 185 | return ret; |
| 186 | 186 | ||
| 187 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->out_channel_layouts); | 187 | ret = ff_channel_layouts_ref(layouts, &ctx->inputs[0]->outcfg.channel_layouts); |
| 188 | if (ret) | 188 | if (ret) |
| 189 | return ret; | 189 | return ret; |
| 190 | 190 | ||
| @@ -69,21 +69,21 @@ static int query_formats(AVFilterContext *ctx) · 68 unmodified lines | |||
| 69 | int ret; | 69 | int ret; |
| 70 | 70 | ||
| 71 | formats = ff_make_format_list(sample_fmts); | 71 | formats = ff_make_format_list(sample_fmts); |
| 72 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 72 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 73 | return ret; | 73 | return ret; |
| 74 | 74 | ||
| 75 | layouts = ff_all_channel_counts(); | 75 | layouts = ff_all_channel_counts(); |
| 76 | if (!layouts) | 76 | if (!layouts) |
| 77 | return AVERROR(ENOMEM); | 77 | return AVERROR(ENOMEM); |
| 78 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 78 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 79 | return ret; | 79 | return ret; |
| 80 | 80 | ||
| 81 | formats = ff_all_samplerates(); | 81 | formats = ff_all_samplerates(); |
| 82 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 82 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 83 | return ret; | 83 | return ret; |
| 84 | 84 | ||
| 85 | formats = ff_make_format_list(pix_fmts); | 85 | formats = ff_make_format_list(pix_fmts); |
| 86 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 86 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 87 | return ret; | 87 | return ret; |
| 88 | 88 | ||
| 89 | return 0; | 89 | return 0; |
| @@ -99,17 +99,17 @@ static int query_formats(AVFilterContext *ctx) · 98 unmodified lines | |||
| 99 | int ret = AVERROR(EINVAL); | 99 | int ret = AVERROR(EINVAL); |
| 100 | 100 | ||
| 101 | formats = ff_make_format_list(sample_fmts); | 101 | formats = ff_make_format_list(sample_fmts); |
| 102 | if ((ret = ff_formats_ref (formats, &inlink->out_formats )) < 0 || | 102 | if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || |
| 103 | (layouts = ff_all_channel_counts()) == NULL || | 103 | (layouts = ff_all_channel_counts()) == NULL || |
| 104 | (ret = ff_channel_layouts_ref (layouts, &inlink->out_channel_layouts)) < 0) | 104 | (ret = ff_channel_layouts_ref (layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 105 | return ret; | 105 | return ret; |
| 106 | 106 | ||
| 107 | formats = ff_all_samplerates(); | 107 | formats = ff_all_samplerates(); |
| 108 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 108 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 109 | return ret; | 109 | return ret; |
| 110 | 110 | ||
| 111 | formats = ff_make_format_list(pix_fmts); | 111 | formats = ff_make_format_list(pix_fmts); |
| 112 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 112 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 113 | return ret; | 113 | return ret; |
| 114 | 114 | ||
| 115 | return 0; | 115 | return 0; |
| @@ -76,23 +76,23 @@ static int query_formats(AVFilterContext *ctx) · 75 unmodified lines | |||
| 76 | int ret; | 76 | int ret; |
| 77 | 77 | ||
| 78 | formats = ff_make_format_list(sample_fmts); | 78 | formats = ff_make_format_list(sample_fmts); |
| 79 | if ((ret = ff_formats_ref (formats, &inlink->out_formats )) < 0 || | 79 | if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || |
| 80 | (ret = ff_formats_ref (formats, &outlink->in_formats )) < 0 || | 80 | (ret = ff_formats_ref (formats, &outlink->incfg.formats )) < 0 || |
| 81 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || | 81 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || |
| 82 | (ret = ff_channel_layouts_ref (layout , &inlink->out_channel_layouts)) < 0 || | 82 | (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0 || |
| 83 | (ret = ff_channel_layouts_ref (layout , &outlink->in_channel_layouts)) < 0) | 83 | (ret = ff_channel_layouts_ref (layout , &outlink->incfg.channel_layouts)) < 0) |
| 84 | return ret; | 84 | return ret; |
| 85 | 85 | ||
| 86 | formats = ff_all_samplerates(); | 86 | formats = ff_all_samplerates(); |
| 87 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0 || | 87 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 || |
| 88 | (ret = ff_formats_ref(formats, &outlink->in_samplerates)) < 0) | 88 | (ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) |
| 89 | return ret; | 89 | return ret; |
| 90 | 90 | ||
| 91 | if (s->do_video) { | 91 | if (s->do_video) { |
| 92 | AVFilterLink *outlink = ctx->outputs[1]; | 92 | AVFilterLink *outlink = ctx->outputs[1]; |
| 93 | 93 | ||
| 94 | formats = ff_make_format_list(pix_fmts); | 94 | formats = ff_make_format_list(pix_fmts); |
| 95 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 95 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 96 | return ret; | 96 | return ret; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -190,17 +190,17 @@ static int query_formats(AVFilterContext *ctx) · 189 unmodified lines | |||
| 190 | int ret; | 190 | int ret; |
| 191 | 191 | ||
| 192 | formats = ff_make_format_list(sample_fmts); | 192 | formats = ff_make_format_list(sample_fmts); |
| 193 | if ((ret = ff_formats_ref (formats, &inlink->out_formats )) < 0 || | 193 | if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || |
| 194 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || | 194 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || |
| 195 | (ret = ff_channel_layouts_ref (layout , &inlink->out_channel_layouts)) < 0) | 195 | (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0) |
| 196 | return ret; | 196 | return ret; |
| 197 | 197 | ||
| 198 | formats = ff_all_samplerates(); | 198 | formats = ff_all_samplerates(); |
| 199 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 199 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 200 | return ret; | 200 | return ret; |
| 201 | 201 | ||
| 202 | formats = ff_make_format_list(pix_fmts); | 202 | formats = ff_make_format_list(pix_fmts); |
| 203 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 203 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 204 | return ret; | 204 | return ret; |
| 205 | 205 | ||
| 206 | return 0; | 206 | return 0; |
| @@ -87,25 +87,25 @@ static int query_formats(AVFilterContext *ctx) · 86 unmodified lines | |||
| 87 | 87 | ||
| 88 | /* Set the output formats */ | 88 | /* Set the output formats */ |
| 89 | formats = ff_all_formats(type); | 89 | formats = ff_all_formats(type); |
| 90 | if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->in_formats)) < 0) | 90 | if ((ret = ff_formats_ref(formats, &ctx->outputs[idx]->incfg.formats)) < 0) |
| 91 | return ret; | 91 | return ret; |
| 92 | 92 | ||
| 93 | if (type == AVMEDIA_TYPE_AUDIO) { | 93 | if (type == AVMEDIA_TYPE_AUDIO) { |
| 94 | rates = ff_all_samplerates(); | 94 | rates = ff_all_samplerates(); |
| 95 | if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->in_samplerates)) < 0) | 95 | if ((ret = ff_formats_ref(rates, &ctx->outputs[idx]->incfg.samplerates)) < 0) |
| 96 | return ret; | 96 | return ret; |
| 97 | layouts = ff_all_channel_layouts(); | 97 | layouts = ff_all_channel_layouts(); |
| 98 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->in_channel_layouts)) < 0) | 98 | if ((ret = ff_channel_layouts_ref(layouts, &ctx->outputs[idx]->incfg.channel_layouts)) < 0) |
| 99 | return ret; | 99 | return ret; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | /* Set the same formats for each corresponding input */ | 102 | /* Set the same formats for each corresponding input */ |
| 103 | for (seg = 0; seg < cat->nb_segments; seg++) { | 103 | for (seg = 0; seg < cat->nb_segments; seg++) { |
| 104 | if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->out_formats)) < 0) | 104 | if ((ret = ff_formats_ref(formats, &ctx->inputs[idx]->outcfg.formats)) < 0) |
| 105 | return ret; | 105 | return ret; |
| 106 | if (type == AVMEDIA_TYPE_AUDIO) { | 106 | if (type == AVMEDIA_TYPE_AUDIO) { |
| 107 | if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->out_samplerates)) < 0 || | 107 | if ((ret = ff_formats_ref(rates, &ctx->inputs[idx]->outcfg.samplerates)) < 0 || |
| 108 | (ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->out_channel_layouts)) < 0) | 108 | (ret = ff_channel_layouts_ref(layouts, &ctx->inputs[idx]->outcfg.channel_layouts)) < 0) |
| 109 | return ret; | 109 | return ret; |
| 110 | } | 110 | } |
| 111 | idx += ctx->nb_outputs; | 111 | idx += ctx->nb_outputs; |
| @@ -1331,20 +1331,20 @@ static int query_formats(AVFilterContext *ctx) · 1330 unmodified lines | |||
| 1331 | 1331 | ||
| 1332 | /* set input audio formats */ | 1332 | /* set input audio formats */ |
| 1333 | formats = ff_make_format_list(sample_fmts); | 1333 | formats = ff_make_format_list(sample_fmts); |
| 1334 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 1334 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 1335 | return ret; | 1335 | return ret; |
| 1336 | 1336 | ||
| 1337 | layouts = ff_make_format64_list(channel_layouts); | 1337 | layouts = ff_make_format64_list(channel_layouts); |
| 1338 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 1338 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 1339 | return ret; | 1339 | return ret; |
| 1340 | 1340 | ||
| 1341 | formats = ff_all_samplerates(); | 1341 | formats = ff_all_samplerates(); |
| 1342 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 1342 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 1343 | return ret; | 1343 | return ret; |
| 1344 | 1344 | ||
| 1345 | /* set output video format */ | 1345 | /* set output video format */ |
| 1346 | formats = ff_make_format_list(pix_fmts); | 1346 | formats = ff_make_format_list(pix_fmts); |
| 1347 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 1347 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 1348 | return ret; | 1348 | return ret; |
| 1349 | 1349 | ||
| 1350 | return 0; | 1350 | return 0; |
| @@ -132,20 +132,20 @@ static int query_formats(AVFilterContext *ctx) · 131 unmodified lines | |||
| 132 | 132 | ||
| 133 | /* set input audio formats */ | 133 | /* set input audio formats */ |
| 134 | formats = ff_make_format_list(sample_fmts); | 134 | formats = ff_make_format_list(sample_fmts); |
| 135 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 135 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 136 | return ret; | 136 | return ret; |
| 137 | 137 | ||
| 138 | layouts = ff_all_channel_layouts(); | 138 | layouts = ff_all_channel_layouts(); |
| 139 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 139 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 140 | return ret; | 140 | return ret; |
| 141 | 141 | ||
| 142 | formats = ff_all_samplerates(); | 142 | formats = ff_all_samplerates(); |
| 143 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 143 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 144 | return ret; | 144 | return ret; |
| 145 | 145 | ||
| 146 | /* set output video format */ | 146 | /* set output video format */ |
| 147 | formats = ff_make_format_list(pix_fmts); | 147 | formats = ff_make_format_list(pix_fmts); |
| 148 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 148 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 149 | return ret; | 149 | return ret; |
| 150 | 150 | ||
| 151 | return 0; | 151 | return 0; |
| @@ -114,17 +114,17 @@ static int query_formats(AVFilterContext *ctx) · 113 unmodified lines | |||
| 114 | int ret; | 114 | int ret; |
| 115 | 115 | ||
| 116 | formats = ff_make_format_list(sample_fmts); | 116 | formats = ff_make_format_list(sample_fmts); |
| 117 | if ((ret = ff_formats_ref (formats, &inlink->out_formats )) < 0 || | 117 | if ((ret = ff_formats_ref (formats, &inlink->outcfg.formats )) < 0 || |
| 118 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || | 118 | (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 || |
| 119 | (ret = ff_channel_layouts_ref (layout , &inlink->out_channel_layouts)) < 0) | 119 | (ret = ff_channel_layouts_ref (layout , &inlink->outcfg.channel_layouts)) < 0) |
| 120 | return ret; | 120 | return ret; |
| 121 | 121 | ||
| 122 | formats = ff_all_samplerates(); | 122 | formats = ff_all_samplerates(); |
| 123 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 123 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 124 | return ret; | 124 | return ret; |
| 125 | 125 | ||
| 126 | formats = ff_make_format_list(pix_fmts); | 126 | formats = ff_make_format_list(pix_fmts); |
| 127 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 127 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 128 | return ret; | 128 | return ret; |
| 129 | 129 | ||
| 130 | return 0; | 130 | return 0; |
| @@ -355,20 +355,20 @@ static int query_formats(AVFilterContext *ctx) · 354 unmodified lines | |||
| 355 | 355 | ||
| 356 | /* set input audio formats */ | 356 | /* set input audio formats */ |
| 357 | formats = ff_make_format_list(sample_fmts); | 357 | formats = ff_make_format_list(sample_fmts); |
| 358 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 358 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 359 | return ret; | 359 | return ret; |
| 360 | 360 | ||
| 361 | layouts = ff_all_channel_layouts(); | 361 | layouts = ff_all_channel_layouts(); |
| 362 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 362 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 363 | return ret; | 363 | return ret; |
| 364 | 364 | ||
| 365 | formats = ff_all_samplerates(); | 365 | formats = ff_all_samplerates(); |
| 366 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 366 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 367 | return ret; | 367 | return ret; |
| 368 | 368 | ||
| 369 | /* set output video format */ | 369 | /* set output video format */ |
| 370 | formats = ff_make_format_list(pix_fmts); | 370 | formats = ff_make_format_list(pix_fmts); |
| 371 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 371 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 372 | return ret; | 372 | return ret; |
| 373 | 373 | ||
| 374 | return 0; | 374 | return 0; |
| @@ -125,19 +125,19 @@ static int query_formats(AVFilterContext *ctx) · 124 unmodified lines | |||
| 125 | int ret; | 125 | int ret; |
| 126 | 126 | ||
| 127 | formats = ff_make_format_list(sample_fmts); | 127 | formats = ff_make_format_list(sample_fmts); |
| 128 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 128 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 129 | return ret; | 129 | return ret; |
| 130 | 130 | ||
| 131 | layouts = ff_all_channel_counts(); | 131 | layouts = ff_all_channel_counts(); |
| 132 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 132 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 133 | return ret; | 133 | return ret; |
| 134 | 134 | ||
| 135 | formats = ff_all_samplerates(); | 135 | formats = ff_all_samplerates(); |
| 136 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 136 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 137 | return ret; | 137 | return ret; |
| 138 | 138 | ||
| 139 | formats = ff_make_format_list(pix_fmts); | 139 | formats = ff_make_format_list(pix_fmts); |
| 140 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 140 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 141 | return ret; | 141 | return ret; |
| 142 | 142 | ||
| 143 | return 0; | 143 | return 0; |
| @@ -161,20 +161,20 @@ static int query_formats(AVFilterContext *ctx) · 160 unmodified lines | |||
| 161 | 161 | ||
| 162 | /* set input audio formats */ | 162 | /* set input audio formats */ |
| 163 | formats = ff_make_format_list(sample_fmts); | 163 | formats = ff_make_format_list(sample_fmts); |
| 164 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0) | 164 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0) |
| 165 | return ret; | 165 | return ret; |
| 166 | 166 | ||
| 167 | layouts = ff_all_channel_layouts(); | 167 | layouts = ff_all_channel_layouts(); |
| 168 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0) | 168 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0) |
| 169 | return ret; | 169 | return ret; |
| 170 | 170 | ||
| 171 | formats = ff_all_samplerates(); | 171 | formats = ff_all_samplerates(); |
| 172 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0) | 172 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0) |
| 173 | return ret; | 173 | return ret; |
| 174 | 174 | ||
| 175 | /* set output video format */ | 175 | /* set output video format */ |
| 176 | formats = ff_make_format_list(pix_fmts); | 176 | formats = ff_make_format_list(pix_fmts); |
| 177 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 177 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 178 | return ret; | 178 | return ret; |
| 179 | 179 | ||
| 180 | return 0; | 180 | return 0; |
| @@ -261,15 +261,15 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, · 260 unmodified lines | |||
| 261 | 261 | ||
| 262 | /* if any information on supported media formats already exists on the | 262 | /* if any information on supported media formats already exists on the |
| 263 | * link, we need to preserve that */ | 263 | * link, we need to preserve that */ |
| 264 | if (link->out_formats) | 264 | if (link->outcfg.formats) |
| 265 | ff_formats_changeref(&link->out_formats, | 265 | ff_formats_changeref(&link->outcfg.formats, |
| 266 | &filt->outputs[filt_dstpad_idx]->out_formats); | 266 | &filt->outputs[filt_dstpad_idx]->outcfg.formats); |
| 267 | if (link->out_samplerates) | 267 | if (link->outcfg.samplerates) |
| 268 | ff_formats_changeref(&link->out_samplerates, | 268 | ff_formats_changeref(&link->outcfg.samplerates, |
| 269 | &filt->outputs[filt_dstpad_idx]->out_samplerates); | 269 | &filt->outputs[filt_dstpad_idx]->outcfg.samplerates); |
| 270 | if (link->out_channel_layouts) | 270 | if (link->outcfg.channel_layouts) |
| 271 | ff_channel_layouts_changeref(&link->out_channel_layouts, | 271 | ff_channel_layouts_changeref(&link->outcfg.channel_layouts, |
| 272 | &filt->outputs[filt_dstpad_idx]->out_channel_layouts); | 272 | &filt->outputs[filt_dstpad_idx]->outcfg.channel_layouts); |
| 273 | 273 | ||
| 274 | return 0; | 274 | return 0; |
| 275 | } | 275 | } |
| @@ -746,12 +746,12 @@ static void free_link(AVFilterLink *link) · 470 unmodified lines | |||
| 746 | 746 | ||
| 747 | av_buffer_unref(&link->hw_frames_ctx); | 747 | av_buffer_unref(&link->hw_frames_ctx); |
| 748 | 748 | ||
| 749 | ff_formats_unref(&link->in_formats); | 749 | ff_formats_unref(&link->incfg.formats); |
| 750 | ff_formats_unref(&link->out_formats); | 750 | ff_formats_unref(&link->outcfg.formats); |
| 751 | ff_formats_unref(&link->in_samplerates); | 751 | ff_formats_unref(&link->incfg.samplerates); |
| 752 | ff_formats_unref(&link->out_samplerates); | 752 | ff_formats_unref(&link->outcfg.samplerates); |
| 753 | ff_channel_layouts_unref(&link->in_channel_layouts); | 753 | ff_channel_layouts_unref(&link->incfg.channel_layouts); |
| 754 | ff_channel_layouts_unref(&link->out_channel_layouts); | 754 | ff_channel_layouts_unref(&link->outcfg.channel_layouts); |
| 755 | avfilter_link_free(&link); | 755 | avfilter_link_free(&link); |
| 756 | } | 756 | } |
| 757 | 757 | ||
| @@ -68,6 +68,7 @@ typedef struct AVFilterContext AVFilterContext; · 67 unmodified lines | |||
| 68 | typedef struct AVFilterLink AVFilterLink; | 68 | typedef struct AVFilterLink AVFilterLink; |
| 69 | typedef struct AVFilterPad AVFilterPad; | 69 | typedef struct AVFilterPad AVFilterPad; |
| 70 | typedef struct AVFilterFormats AVFilterFormats; | 70 | typedef struct AVFilterFormats AVFilterFormats; |
| 71 | typedef struct AVFilterChannelLayouts AVFilterChannelLayouts; | ||
| 71 | 72 | ||
| 72 | /** | 73 | /** |
| 73 | * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. | 74 | * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. |
| @@ -264,13 +265,13 @@ typedef struct AVFilter { · 190 unmodified lines | |||
| 264 | * and outputs are fixed), shortly before the format negotiation. This | 265 | * and outputs are fixed), shortly before the format negotiation. This |
| 265 | * callback may be called more than once. | 266 | * callback may be called more than once. |
| 266 | * | 267 | * |
| 267 | * This callback must set AVFilterLink.out_formats on every input link and | 268 | * This callback must set AVFilterLink.outcfg.formats on every input link and |
| 268 | * AVFilterLink.in_formats on every output link to a list of pixel/sample | 269 | * AVFilterLink.incfg.formats on every output link to a list of pixel/sample |
| 269 | * formats that the filter supports on that link. For audio links, this | 270 | * formats that the filter supports on that link. For audio links, this |
| 270 | * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" / | 271 | * filter must also set @ref AVFilterLink.incfg.samplerates "in_samplerates" / |
| 271 | * @ref AVFilterLink.out_samplerates "out_samplerates" and | 272 | * @ref AVFilterLink.outcfg.samplerates "out_samplerates" and |
| 272 | * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" / | 273 | * @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" / |
| 273 | * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously. | 274 | * @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously. |
| 274 | * | 275 | * |
| 275 | * This callback may be NULL for filters with one input, in which case | 276 | * This callback may be NULL for filters with one input, in which case |
| 276 | * libavfilter assumes that it supports all input formats and preserves | 277 | * libavfilter assumes that it supports all input formats and preserves |
| @@ -424,6 +425,35 @@ struct AVFilterContext { · 147 unmodified lines | |||
| 424 | int extra_hw_frames; | 425 | int extra_hw_frames; |
| 425 | }; | 426 | }; |
| 426 | 427 | ||
| 428 | /** | ||
| 429 | * Lists of formats / etc. supported by an end of a link. | ||
| 430 | * | ||
| 431 | * This structure is directly part of AVFilterLink, in two copies: | ||
| 432 | * one for the source filter, one for the destination filter. | ||
| 433 | |||
| 434 | * These lists are used for negotiating the format to actually be used, | ||
| 435 | * which will be loaded into the format and channel_layout members of | ||
| 436 | * AVFilterLink, when chosen. | ||
| 437 | */ | ||
| 438 | typedef struct AVFilterFormatsConfig { | ||
| 439 | |||
| 440 | /** | ||
| 441 | * List of supported formats (pixel or sample). | ||
| 442 | */ | ||
| 443 | AVFilterFormats *formats; | ||
| 444 | |||
| 445 | /** | ||
| 446 | * Lists of supported sample rates, only for audio. | ||
| 447 | */ | ||
| 448 | AVFilterFormats *samplerates; | ||
| 449 | |||
| 450 | /** | ||
| 451 | * Lists of supported channel layouts, only for audio. | ||
| 452 | */ | ||
| 453 | AVFilterChannelLayouts *channel_layouts; | ||
| 454 | |||
| 455 | } AVFilterFormatsConfig; | ||
| 456 | |||
| 427 | /** | 457 | /** |
| 428 | * A link between two filters. This contains pointers to the source and | 458 | * A link between two filters. This contains pointers to the source and |
| 429 | * destination filters between which this link exists, and the indexes of | 459 | * destination filters between which this link exists, and the indexes of |
| @@ -471,24 +501,16 @@ struct AVFilterLink { · 41 unmodified lines | |||
| 471 | * New public fields should be added right above. | 501 | * New public fields should be added right above. |
| 472 | ***************************************************************** | 502 | ***************************************************************** |
| 473 | */ | 503 | */ |
| 504 | |||
| 474 | /** | 505 | /** |
| 475 | * Lists of formats and channel layouts supported by the input and output | 506 | * Lists of supported formats / etc. supported by the input filter. |
| 476 | * filters respectively. These lists are used for negotiating the format | ||
| 477 | * to actually be used, which will be loaded into the format and | ||
| 478 | * channel_layout members, above, when chosen. | ||
| 479 | * | ||
| 480 | */ | 507 | */ |
| 481 | AVFilterFormats *in_formats; | 508 | AVFilterFormatsConfig incfg; |
| 482 | AVFilterFormats *out_formats; | ||
| 483 | 509 | ||
| 484 | /** | 510 | /** |
| 485 | * Lists of channel layouts and sample rates used for automatic | 511 | * Lists of supported formats / etc. supported by the output filter. |
| 486 | * negotiation. | ||
| 487 | */ | 512 | */ |
| 488 | AVFilterFormats *in_samplerates; | 513 | AVFilterFormatsConfig outcfg; |
| 489 | AVFilterFormats *out_samplerates; | ||
| 490 | struct AVFilterChannelLayouts *in_channel_layouts; | ||
| 491 | struct AVFilterChannelLayouts *out_channel_layouts; | ||
| 492 | 514 | ||
| 493 | /** stage of the initialization of the link properties (dimensions, etc) */ | 515 | /** stage of the initialization of the link properties (dimensions, etc) */ |
| 494 | enum { | 516 | enum { |
| @@ -331,9 +331,9 @@ static int filter_query_formats(AVFilterContext *ctx) · 330 unmodified lines | |||
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | for (i = 0; i < ctx->nb_inputs; i++) | 333 | for (i = 0; i < ctx->nb_inputs; i++) |
| 334 | sanitize_channel_layouts(ctx, ctx->inputs[i]->out_channel_layouts); | 334 | sanitize_channel_layouts(ctx, ctx->inputs[i]->outcfg.channel_layouts); |
| 335 | for (i = 0; i < ctx->nb_outputs; i++) | 335 | for (i = 0; i < ctx->nb_outputs; i++) |
| 336 | sanitize_channel_layouts(ctx, ctx->outputs[i]->in_channel_layouts); | 336 | sanitize_channel_layouts(ctx, ctx->outputs[i]->incfg.channel_layouts); |
| 337 | 337 | ||
| 338 | formats = ff_all_formats(type); | 338 | formats = ff_all_formats(type); |
| 339 | if ((ret = ff_set_common_formats(ctx, formats)) < 0) | 339 | if ((ret = ff_set_common_formats(ctx, formats)) < 0) |
| @@ -354,19 +354,19 @@ static int formats_declared(AVFilterContext *f) · 14 unmodified lines | |||
| 354 | int i; | 354 | int i; |
| 355 | 355 | ||
| 356 | for (i = 0; i < f->nb_inputs; i++) { | 356 | for (i = 0; i < f->nb_inputs; i++) { |
| 357 | if (!f->inputs[i]->out_formats) | 357 | if (!f->inputs[i]->outcfg.formats) |
| 358 | return 0; | 358 | return 0; |
| 359 | if (f->inputs[i]->type == AVMEDIA_TYPE_AUDIO && | 359 | if (f->inputs[i]->type == AVMEDIA_TYPE_AUDIO && |
| 360 | !(f->inputs[i]->out_samplerates && | 360 | !(f->inputs[i]->outcfg.samplerates && |
| 361 | f->inputs[i]->out_channel_layouts)) | 361 | f->inputs[i]->outcfg.channel_layouts)) |
| 362 | return 0; | 362 | return 0; |
| 363 | } | 363 | } |
| 364 | for (i = 0; i < f->nb_outputs; i++) { | 364 | for (i = 0; i < f->nb_outputs; i++) { |
| 365 | if (!f->outputs[i]->in_formats) | 365 | if (!f->outputs[i]->incfg.formats) |
| 366 | return 0; | 366 | return 0; |
| 367 | if (f->outputs[i]->type == AVMEDIA_TYPE_AUDIO && | 367 | if (f->outputs[i]->type == AVMEDIA_TYPE_AUDIO && |
| 368 | !(f->outputs[i]->in_samplerates && | 368 | !(f->outputs[i]->incfg.samplerates && |
| 369 | f->outputs[i]->in_channel_layouts)) | 369 | f->outputs[i]->incfg.channel_layouts)) |
| 370 | return 0; | 370 | return 0; |
| 371 | } | 371 | } |
| 372 | return 1; | 372 | return 1; |
| @@ -416,24 +416,24 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 43 unmodified lines | |||
| 416 | if (!link) | 416 | if (!link) |
| 417 | continue; | 417 | continue; |
| 418 | 418 | ||
| 419 | if (link->in_formats != link->out_formats | 419 | if (link->incfg.formats != link->outcfg.formats |
| 420 | && link->in_formats && link->out_formats) | 420 | && link->incfg.formats && link->outcfg.formats) |
| 421 | if (!ff_can_merge_formats(link->in_formats, link->out_formats, | 421 | if (!ff_can_merge_formats(link->incfg.formats, link->outcfg.formats, |
| 422 | link->type)) | 422 | link->type)) |
| 423 | convert_needed = 1; | 423 | convert_needed = 1; |
| 424 | if (link->type == AVMEDIA_TYPE_AUDIO) { | 424 | if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 425 | if (link->in_samplerates != link->out_samplerates | 425 | if (link->incfg.samplerates != link->outcfg.samplerates |
| 426 | && link->in_samplerates && link->out_samplerates) | 426 | && link->incfg.samplerates && link->outcfg.samplerates) |
| 427 | if (!ff_can_merge_samplerates(link->in_samplerates, | 427 | if (!ff_can_merge_samplerates(link->incfg.samplerates, |
| 428 | link->out_samplerates)) | 428 | link->outcfg.samplerates)) |
| 429 | convert_needed = 1; | 429 | convert_needed = 1; |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | #define CHECKED_MERGE(field, ...) ((ret = ff_merge_ ## field(__VA_ARGS__)) <= 0) | 432 | #define CHECKED_MERGE(field, ...) ((ret = ff_merge_ ## field(__VA_ARGS__)) <= 0) |
| 433 | #define MERGE_DISPATCH(field, ...) \ | 433 | #define MERGE_DISPATCH(field, ...) \ |
| 434 | if (!(link->in_ ## field && link->out_ ## field)) { \ | 434 | if (!(link->incfg.field && link->outcfg.field)) { \ |
| 435 | count_delayed++; \ | 435 | count_delayed++; \ |
| 436 | } else if (link->in_ ## field == link->out_ ## field) { \ | 436 | } else if (link->incfg.field == link->outcfg.field) { \ |
| 437 | count_already_merged++; \ | 437 | count_already_merged++; \ |
| 438 | } else if (!convert_needed) { \ | 438 | } else if (!convert_needed) { \ |
| 439 | count_merged++; \ | 439 | count_merged++; \ |
| @@ -445,13 +445,13 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 5 unmodified lines | |||
| 445 | } | 445 | } |
| 446 | 446 | ||
| 447 | if (link->type == AVMEDIA_TYPE_AUDIO) { | 447 | if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 448 | MERGE_DISPATCH(channel_layouts, link->in_channel_layouts, | 448 | MERGE_DISPATCH(channel_layouts, link->incfg.channel_layouts, |
| 449 | link->out_channel_layouts) | 449 | link->outcfg.channel_layouts) |
| 450 | MERGE_DISPATCH(samplerates, link->in_samplerates, | 450 | MERGE_DISPATCH(samplerates, link->incfg.samplerates, |
| 451 | link->out_samplerates) | 451 | link->outcfg.samplerates) |
| 452 | } | 452 | } |
| 453 | MERGE_DISPATCH(formats, link->in_formats, | 453 | MERGE_DISPATCH(formats, link->incfg.formats, |
| 454 | link->out_formats, link->type) | 454 | link->outcfg.formats, link->type) |
| 455 | #undef MERGE_DISPATCH | 455 | #undef MERGE_DISPATCH |
| 456 | 456 | ||
| 457 | if (convert_needed) { | 457 | if (convert_needed) { |
| @@ -511,34 +511,34 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 53 unmodified lines | |||
| 511 | 511 | ||
| 512 | inlink = convert->inputs[0]; | 512 | inlink = convert->inputs[0]; |
| 513 | outlink = convert->outputs[0]; | 513 | outlink = convert->outputs[0]; |
| 514 | av_assert0( inlink-> in_formats->refcount > 0); | 514 | av_assert0( inlink->incfg.formats->refcount > 0); |
| 515 | av_assert0( inlink->out_formats->refcount > 0); | 515 | av_assert0( inlink->outcfg.formats->refcount > 0); |
| 516 | av_assert0(outlink-> in_formats->refcount > 0); | 516 | av_assert0(outlink->incfg.formats->refcount > 0); |
| 517 | av_assert0(outlink->out_formats->refcount > 0); | 517 | av_assert0(outlink->outcfg.formats->refcount > 0); |
| 518 | if (outlink->type == AVMEDIA_TYPE_AUDIO) { | 518 | if (outlink->type == AVMEDIA_TYPE_AUDIO) { |
| 519 | av_assert0( inlink-> in_samplerates->refcount > 0); | 519 | av_assert0( inlink-> incfg.samplerates->refcount > 0); |
| 520 | av_assert0( inlink->out_samplerates->refcount > 0); | 520 | av_assert0( inlink->outcfg.samplerates->refcount > 0); |
| 521 | av_assert0(outlink-> in_samplerates->refcount > 0); | 521 | av_assert0(outlink-> incfg.samplerates->refcount > 0); |
| 522 | av_assert0(outlink->out_samplerates->refcount > 0); | 522 | av_assert0(outlink->outcfg.samplerates->refcount > 0); |
| 523 | av_assert0( inlink-> in_channel_layouts->refcount > 0); | 523 | av_assert0( inlink-> incfg.channel_layouts->refcount > 0); |
| 524 | av_assert0( inlink->out_channel_layouts->refcount > 0); | 524 | av_assert0( inlink->outcfg.channel_layouts->refcount > 0); |
| 525 | av_assert0(outlink-> in_channel_layouts->refcount > 0); | 525 | av_assert0(outlink-> incfg.channel_layouts->refcount > 0); |
| 526 | av_assert0(outlink->out_channel_layouts->refcount > 0); | 526 | av_assert0(outlink->outcfg.channel_layouts->refcount > 0); |
| 527 | } | 527 | } |
| 528 | if (CHECKED_MERGE(formats, inlink->in_formats, | 528 | if (CHECKED_MERGE(formats, inlink->incfg.formats, |
| 529 | inlink->out_formats, inlink->type) || | 529 | inlink->outcfg.formats, inlink->type) || |
| 530 | CHECKED_MERGE(formats, outlink->in_formats, | 530 | CHECKED_MERGE(formats, outlink->incfg.formats, |
| 531 | outlink->out_formats, outlink->type) || | 531 | outlink->outcfg.formats, outlink->type) || |
| 532 | inlink->type == AVMEDIA_TYPE_AUDIO && | 532 | inlink->type == AVMEDIA_TYPE_AUDIO && |
| 533 | (CHECKED_MERGE(samplerates, inlink->in_samplerates, | 533 | (CHECKED_MERGE(samplerates, inlink->incfg.samplerates, |
| 534 | inlink->out_samplerates) || | 534 | inlink->outcfg.samplerates) || |
| 535 | CHECKED_MERGE(channel_layouts, inlink->in_channel_layouts, | 535 | CHECKED_MERGE(channel_layouts, inlink->incfg.channel_layouts, |
| 536 | inlink->out_channel_layouts)) || | 536 | inlink->outcfg.channel_layouts)) || |
| 537 | outlink->type == AVMEDIA_TYPE_AUDIO && | 537 | outlink->type == AVMEDIA_TYPE_AUDIO && |
| 538 | (CHECKED_MERGE(samplerates, outlink->in_samplerates, | 538 | (CHECKED_MERGE(samplerates, outlink->incfg.samplerates, |
| 539 | outlink->out_samplerates) || | 539 | outlink->outcfg.samplerates) || |
| 540 | CHECKED_MERGE(channel_layouts, outlink->in_channel_layouts, | 540 | CHECKED_MERGE(channel_layouts, outlink->incfg.channel_layouts, |
| 541 | outlink->out_channel_layouts))) { | 541 | outlink->outcfg.channel_layouts))) { |
| 542 | if (ret < 0) | 542 | if (ret < 0) |
| 543 | return ret; | 543 | return ret; |
| 544 | av_log(log_ctx, AV_LOG_ERROR, | 544 | av_log(log_ctx, AV_LOG_ERROR, |
| @@ -613,7 +613,7 @@ static enum AVSampleFormat find_best_sample_fmt_of_2(enum AVSampleFormat dst_fmt · 68 unmodified lines | |||
| 613 | 613 | ||
| 614 | static int pick_format(AVFilterLink *link, AVFilterLink *ref) | 614 | static int pick_format(AVFilterLink *link, AVFilterLink *ref) |
| 615 | { | 615 | { |
| 616 | if (!link || !link->in_formats) | 616 | if (!link || !link->incfg.formats) |
| 617 | return 0; | 617 | return 0; |
| 618 | 618 | ||
| 619 | if (link->type == AVMEDIA_TYPE_VIDEO) { | 619 | if (link->type == AVMEDIA_TYPE_VIDEO) { |
| @@ -622,67 +622,67 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 2 unmodified lines | |||
| 622 | int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; | 622 | int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; |
| 623 | enum AVPixelFormat best= AV_PIX_FMT_NONE; | 623 | enum AVPixelFormat best= AV_PIX_FMT_NONE; |
| 624 | int i; | 624 | int i; |
| 625 | for (i=0; i<link->in_formats->nb_formats; i++) { | 625 | for (i = 0; i < link->incfg.formats->nb_formats; i++) { |
| 626 | enum AVPixelFormat p = link->in_formats->formats[i]; | 626 | enum AVPixelFormat p = link->incfg.formats->formats[i]; |
| 627 | best= av_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL); | 627 | best= av_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL); |
| 628 | } | 628 | } |
| 629 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n", | 629 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n", |
| 630 | av_get_pix_fmt_name(best), link->in_formats->nb_formats, | 630 | av_get_pix_fmt_name(best), link->incfg.formats->nb_formats, |
| 631 | av_get_pix_fmt_name(ref->format), has_alpha); | 631 | av_get_pix_fmt_name(ref->format), has_alpha); |
| 632 | link->in_formats->formats[0] = best; | 632 | link->incfg.formats->formats[0] = best; |
| 633 | } | 633 | } |
| 634 | } else if (link->type == AVMEDIA_TYPE_AUDIO) { | 634 | } else if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 635 | if(ref && ref->type == AVMEDIA_TYPE_AUDIO){ | 635 | if(ref && ref->type == AVMEDIA_TYPE_AUDIO){ |
| 636 | enum AVSampleFormat best= AV_SAMPLE_FMT_NONE; | 636 | enum AVSampleFormat best= AV_SAMPLE_FMT_NONE; |
| 637 | int i; | 637 | int i; |
| 638 | for (i=0; i<link->in_formats->nb_formats; i++) { | 638 | for (i = 0; i < link->incfg.formats->nb_formats; i++) { |
| 639 | enum AVSampleFormat p = link->in_formats->formats[i]; | 639 | enum AVSampleFormat p = link->incfg.formats->formats[i]; |
| 640 | best = find_best_sample_fmt_of_2(best, p, ref->format); | 640 | best = find_best_sample_fmt_of_2(best, p, ref->format); |
| 641 | } | 641 | } |
| 642 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s\n", | 642 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s\n", |
| 643 | av_get_sample_fmt_name(best), link->in_formats->nb_formats, | 643 | av_get_sample_fmt_name(best), link->incfg.formats->nb_formats, |
| 644 | av_get_sample_fmt_name(ref->format)); | 644 | av_get_sample_fmt_name(ref->format)); |
| 645 | link->in_formats->formats[0] = best; | 645 | link->incfg.formats->formats[0] = best; |
| 646 | } | 646 | } |
| 647 | } | 647 | } |
| 648 | 648 | ||
| 649 | link->in_formats->nb_formats = 1; | 649 | link->incfg.formats->nb_formats = 1; |
| 650 | link->format = link->in_formats->formats[0]; | 650 | link->format = link->incfg.formats->formats[0]; |
| 651 | 651 | ||
| 652 | if (link->type == AVMEDIA_TYPE_AUDIO) { | 652 | if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 653 | if (!link->in_samplerates->nb_formats) { | 653 | if (!link->incfg.samplerates->nb_formats) { |
| 654 | av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for" | 654 | av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for" |
| 655 | " the link between filters %s and %s.\n", link->src->name, | 655 | " the link between filters %s and %s.\n", link->src->name, |
| 656 | link->dst->name); | 656 | link->dst->name); |
| 657 | return AVERROR(EINVAL); | 657 | return AVERROR(EINVAL); |
| 658 | } | 658 | } |
| 659 | link->in_samplerates->nb_formats = 1; | 659 | link->incfg.samplerates->nb_formats = 1; |
| 660 | link->sample_rate = link->in_samplerates->formats[0]; | 660 | link->sample_rate = link->incfg.samplerates->formats[0]; |
| 661 | 661 | ||
| 662 | if (link->in_channel_layouts->all_layouts) { | 662 | if (link->incfg.channel_layouts->all_layouts) { |
| 663 | av_log(link->src, AV_LOG_ERROR, "Cannot select channel layout for" | 663 | av_log(link->src, AV_LOG_ERROR, "Cannot select channel layout for" |
| 664 | " the link between filters %s and %s.\n", link->src->name, | 664 | " the link between filters %s and %s.\n", link->src->name, |
| 665 | link->dst->name); | 665 | link->dst->name); |
| 666 | if (!link->in_channel_layouts->all_counts) | 666 | if (!link->incfg.channel_layouts->all_counts) |
| 667 | av_log(link->src, AV_LOG_ERROR, "Unknown channel layouts not " | 667 | av_log(link->src, AV_LOG_ERROR, "Unknown channel layouts not " |
| 668 | "supported, try specifying a channel layout using " | 668 | "supported, try specifying a channel layout using " |
| 669 | "'aformat=channel_layouts=something'.\n"); | 669 | "'aformat=channel_layouts=something'.\n"); |
| 670 | return AVERROR(EINVAL); | 670 | return AVERROR(EINVAL); |
| 671 | } | 671 | } |
| 672 | link->in_channel_layouts->nb_channel_layouts = 1; | 672 | link->incfg.channel_layouts->nb_channel_layouts = 1; |
| 673 | link->channel_layout = link->in_channel_layouts->channel_layouts[0]; | 673 | link->channel_layout = link->incfg.channel_layouts->channel_layouts[0]; |
| 674 | if ((link->channels = FF_LAYOUT2COUNT(link->channel_layout))) | 674 | if ((link->channels = FF_LAYOUT2COUNT(link->channel_layout))) |
| 675 | link->channel_layout = 0; | 675 | link->channel_layout = 0; |
| 676 | else | 676 | else |
| 677 | link->channels = av_get_channel_layout_nb_channels(link->channel_layout); | 677 | link->channels = av_get_channel_layout_nb_channels(link->channel_layout); |
| 678 | } | 678 | } |
| 679 | 679 | ||
| 680 | ff_formats_unref(&link->in_formats); | 680 | ff_formats_unref(&link->incfg.formats); |
| 681 | ff_formats_unref(&link->out_formats); | 681 | ff_formats_unref(&link->outcfg.formats); |
| 682 | ff_formats_unref(&link->in_samplerates); | 682 | ff_formats_unref(&link->incfg.samplerates); |
| 683 | ff_formats_unref(&link->out_samplerates); | 683 | ff_formats_unref(&link->outcfg.samplerates); |
| 684 | ff_channel_layouts_unref(&link->in_channel_layouts); | 684 | ff_channel_layouts_unref(&link->incfg.channel_layouts); |
| 685 | ff_channel_layouts_unref(&link->out_channel_layouts); | 685 | ff_channel_layouts_unref(&link->outcfg.channel_layouts); |
| 686 | 686 | ||
| 687 | return 0; | 687 | return 0; |
| 688 | } | 688 | } |
| @@ -693,27 +693,27 @@ do { \ · 4 unmodified lines | |||
| 693 | AVFilterLink *link = filter->inputs[i]; \ | 693 | AVFilterLink *link = filter->inputs[i]; \ |
| 694 | fmt_type fmt; \ | 694 | fmt_type fmt; \ |
| 695 | \ | 695 | \ |
| 696 | if (!link->out_ ## list || link->out_ ## list->nb != 1) \ | 696 | if (!link->outcfg.list || link->outcfg.list->nb != 1) \ |
| 697 | continue; \ | 697 | continue; \ |
| 698 | fmt = link->out_ ## list->var[0]; \ | 698 | fmt = link->outcfg.list->var[0]; \ |
| 699 | \ | 699 | \ |
| 700 | for (j = 0; j < filter->nb_outputs; j++) { \ | 700 | for (j = 0; j < filter->nb_outputs; j++) { \ |
| 701 | AVFilterLink *out_link = filter->outputs[j]; \ | 701 | AVFilterLink *out_link = filter->outputs[j]; \ |
| 702 | list_type *fmts; \ | 702 | list_type *fmts; \ |
| 703 | \ | 703 | \ |
| 704 | if (link->type != out_link->type || \ | 704 | if (link->type != out_link->type || \ |
| 705 | out_link->in_ ## list->nb == 1) \ | 705 | out_link->incfg.list->nb == 1) \ |
| 706 | continue; \ | 706 | continue; \ |
| 707 | fmts = out_link->in_ ## list; \ | 707 | fmts = out_link->incfg.list; \ |
| 708 | \ | 708 | \ |
| 709 | if (!out_link->in_ ## list->nb) { \ | 709 | if (!out_link->incfg.list->nb) { \ |
| 710 | if ((ret = add_format(&out_link->in_ ##list, fmt)) < 0)\ | 710 | if ((ret = add_format(&out_link->incfg.list, fmt)) < 0)\ |
| 711 | return ret; \ | 711 | return ret; \ |
| 712 | ret = 1; \ | 712 | ret = 1; \ |
| 713 | break; \ | 713 | break; \ |
| 714 | } \ | 714 | } \ |
| 715 | \ | 715 | \ |
| 716 | for (k = 0; k < out_link->in_ ## list->nb; k++) \ | 716 | for (k = 0; k < out_link->incfg.list->nb; k++) \ |
| 717 | if (fmts->var[k] == fmt) { \ | 717 | if (fmts->var[k] == fmt) { \ |
| 718 | fmts->var[0] = fmt; \ | 718 | fmts->var[0] = fmt; \ |
| 719 | fmts->nb = 1; \ | 719 | fmts->nb = 1; \ |
| @@ -738,16 +738,16 @@ static int reduce_formats_on_filter(AVFilterContext *filter) · 18 unmodified lines | |||
| 738 | AVFilterLink *inlink = filter->inputs[i]; | 738 | AVFilterLink *inlink = filter->inputs[i]; |
| 739 | uint64_t fmt; | 739 | uint64_t fmt; |
| 740 | 740 | ||
| 741 | if (!inlink->out_channel_layouts || | 741 | if (!inlink->outcfg.channel_layouts || |
| 742 | inlink->out_channel_layouts->nb_channel_layouts != 1) | 742 | inlink->outcfg.channel_layouts->nb_channel_layouts != 1) |
| 743 | continue; | 743 | continue; |
| 744 | fmt = inlink->out_channel_layouts->channel_layouts[0]; | 744 | fmt = inlink->outcfg.channel_layouts->channel_layouts[0]; |
| 745 | 745 | ||
| 746 | for (j = 0; j < filter->nb_outputs; j++) { | 746 | for (j = 0; j < filter->nb_outputs; j++) { |
| 747 | AVFilterLink *outlink = filter->outputs[j]; | 747 | AVFilterLink *outlink = filter->outputs[j]; |
| 748 | AVFilterChannelLayouts *fmts; | 748 | AVFilterChannelLayouts *fmts; |
| 749 | 749 | ||
| 750 | fmts = outlink->in_channel_layouts; | 750 | fmts = outlink->incfg.channel_layouts; |
| 751 | if (inlink->type != outlink->type || fmts->nb_channel_layouts == 1) | 751 | if (inlink->type != outlink->type || fmts->nb_channel_layouts == 1) |
| 752 | continue; | 752 | continue; |
| 753 | 753 | ||
| @@ -755,12 +755,12 @@ static int reduce_formats_on_filter(AVFilterContext *filter) · 1 unmodified line | |||
| 755 | (!FF_LAYOUT2COUNT(fmt) || fmts->all_counts)) { | 755 | (!FF_LAYOUT2COUNT(fmt) || fmts->all_counts)) { |
| 756 | /* Turn the infinite list into a singleton */ | 756 | /* Turn the infinite list into a singleton */ |
| 757 | fmts->all_layouts = fmts->all_counts = 0; | 757 | fmts->all_layouts = fmts->all_counts = 0; |
| 758 | if (ff_add_channel_layout(&outlink->in_channel_layouts, fmt) < 0) | 758 | if (ff_add_channel_layout(&outlink->incfg.channel_layouts, fmt) < 0) |
| 759 | ret = 1; | 759 | ret = 1; |
| 760 | break; | 760 | break; |
| 761 | } | 761 | } |
| 762 | 762 | ||
| 763 | for (k = 0; k < outlink->in_channel_layouts->nb_channel_layouts; k++) { | 763 | for (k = 0; k < outlink->incfg.channel_layouts->nb_channel_layouts; k++) { |
| 764 | if (fmts->channel_layouts[k] == fmt) { | 764 | if (fmts->channel_layouts[k] == fmt) { |
| 765 | fmts->channel_layouts[0] = fmt; | 765 | fmts->channel_layouts[0] = fmt; |
| 766 | fmts->nb_channel_layouts = 1; | 766 | fmts->nb_channel_layouts = 1; |
| @@ -801,24 +801,24 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 34 unmodified lines | |||
| 801 | link = filter->inputs[i]; | 801 | link = filter->inputs[i]; |
| 802 | 802 | ||
| 803 | if (link->type == AVMEDIA_TYPE_AUDIO && | 803 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 804 | link->out_samplerates->nb_formats== 1) | 804 | link->outcfg.samplerates->nb_formats== 1) |
| 805 | break; | 805 | break; |
| 806 | } | 806 | } |
| 807 | if (i == filter->nb_inputs) | 807 | if (i == filter->nb_inputs) |
| 808 | return; | 808 | return; |
| 809 | 809 | ||
| 810 | sample_rate = link->out_samplerates->formats[0]; | 810 | sample_rate = link->outcfg.samplerates->formats[0]; |
| 811 | 811 | ||
| 812 | for (i = 0; i < filter->nb_outputs; i++) { | 812 | for (i = 0; i < filter->nb_outputs; i++) { |
| 813 | AVFilterLink *outlink = filter->outputs[i]; | 813 | AVFilterLink *outlink = filter->outputs[i]; |
| 814 | int best_idx, best_diff = INT_MAX; | 814 | int best_idx, best_diff = INT_MAX; |
| 815 | 815 | ||
| 816 | if (outlink->type != AVMEDIA_TYPE_AUDIO || | 816 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 817 | outlink->in_samplerates->nb_formats < 2) | 817 | outlink->incfg.samplerates->nb_formats < 2) |
| 818 | continue; | 818 | continue; |
| 819 | 819 | ||
| 820 | for (j = 0; j < outlink->in_samplerates->nb_formats; j++) { | 820 | for (j = 0; j < outlink->incfg.samplerates->nb_formats; j++) { |
| 821 | int diff = abs(sample_rate - outlink->in_samplerates->formats[j]); | 821 | int diff = abs(sample_rate - outlink->incfg.samplerates->formats[j]); |
| 822 | 822 | ||
| 823 | av_assert0(diff < INT_MAX); // This would lead to the use of uninitialized best_diff but is only possible with invalid sample rates | 823 | av_assert0(diff < INT_MAX); // This would lead to the use of uninitialized best_diff but is only possible with invalid sample rates |
| 824 | 824 | ||
| @@ -827,8 +827,8 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 2 unmodified lines | |||
| 827 | best_idx = j; | 827 | best_idx = j; |
| 828 | } | 828 | } |
| 829 | } | 829 | } |
| 830 | FFSWAP(int, outlink->in_samplerates->formats[0], | 830 | FFSWAP(int, outlink->incfg.samplerates->formats[0], |
| 831 | outlink->in_samplerates->formats[best_idx]); | 831 | outlink->incfg.samplerates->formats[best_idx]); |
| 832 | } | 832 | } |
| 833 | } | 833 | } |
| 834 | 834 | ||
| @@ -883,7 +883,7 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 48 unmodified lines | |||
| 883 | link = filter->inputs[i]; | 883 | link = filter->inputs[i]; |
| 884 | 884 | ||
| 885 | if (link->type == AVMEDIA_TYPE_AUDIO && | 885 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 886 | link->out_channel_layouts->nb_channel_layouts == 1) | 886 | link->outcfg.channel_layouts->nb_channel_layouts == 1) |
| 887 | break; | 887 | break; |
| 888 | } | 888 | } |
| 889 | if (i == filter->nb_inputs) | 889 | if (i == filter->nb_inputs) |
| @@ -894,12 +894,12 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 4 unmodified lines | |||
| 894 | int best_idx = -1, best_score = INT_MIN, best_count_diff = INT_MAX; | 894 | int best_idx = -1, best_score = INT_MIN, best_count_diff = INT_MAX; |
| 895 | 895 | ||
| 896 | if (outlink->type != AVMEDIA_TYPE_AUDIO || | 896 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 897 | outlink->in_channel_layouts->nb_channel_layouts < 2) | 897 | outlink->incfg.channel_layouts->nb_channel_layouts < 2) |
| 898 | continue; | 898 | continue; |
| 899 | 899 | ||
| 900 | for (j = 0; j < outlink->in_channel_layouts->nb_channel_layouts; j++) { | 900 | for (j = 0; j < outlink->incfg.channel_layouts->nb_channel_layouts; j++) { |
| 901 | uint64_t in_chlayout = link->out_channel_layouts->channel_layouts[0]; | 901 | uint64_t in_chlayout = link->outcfg.channel_layouts->channel_layouts[0]; |
| 902 | uint64_t out_chlayout = outlink->in_channel_layouts->channel_layouts[j]; | 902 | uint64_t out_chlayout = outlink->incfg.channel_layouts->channel_layouts[j]; |
| 903 | int in_channels = av_get_channel_layout_nb_channels(in_chlayout); | 903 | int in_channels = av_get_channel_layout_nb_channels(in_chlayout); |
| 904 | int out_channels = av_get_channel_layout_nb_channels(out_chlayout); | 904 | int out_channels = av_get_channel_layout_nb_channels(out_chlayout); |
| 905 | int count_diff = out_channels - in_channels; | 905 | int count_diff = out_channels - in_channels; |
| @@ -957,8 +957,8 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 51 unmodified lines | |||
| 957 | } | 957 | } |
| 958 | } | 958 | } |
| 959 | av_assert0(best_idx >= 0); | 959 | av_assert0(best_idx >= 0); |
| 960 | FFSWAP(uint64_t, outlink->in_channel_layouts->channel_layouts[0], | 960 | FFSWAP(uint64_t, outlink->incfg.channel_layouts->channel_layouts[0], |
| 961 | outlink->in_channel_layouts->channel_layouts[best_idx]); | 961 | outlink->incfg.channel_layouts->channel_layouts[best_idx]); |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | } | 964 | } |
| @@ -981,13 +981,13 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 16 unmodified lines | |||
| 981 | link = filter->inputs[i]; | 981 | link = filter->inputs[i]; |
| 982 | 982 | ||
| 983 | if (link->type == AVMEDIA_TYPE_AUDIO && | 983 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 984 | link->out_formats->nb_formats == 1) | 984 | link->outcfg.formats->nb_formats == 1) |
| 985 | break; | 985 | break; |
| 986 | } | 986 | } |
| 987 | if (i == filter->nb_inputs) | 987 | if (i == filter->nb_inputs) |
| 988 | return; | 988 | return; |
| 989 | 989 | ||
| 990 | format = link->out_formats->formats[0]; | 990 | format = link->outcfg.formats->formats[0]; |
| 991 | bps = av_get_bytes_per_sample(format); | 991 | bps = av_get_bytes_per_sample(format); |
| 992 | 992 | ||
| 993 | for (i = 0; i < filter->nb_outputs; i++) { | 993 | for (i = 0; i < filter->nb_outputs; i++) { |
| @@ -995,11 +995,11 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 1 unmodified line | |||
| 995 | int best_idx = -1, best_score = INT_MIN; | 995 | int best_idx = -1, best_score = INT_MIN; |
| 996 | 996 | ||
| 997 | if (outlink->type != AVMEDIA_TYPE_AUDIO || | 997 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 998 | outlink->in_formats->nb_formats < 2) | 998 | outlink->incfg.formats->nb_formats < 2) |
| 999 | continue; | 999 | continue; |
| 1000 | 1000 | ||
| 1001 | for (j = 0; j < outlink->in_formats->nb_formats; j++) { | 1001 | for (j = 0; j < outlink->incfg.formats->nb_formats; j++) { |
| 1002 | int out_format = outlink->in_formats->formats[j]; | 1002 | int out_format = outlink->incfg.formats->formats[j]; |
| 1003 | int out_bps = av_get_bytes_per_sample(out_format); | 1003 | int out_bps = av_get_bytes_per_sample(out_format); |
| 1004 | int score; | 1004 | int score; |
| 1005 | 1005 | ||
| @@ -1026,8 +1026,8 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 20 unmodified lines | |||
| 1026 | } | 1026 | } |
| 1027 | } | 1027 | } |
| 1028 | av_assert0(best_idx >= 0); | 1028 | av_assert0(best_idx >= 0); |
| 1029 | FFSWAP(int, outlink->in_formats->formats[0], | 1029 | FFSWAP(int, outlink->incfg.formats->formats[0], |
| 1030 | outlink->in_formats->formats[best_idx]); | 1030 | outlink->incfg.formats->formats[best_idx]); |
| 1031 | } | 1031 | } |
| 1032 | } | 1032 | } |
| 1033 | 1033 | ||
| @@ -1051,7 +1051,7 @@ static int pick_formats(AVFilterGraph *graph) · 17 unmodified lines | |||
| 1051 | AVFilterContext *filter = graph->filters[i]; | 1051 | AVFilterContext *filter = graph->filters[i]; |
| 1052 | if (filter->nb_inputs){ | 1052 | if (filter->nb_inputs){ |
| 1053 | for (j = 0; j < filter->nb_inputs; j++){ | 1053 | for (j = 0; j < filter->nb_inputs; j++){ |
| 1054 | if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->nb_formats == 1) { | 1054 | if (filter->inputs[j]->incfg.formats && filter->inputs[j]->incfg.formats->nb_formats == 1) { |
| 1055 | if ((ret = pick_format(filter->inputs[j], NULL)) < 0) | 1055 | if ((ret = pick_format(filter->inputs[j], NULL)) < 0) |
| 1056 | return ret; | 1056 | return ret; |
| 1057 | change = 1; | 1057 | change = 1; |
| @@ -1060,7 +1060,7 @@ static int pick_formats(AVFilterGraph *graph) · 2 unmodified lines | |||
| 1060 | } | 1060 | } |
| 1061 | if (filter->nb_outputs){ | 1061 | if (filter->nb_outputs){ |
| 1062 | for (j = 0; j < filter->nb_outputs; j++){ | 1062 | for (j = 0; j < filter->nb_outputs; j++){ |
| 1063 | if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->nb_formats == 1) { | 1063 | if (filter->outputs[j]->incfg.formats && filter->outputs[j]->incfg.formats->nb_formats == 1) { |
| 1064 | if ((ret = pick_format(filter->outputs[j], NULL)) < 0) | 1064 | if ((ret = pick_format(filter->outputs[j], NULL)) < 0) |
| 1065 | return ret; | 1065 | return ret; |
| 1066 | change = 1; | 1066 | change = 1; |
| @@ -1069,7 +1069,7 @@ static int pick_formats(AVFilterGraph *graph) · 2 unmodified lines | |||
| 1069 | } | 1069 | } |
| 1070 | if (filter->nb_inputs && filter->nb_outputs && filter->inputs[0]->format>=0) { | 1070 | if (filter->nb_inputs && filter->nb_outputs && filter->inputs[0]->format>=0) { |
| 1071 | for (j = 0; j < filter->nb_outputs; j++) { | 1071 | for (j = 0; j < filter->nb_outputs; j++) { |
| 1072 | if(filter->outputs[j]->format<0) { | 1072 | if (filter->outputs[j]->format<0) { |
| 1073 | if ((ret = pick_format(filter->outputs[j], filter->inputs[0])) < 0) | 1073 | if ((ret = pick_format(filter->outputs[j], filter->inputs[0])) < 0) |
| 1074 | return ret; | 1074 | return ret; |
| 1075 | change = 1; | 1075 | change = 1; |
| @@ -134,7 +134,7 @@ static int query_formats(AVFilterContext *ctx) · 133 unmodified lines | |||
| 134 | int ret; | 134 | int ret; |
| 135 | 135 | ||
| 136 | AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); | 136 | AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); |
| 137 | if ((ret = ff_formats_ref(fmts_list, &outlink->in_formats)) < 0) | 137 | if ((ret = ff_formats_ref(fmts_list, &outlink->incfg.formats)) < 0) |
| 138 | return ret; | 138 | return ret; |
| 139 | 139 | ||
| 140 | return 0; | 140 | return 0; |
| @@ -902,7 +902,7 @@ static int query_formats(AVFilterContext *ctx) · 901 unmodified lines | |||
| 902 | /* set optional output video format */ | 902 | /* set optional output video format */ |
| 903 | if (ebur128->do_video) { | 903 | if (ebur128->do_video) { |
| 904 | formats = ff_make_format_list(pix_fmts); | 904 | formats = ff_make_format_list(pix_fmts); |
| 905 | if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 905 | if ((ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 906 | return ret; | 906 | return ret; |
| 907 | outlink = ctx->outputs[1]; | 907 | outlink = ctx->outputs[1]; |
| 908 | } | 908 | } |
| @@ -911,18 +911,18 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 911 | * Note: ff_set_common_* functions are not used because they affect all the | 911 | * Note: ff_set_common_* functions are not used because they affect all the |
| 912 | * links, and thus break the video format negotiation */ | 912 | * links, and thus break the video format negotiation */ |
| 913 | formats = ff_make_format_list(sample_fmts); | 913 | formats = ff_make_format_list(sample_fmts); |
| 914 | if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0 || | 914 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.formats)) < 0 || |
| 915 | (ret = ff_formats_ref(formats, &outlink->in_formats)) < 0) | 915 | (ret = ff_formats_ref(formats, &outlink->incfg.formats)) < 0) |
| 916 | return ret; | 916 | return ret; |
| 917 | 917 | ||
| 918 | layouts = ff_all_channel_layouts(); | 918 | layouts = ff_all_channel_layouts(); |
| 919 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0 || | 919 | if ((ret = ff_channel_layouts_ref(layouts, &inlink->outcfg.channel_layouts)) < 0 || |
| 920 | (ret = ff_channel_layouts_ref(layouts, &outlink->in_channel_layouts)) < 0) | 920 | (ret = ff_channel_layouts_ref(layouts, &outlink->incfg.channel_layouts)) < 0) |
| 921 | return ret; | 921 | return ret; |
| 922 | 922 | ||
| 923 | formats = ff_make_format_list(input_srate); | 923 | formats = ff_make_format_list(input_srate); |
| 924 | if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0 || | 924 | if ((ret = ff_formats_ref(formats, &inlink->outcfg.samplerates)) < 0 || |
| 925 | (ret = ff_formats_ref(formats, &outlink->in_samplerates)) < 0) | 925 | (ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) |
| 926 | return ret; | 926 | return ret; |
| 927 | 927 | ||
| 928 | return 0; | 928 | return 0; |
| @@ -103,7 +103,7 @@ static int query_formats(AVFilterContext *ctx) · 102 unmodified lines | |||
| 103 | int ret; | 103 | int ret; |
| 104 | 104 | ||
| 105 | AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); | 105 | AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts); |
| 106 | if ((ret = ff_formats_ref(fmts_list, &outlink->in_formats)) < 0) | 106 | if ((ret = ff_formats_ref(fmts_list, &outlink->incfg.formats)) < 0) |
| 107 | return ret; | 107 | return ret; |
| 108 | 108 | ||
| 109 | return 0; | 109 | return 0; |
| @@ -569,14 +569,14 @@ void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref) · 568 unmodified lines | |||
| 569 | int ff_set_common_channel_layouts(AVFilterContext *ctx, | 569 | int ff_set_common_channel_layouts(AVFilterContext *ctx, |
| 570 | AVFilterChannelLayouts *layouts) | 570 | AVFilterChannelLayouts *layouts) |
| 571 | { | 571 | { |
| 572 | SET_COMMON_FORMATS(ctx, layouts, in_channel_layouts, out_channel_layouts, | 572 | SET_COMMON_FORMATS(ctx, layouts, incfg.channel_layouts, outcfg.channel_layouts, |
| 573 | ff_channel_layouts_ref, ff_channel_layouts_unref); | 573 | ff_channel_layouts_ref, ff_channel_layouts_unref); |
| 574 | } | 574 | } |
| 575 | 575 | ||
| 576 | int ff_set_common_samplerates(AVFilterContext *ctx, | 576 | int ff_set_common_samplerates(AVFilterContext *ctx, |
| 577 | AVFilterFormats *samplerates) | 577 | AVFilterFormats *samplerates) |
| 578 | { | 578 | { |
| 579 | SET_COMMON_FORMATS(ctx, samplerates, in_samplerates, out_samplerates, | 579 | SET_COMMON_FORMATS(ctx, samplerates, incfg.samplerates, outcfg.samplerates, |
| 580 | ff_formats_ref, ff_formats_unref); | 580 | ff_formats_ref, ff_formats_unref); |
| 581 | } | 581 | } |
| 582 | 582 | ||
| @@ -587,7 +587,7 @@ int ff_set_common_samplerates(AVFilterContext *ctx, · 4 unmodified lines | |||
| 587 | */ | 587 | */ |
| 588 | int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) | 588 | int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats) |
| 589 | { | 589 | { |
| 590 | SET_COMMON_FORMATS(ctx, formats, in_formats, out_formats, | 590 | SET_COMMON_FORMATS(ctx, formats, incfg.formats, outcfg.formats, |
| 591 | ff_formats_ref, ff_formats_unref); | 591 | ff_formats_ref, ff_formats_unref); |
| 592 | } | 592 | } |
| 593 | 593 | ||
| @@ -362,19 +362,19 @@ static int movie_query_formats(AVFilterContext *ctx) · 361 unmodified lines | |||
| 362 | switch (c->codec_type) { | 362 | switch (c->codec_type) { |
| 363 | case AVMEDIA_TYPE_VIDEO: | 363 | case AVMEDIA_TYPE_VIDEO: |
| 364 | list[0] = c->format; | 364 | list[0] = c->format; |
| 365 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_formats)) < 0) | 365 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.formats)) < 0) |
| 366 | return ret; | 366 | return ret; |
| 367 | break; | 367 | break; |
| 368 | case AVMEDIA_TYPE_AUDIO: | 368 | case AVMEDIA_TYPE_AUDIO: |
| 369 | list[0] = c->format; | 369 | list[0] = c->format; |
| 370 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_formats)) < 0) | 370 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.formats)) < 0) |
| 371 | return ret; | 371 | return ret; |
| 372 | list[0] = c->sample_rate; | 372 | list[0] = c->sample_rate; |
| 373 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates)) < 0) | 373 | if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->incfg.samplerates)) < 0) |
| 374 | return ret; | 374 | return ret; |
| 375 | list64[0] = c->channel_layout; | 375 | list64[0] = c->channel_layout; |
| 376 | if ((ret = ff_channel_layouts_ref(ff_make_format64_list(list64), | 376 | if ((ret = ff_channel_layouts_ref(ff_make_format64_list(list64), |
| 377 | &outlink->in_channel_layouts)) < 0) | 377 | &outlink->incfg.channel_layouts)) < 0) |
| 378 | return ret; | 378 | return ret; |
| 379 | break; | 379 | break; |
| 380 | } | 380 | } |
| @@ -40,7 +40,7 @@ static void print_formats(AVFilterContext *filter_ctx) · 39 unmodified lines | |||
| 40 | for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { \ | 40 | for (i = 0; i < filter_ctx->nb_##inout##puts; i++) { \ |
| 41 | if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ | 41 | if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_VIDEO) { \ |
| 42 | AVFilterFormats *fmts = \ | 42 | AVFilterFormats *fmts = \ |
| 43 | filter_ctx->inout##puts[i]->outin##_formats; \ | 43 | filter_ctx->inout##puts[i]->outin##cfg.formats; \ |
| 44 | for (j = 0; j < fmts->nb_formats; j++) \ | 44 | for (j = 0; j < fmts->nb_formats; j++) \ |
| 45 | if(av_get_pix_fmt_name(fmts->formats[j])) \ | 45 | if(av_get_pix_fmt_name(fmts->formats[j])) \ |
| 46 | printf(#INOUT "PUT[%d] %s: fmt:%s\n", \ | 46 | printf(#INOUT "PUT[%d] %s: fmt:%s\n", \ |
| @@ -50,13 +50,13 @@ static void print_formats(AVFilterContext *filter_ctx) · 3 unmodified lines | |||
| 50 | AVFilterFormats *fmts; \ | 50 | AVFilterFormats *fmts; \ |
| 51 | AVFilterChannelLayouts *layouts; \ | 51 | AVFilterChannelLayouts *layouts; \ |
| 52 | \ | 52 | \ |
| 53 | fmts = filter_ctx->inout##puts[i]->outin##_formats; \ | 53 | fmts = filter_ctx->inout##puts[i]->outin##cfg.formats; \ |
| 54 | for (j = 0; j < fmts->nb_formats; j++) \ | 54 | for (j = 0; j < fmts->nb_formats; j++) \ |
| 55 | printf(#INOUT "PUT[%d] %s: fmt:%s\n", \ | 55 | printf(#INOUT "PUT[%d] %s: fmt:%s\n", \ |
| 56 | i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), \ | 56 | i, avfilter_pad_get_name(filter_ctx->inout##put_pads, i), \ |
| 57 | av_get_sample_fmt_name(fmts->formats[j])); \ | 57 | av_get_sample_fmt_name(fmts->formats[j])); \ |
| 58 | \ | 58 | \ |
| 59 | layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \ | 59 | layouts = filter_ctx->inout##puts[i]->outin##cfg.channel_layouts; \ |
| 60 | for (j = 0; j < layouts->nb_channel_layouts; j++) { \ | 60 | for (j = 0; j < layouts->nb_channel_layouts; j++) { \ |
| 61 | char buf[256]; \ | 61 | char buf[256]; \ |
| 62 | av_get_channel_layout_string(buf, sizeof(buf), -1, \ | 62 | av_get_channel_layout_string(buf, sizeof(buf), -1, \ |
| @@ -32,10 +32,10 @@ int ff_vaapi_vpp_query_formats(AVFilterContext *avctx) · 31 unmodified lines | |||
| 32 | int err; | 32 | int err; |
| 33 | 33 | ||
| 34 | if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), | 34 | if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), |
| 35 | &avctx->inputs[0]->out_formats)) < 0) | 35 | &avctx->inputs[0]->outcfg.formats)) < 0) |
| 36 | return err; | 36 | return err; |
| 37 | if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), | 37 | if ((err = ff_formats_ref(ff_make_format_list(pix_fmts), |
| 38 | &avctx->outputs[0]->in_formats)) < 0) | 38 | &avctx->outputs[0]->incfg.formats)) < 0) |
| 39 | return err; | 39 | return err; |
| 40 | 40 | ||
| 41 | return 0; | 41 | return 0; |
| @@ -115,28 +115,28 @@ static int query_formats(AVFilterContext *ctx) · 114 unmodified lines | |||
| 115 | int ret, sample_rates[] = { 48000, -1 }; | 115 | int ret, sample_rates[] = { 48000, -1 }; |
| 116 | 116 | ||
| 117 | formats = ff_make_format_list(sample_fmts); | 117 | formats = ff_make_format_list(sample_fmts); |
| 118 | if ((ret = ff_formats_ref (formats, &outlink->in_formats )) < 0 || | 118 | if ((ret = ff_formats_ref (formats, &outlink->incfg.formats )) < 0 || |
| 119 | (ret = ff_add_channel_layout (&layout, FF_COUNT2LAYOUT(s->channels))) < 0 || | 119 | (ret = ff_add_channel_layout (&layout, FF_COUNT2LAYOUT(s->channels))) < 0 || |
| 120 | (ret = ff_channel_layouts_ref (layout , &outlink->in_channel_layouts)) < 0) | 120 | (ret = ff_channel_layouts_ref (layout , &outlink->incfg.channel_layouts)) < 0) |
| 121 | return ret; | 121 | return ret; |
| 122 | 122 | ||
| 123 | sample_rates[0] = s->sample_rate; | 123 | sample_rates[0] = s->sample_rate; |
| 124 | formats = ff_make_format_list(sample_rates); | 124 | formats = ff_make_format_list(sample_rates); |
| 125 | if (!formats) | 125 | if (!formats) |
| 126 | return AVERROR(ENOMEM); | 126 | return AVERROR(ENOMEM); |
| 127 | if ((ret = ff_formats_ref(formats, &outlink->in_samplerates)) < 0) | 127 | if ((ret = ff_formats_ref(formats, &outlink->incfg.samplerates)) < 0) |
| 128 | return ret; | 128 | return ret; |
| 129 | 129 | ||
| 130 | formats = ff_make_format_list(pix_fmts); | 130 | formats = ff_make_format_list(pix_fmts); |
| 131 | if (!formats) | 131 | if (!formats) |
| 132 | return AVERROR(ENOMEM); | 132 | return AVERROR(ENOMEM); |
| 133 | if ((ret = ff_formats_ref(formats, &magnitude->out_formats)) < 0) | 133 | if ((ret = ff_formats_ref(formats, &magnitude->outcfg.formats)) < 0) |
| 134 | return ret; | 134 | return ret; |
| 135 | 135 | ||
| 136 | formats = ff_make_format_list(pix_fmts); | 136 | formats = ff_make_format_list(pix_fmts); |
| 137 | if (!formats) | 137 | if (!formats) |
| 138 | return AVERROR(ENOMEM); | 138 | return AVERROR(ENOMEM); |
| 139 | if ((ret = ff_formats_ref(formats, &phase->out_formats)) < 0) | 139 | if ((ret = ff_formats_ref(formats, &phase->outcfg.formats)) < 0) |
| 140 | return ret; | 140 | return ret; |
| 141 | 141 | ||
| 142 | return 0; | 142 | return 0; |
| @@ -103,12 +103,12 @@ static int query_formats(AVFilterContext *ctx) · 102 unmodified lines | |||
| 103 | AVFilterFormats *main_formats = ff_make_format_list(main_fmts); | 103 | AVFilterFormats *main_formats = ff_make_format_list(main_fmts); |
| 104 | int ret; | 104 | int ret; |
| 105 | 105 | ||
| 106 | if ((ret = ff_formats_ref(main_formats, &ctx->inputs[0]->out_formats)) < 0 || | 106 | if ((ret = ff_formats_ref(main_formats, &ctx->inputs[0]->outcfg.formats)) < 0 || |
| 107 | (ret = ff_formats_ref(main_formats, &ctx->outputs[0]->in_formats)) < 0) | 107 | (ret = ff_formats_ref(main_formats, &ctx->outputs[0]->incfg.formats)) < 0) |
| 108 | return ret; | 108 | return ret; |
| 109 | 109 | ||
| 110 | return ff_formats_ref(ff_make_format_list(alpha_fmts), | 110 | return ff_formats_ref(ff_make_format_list(alpha_fmts), |
| 111 | &ctx->inputs[1]->out_formats); | 111 | &ctx->inputs[1]->outcfg.formats); |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | static int config_input_main(AVFilterLink *inlink) | 114 | static int config_input_main(AVFilterLink *inlink) |
| @@ -139,10 +139,10 @@ static int query_formats(AVFilterContext *ctx) · 138 unmodified lines | |||
| 139 | { | 139 | { |
| 140 | int ret; | 140 | int ret; |
| 141 | 141 | ||
| 142 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->out_formats)) < 0) | 142 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0) |
| 143 | return ret; | 143 | return ret; |
| 144 | 144 | ||
| 145 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats)) < 0) | 145 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->incfg.formats)) < 0) |
| 146 | return ret; | 146 | return ret; |
| 147 | 147 | ||
| 148 | return 0; | 148 | return 0; |
| @@ -896,7 +896,7 @@ static int query_formats(AVFilterContext *ctx) · 895 unmodified lines | |||
| 896 | return AVERROR(ENOMEM); | 896 | return AVERROR(ENOMEM); |
| 897 | if (s->user_format == AV_PIX_FMT_NONE) | 897 | if (s->user_format == AV_PIX_FMT_NONE) |
| 898 | return ff_set_common_formats(ctx, formats); | 898 | return ff_set_common_formats(ctx, formats); |
| 899 | res = ff_formats_ref(formats, &ctx->inputs[0]->out_formats); | 899 | res = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats); |
| 900 | if (res < 0) | 900 | if (res < 0) |
| 901 | return res; | 901 | return res; |
| 902 | formats = NULL; | 902 | formats = NULL; |
| @@ -904,7 +904,7 @@ static int query_formats(AVFilterContext *ctx) · 1 unmodified line | |||
| 904 | if (res < 0) | 904 | if (res < 0) |
| 905 | return res; | 905 | return res; |
| 906 | 906 | ||
| 907 | return ff_formats_ref(formats, &ctx->outputs[0]->in_formats); | 907 | return ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats); |
| 908 | } | 908 | } |
| 909 | 909 | ||
| 910 | static int config_props(AVFilterLink *outlink) | 910 | static int config_props(AVFilterLink *outlink) |
| @@ -149,8 +149,8 @@ static int query_formats(AVFilterContext *fctx) · 148 unmodified lines | |||
| 149 | return AVERROR(ENOMEM); | 149 | return AVERROR(ENOMEM); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | if ((ret = ff_formats_ref(inout_formats, &fctx->inputs[0]->out_formats)) < 0 || | 152 | if ((ret = ff_formats_ref(inout_formats, &fctx->inputs[0]->outcfg.formats)) < 0 || |
| 153 | (ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->in_formats)) < 0) { | 153 | (ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->incfg.formats)) < 0) { |
| 154 | return ret; | 154 | return ret; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| @@ -171,7 +171,7 @@ static int query_formats_src(AVFilterContext *fctx) · 14 unmodified lines | |||
| 171 | return AVERROR(ENOMEM); | 171 | return AVERROR(ENOMEM); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | if ((ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->in_formats)) < 0) { | 174 | if ((ret = ff_formats_ref(inout_formats, &fctx->outputs[0]->incfg.formats)) < 0) { |
| 175 | return ret; | 175 | return ret; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| @@ -100,8 +100,8 @@ static int query_formats(AVFilterContext *ctx) · 99 unmodified lines | |||
| 100 | AV_PIX_FMT_PAL8, | 100 | AV_PIX_FMT_PAL8, |
| 101 | AV_PIX_FMT_NONE | 101 | AV_PIX_FMT_NONE |
| 102 | }; | 102 | }; |
| 103 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->out_formats)) < 0 || | 103 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0 || |
| 104 | (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->in_formats)) < 0) | 104 | (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->incfg.formats)) < 0) |
| 105 | return ret; | 105 | return ret; |
| 106 | } | 106 | } |
| 107 | return 0; | 107 | return 0; |
| @@ -143,12 +143,12 @@ static int query_formats(AVFilterContext *ctx) · 142 unmodified lines | |||
| 143 | AVFilterFormats *avff; | 143 | AVFilterFormats *avff; |
| 144 | int i, ret, depth = 0, be = 0; | 144 | int i, ret, depth = 0, be = 0; |
| 145 | 145 | ||
| 146 | if (!ctx->inputs[0]->in_formats || | 146 | if (!ctx->inputs[0]->incfg.formats || |
| 147 | !ctx->inputs[0]->in_formats->nb_formats) { | 147 | !ctx->inputs[0]->incfg.formats->nb_formats) { |
| 148 | return AVERROR(EAGAIN); | 148 | return AVERROR(EAGAIN); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | avff = ctx->inputs[0]->in_formats; | 151 | avff = ctx->inputs[0]->incfg.formats; |
| 152 | desc = av_pix_fmt_desc_get(avff->formats[0]); | 152 | desc = av_pix_fmt_desc_get(avff->formats[0]); |
| 153 | depth = desc->comp[0].depth; | 153 | depth = desc->comp[0].depth; |
| 154 | be = desc->flags & AV_PIX_FMT_FLAG_BE; | 154 | be = desc->flags & AV_PIX_FMT_FLAG_BE; |
| @@ -157,8 +157,8 @@ static int query_formats(AVFilterContext *ctx) · 2 unmodified lines | |||
| 157 | } else { | 157 | } else { |
| 158 | in_pixfmts = in_pixfmts_le; | 158 | in_pixfmts = in_pixfmts_le; |
| 159 | } | 159 | } |
| 160 | if (!ctx->inputs[0]->out_formats) | 160 | if (!ctx->inputs[0]->outcfg.formats) |
| 161 | if ((ret = ff_formats_ref(ff_make_format_list(in_pixfmts), &ctx->inputs[0]->out_formats)) < 0) | 161 | if ((ret = ff_formats_ref(ff_make_format_list(in_pixfmts), &ctx->inputs[0]->outcfg.formats)) < 0) |
| 162 | return ret; | 162 | return ret; |
| 163 | 163 | ||
| 164 | for (i = 1; i < avff->nb_formats; i++) { | 164 | for (i = 1; i < avff->nb_formats; i++) { |
| @@ -193,7 +193,7 @@ static int query_formats(AVFilterContext *ctx) · 28 unmodified lines | |||
| 193 | out_pixfmts = out16le_pixfmts; | 193 | out_pixfmts = out16le_pixfmts; |
| 194 | 194 | ||
| 195 | for (i = 0; i < ctx->nb_outputs; i++) | 195 | for (i = 0; i < ctx->nb_outputs; i++) |
| 196 | if ((ret = ff_formats_ref(ff_make_format_list(out_pixfmts), &ctx->outputs[i]->in_formats)) < 0) | 196 | if ((ret = ff_formats_ref(ff_make_format_list(out_pixfmts), &ctx->outputs[i]->incfg.formats)) < 0) |
| 197 | return ret; | 197 | return ret; |
| 198 | return 0; | 198 | return 0; |
| 199 | } | 199 | } |
| @@ -917,14 +917,14 @@ static int query_formats(AVFilterContext *ctx) · 916 unmodified lines | |||
| 917 | return ff_set_common_formats(ctx, fmts_list); | 917 | return ff_set_common_formats(ctx, fmts_list); |
| 918 | } | 918 | } |
| 919 | 919 | ||
| 920 | if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_MAIN]->out_formats)) < 0) | 920 | if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_MAIN]->outcfg.formats)) < 0) |
| 921 | return ret; | 921 | return ret; |
| 922 | fmts_list = ff_make_format_list(unproc_pix_fmts); | 922 | fmts_list = ff_make_format_list(unproc_pix_fmts); |
| 923 | if (!fmts_list) | 923 | if (!fmts_list) |
| 924 | return AVERROR(ENOMEM); | 924 | return AVERROR(ENOMEM); |
| 925 | if ((ret = ff_formats_ref(fmts_list, &ctx->outputs[0]->in_formats)) < 0) | 925 | if ((ret = ff_formats_ref(fmts_list, &ctx->outputs[0]->incfg.formats)) < 0) |
| 926 | return ret; | 926 | return ret; |
| 927 | if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_CLEANSRC]->out_formats)) < 0) | 927 | if ((ret = ff_formats_ref(fmts_list, &ctx->inputs[INPUT_CLEANSRC]->outcfg.formats)) < 0) |
| 928 | return ret; | 928 | return ret; |
| 929 | return 0; | 929 | return 0; |
| 930 | } | 930 | } |
| @@ -58,8 +58,8 @@ static int query_formats(AVFilterContext *ctx) · 57 unmodified lines | |||
| 58 | (ret = ff_add_format(&formats, pix_fmt)) < 0) | 58 | (ret = ff_add_format(&formats, pix_fmt)) < 0) |
| 59 | return ret; | 59 | return ret; |
| 60 | } | 60 | } |
| 61 | if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->out_formats)) < 0 || | 61 | if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats)) < 0 || |
| 62 | (ret = ff_formats_ref(formats, &ctx->outputs[0]->in_formats)) < 0) | 62 | (ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) |
| 63 | return ret; | 63 | return ret; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| @@ -155,15 +155,15 @@ static int query_formats(AVFilterContext *ctx) · 154 unmodified lines | |||
| 155 | int rgb, i, bits; | 155 | int rgb, i, bits; |
| 156 | int ret; | 156 | int ret; |
| 157 | 157 | ||
| 158 | if (!ctx->inputs[0]->in_formats || | 158 | if (!ctx->inputs[0]->incfg.formats || |
| 159 | !ctx->inputs[0]->in_formats->nb_formats) { | 159 | !ctx->inputs[0]->incfg.formats->nb_formats) { |
| 160 | return AVERROR(EAGAIN); | 160 | return AVERROR(EAGAIN); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | if (!ctx->inputs[0]->out_formats) | 163 | if (!ctx->inputs[0]->outcfg.formats) |
| 164 | if ((ret = ff_formats_ref(ff_make_format_list(levels_in_pix_fmts), &ctx->inputs[0]->out_formats)) < 0) | 164 | if ((ret = ff_formats_ref(ff_make_format_list(levels_in_pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0) |
| 165 | return ret; | 165 | return ret; |
| 166 | avff = ctx->inputs[0]->in_formats; | 166 | avff = ctx->inputs[0]->incfg.formats; |
| 167 | desc = av_pix_fmt_desc_get(avff->formats[0]); | 167 | desc = av_pix_fmt_desc_get(avff->formats[0]); |
| 168 | rgb = desc->flags & AV_PIX_FMT_FLAG_RGB; | 168 | rgb = desc->flags & AV_PIX_FMT_FLAG_RGB; |
| 169 | bits = desc->comp[0].depth; | 169 | bits = desc->comp[0].depth; |
| @@ -192,7 +192,7 @@ static int query_formats(AVFilterContext *ctx) · 22 unmodified lines | |||
| 192 | out_pix_fmts = levels_out_yuv12_pix_fmts; | 192 | out_pix_fmts = levels_out_yuv12_pix_fmts; |
| 193 | else | 193 | else |
| 194 | return AVERROR(EAGAIN); | 194 | return AVERROR(EAGAIN); |
| 195 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats)) < 0) | 195 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->incfg.formats)) < 0) |
| 196 | return ret; | 196 | return ret; |
| 197 | 197 | ||
| 198 | return 0; | 198 | return 0; |
| @@ -41,9 +41,9 @@ static int hwdownload_query_formats(AVFilterContext *avctx) · 40 unmodified lines | |||
| 41 | int err; | 41 | int err; |
| 42 | 42 | ||
| 43 | if ((err = ff_formats_pixdesc_filter(&fmts, AV_PIX_FMT_FLAG_HWACCEL, 0)) || | 43 | if ((err = ff_formats_pixdesc_filter(&fmts, AV_PIX_FMT_FLAG_HWACCEL, 0)) || |
| 44 | (err = ff_formats_ref(fmts, &avctx->inputs[0]->out_formats)) || | 44 | (err = ff_formats_ref(fmts, &avctx->inputs[0]->outcfg.formats)) || |
| 45 | (err = ff_formats_pixdesc_filter(&fmts, 0, AV_PIX_FMT_FLAG_HWACCEL)) || | 45 | (err = ff_formats_pixdesc_filter(&fmts, 0, AV_PIX_FMT_FLAG_HWACCEL)) || |
| 46 | (err = ff_formats_ref(fmts, &avctx->outputs[0]->in_formats))) | 46 | (err = ff_formats_ref(fmts, &avctx->outputs[0]->incfg.formats))) |
| 47 | return err; | 47 | return err; |
| 48 | 48 | ||
| 49 | return 0; | 49 | return 0; |
| @@ -42,9 +42,9 @@ static int hwmap_query_formats(AVFilterContext *avctx) · 41 unmodified lines | |||
| 42 | int ret; | 42 | int ret; |
| 43 | 43 | ||
| 44 | if ((ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO), | 44 | if ((ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO), |
| 45 | &avctx->inputs[0]->out_formats)) < 0 || | 45 | &avctx->inputs[0]->outcfg.formats)) < 0 || |
| 46 | (ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO), | 46 | (ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO), |
| 47 | &avctx->outputs[0]->in_formats)) < 0) | 47 | &avctx->outputs[0]->incfg.formats)) < 0) |
| 48 | return ret; | 48 | return ret; |
| 49 | 49 | ||
| 50 | return 0; | 50 | return 0; |
| @@ -90,9 +90,9 @@ static int hwupload_query_formats(AVFilterContext *avctx) · 89 unmodified lines | |||
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | if ((err = ff_formats_ref(input_formats, &avctx->inputs[0]->out_formats)) < 0 || | 93 | if ((err = ff_formats_ref(input_formats, &avctx->inputs[0]->outcfg.formats)) < 0 || |
| 94 | (err = ff_formats_ref(ff_make_format_list(output_pix_fmts), | 94 | (err = ff_formats_ref(ff_make_format_list(output_pix_fmts), |
| 95 | &avctx->outputs[0]->in_formats)) < 0) | 95 | &avctx->outputs[0]->incfg.formats)) < 0) |
| 96 | goto fail; | 96 | goto fail; |
| 97 | 97 | ||
| 98 | av_hwframe_constraints_free(&constraints); | 98 | av_hwframe_constraints_free(&constraints); |
| @@ -71,13 +71,13 @@ static int cudaupload_query_formats(AVFilterContext *ctx) · 70 unmodified lines | |||
| 71 | AVFilterFormats *in_fmts = ff_make_format_list(input_pix_fmts); | 71 | AVFilterFormats *in_fmts = ff_make_format_list(input_pix_fmts); |
| 72 | AVFilterFormats *out_fmts; | 72 | AVFilterFormats *out_fmts; |
| 73 | 73 | ||
| 74 | ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats); | 74 | ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->outcfg.formats); |
| 75 | if (ret < 0) | 75 | if (ret < 0) |
| 76 | return ret; | 76 | return ret; |
| 77 | 77 | ||
| 78 | out_fmts = ff_make_format_list(output_pix_fmts); | 78 | out_fmts = ff_make_format_list(output_pix_fmts); |
| 79 | 79 | ||
| 80 | ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats); | 80 | ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->incfg.formats); |
| 81 | if (ret < 0) | 81 | if (ret < 0) |
| 82 | return ret; | 82 | return ret; |
| 83 | 83 | ||
| @@ -177,7 +177,7 @@ static int query_formats(AVFilterContext *ctx) · 176 unmodified lines | |||
| 177 | if (s->tlut2 || !s->odepth) | 177 | if (s->tlut2 || !s->odepth) |
| 178 | return ff_set_common_formats(ctx, ff_make_format_list(all_pix_fmts)); | 178 | return ff_set_common_formats(ctx, ff_make_format_list(all_pix_fmts)); |
| 179 | 179 | ||
| 180 | ret = ff_formats_ref(ff_make_format_list(all_pix_fmts), &ctx->inputs[0]->out_formats); | 180 | ret = ff_formats_ref(ff_make_format_list(all_pix_fmts), &ctx->inputs[0]->outcfg.formats); |
| 181 | if (ret < 0) | 181 | if (ret < 0) |
| 182 | return ret; | 182 | return ret; |
| 183 | 183 | ||
| @@ -192,7 +192,7 @@ static int query_formats(AVFilterContext *ctx) · 8 unmodified lines | |||
| 192 | return AVERROR(EINVAL); | 192 | return AVERROR(EINVAL); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | return ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->in_formats); | 195 | return ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->incfg.formats); |
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | static int config_inputx(AVFilterLink *inlink) | 198 | static int config_inputx(AVFilterLink *inlink) |
| @@ -122,12 +122,12 @@ static int query_formats(AVFilterContext *ctx) · 121 unmodified lines | |||
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | for (i = 0; i < s->nb_inputs; i++) | 124 | for (i = 0; i < s->nb_inputs; i++) |
| 125 | if ((ret = ff_formats_ref(formats, &ctx->inputs[i]->out_formats)) < 0) | 125 | if ((ret = ff_formats_ref(formats, &ctx->inputs[i]->outcfg.formats)) < 0) |
| 126 | return ret; | 126 | return ret; |
| 127 | 127 | ||
| 128 | formats = NULL; | 128 | formats = NULL; |
| 129 | if ((ret = ff_add_format(&formats, s->out_fmt)) < 0 || | 129 | if ((ret = ff_add_format(&formats, s->out_fmt)) < 0 || |
| 130 | (ret = ff_formats_ref(formats, &ctx->outputs[0]->in_formats)) < 0) | 130 | (ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) |
| 131 | return ret; | 131 | return ret; |
| 132 | 132 | ||
| 133 | return 0; | 133 | return 0; |
| @@ -261,12 +261,12 @@ static int query_formats(AVFilterContext *ctx) · 260 unmodified lines | |||
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | formats = ff_make_format_list(main_formats); | 263 | formats = ff_make_format_list(main_formats); |
| 264 | if ((ret = ff_formats_ref(formats, &ctx->inputs[MAIN]->out_formats)) < 0 || | 264 | if ((ret = ff_formats_ref(formats, &ctx->inputs[MAIN]->outcfg.formats)) < 0 || |
| 265 | (ret = ff_formats_ref(formats, &ctx->outputs[MAIN]->in_formats)) < 0) | 265 | (ret = ff_formats_ref(formats, &ctx->outputs[MAIN]->incfg.formats)) < 0) |
| 266 | return ret; | 266 | return ret; |
| 267 | 267 | ||
| 268 | return ff_formats_ref(ff_make_format_list(overlay_formats), | 268 | return ff_formats_ref(ff_make_format_list(overlay_formats), |
| 269 | &ctx->inputs[OVERLAY]->out_formats); | 269 | &ctx->inputs[OVERLAY]->outcfg.formats); |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | static int config_input_overlay(AVFilterLink *inlink) | 272 | static int config_input_overlay(AVFilterLink *inlink) |
| @@ -381,12 +381,12 @@ static int overlay_qsv_query_formats(AVFilterContext *ctx) · 380 unmodified lines | |||
| 381 | }; | 381 | }; |
| 382 | 382 | ||
| 383 | for (i = 0; i < ctx->nb_inputs; i++) { | 383 | for (i = 0; i < ctx->nb_inputs; i++) { |
| 384 | ret = ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->out_formats); | 384 | ret = ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->outcfg.formats); |
| 385 | if (ret < 0) | 385 | if (ret < 0) |
| 386 | return ret; | 386 | return ret; |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats); | 389 | ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->incfg.formats); |
| 390 | if (ret < 0) | 390 | if (ret < 0) |
| 391 | return ret; | 391 | return ret; |
| 392 | 392 | ||
| @@ -99,9 +99,9 @@ static int query_formats(AVFilterContext *ctx) · 98 unmodified lines | |||
| 99 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; | 99 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; |
| 100 | int ret; | 100 | int ret; |
| 101 | 101 | ||
| 102 | if ((ret = ff_formats_ref(ff_make_format_list(in_fmts) , &ctx->inputs[0]->out_formats)) < 0) | 102 | if ((ret = ff_formats_ref(ff_make_format_list(in_fmts) , &ctx->inputs[0]->outcfg.formats)) < 0) |
| 103 | return ret; | 103 | return ret; |
| 104 | if ((ret = ff_formats_ref(ff_make_format_list(out_fmts), &ctx->outputs[0]->in_formats)) < 0) | 104 | if ((ret = ff_formats_ref(ff_make_format_list(out_fmts), &ctx->outputs[0]->incfg.formats)) < 0) |
| 105 | return ret; | 105 | return ret; |
| 106 | return 0; | 106 | return 0; |
| 107 | } | 107 | } |
| @@ -143,11 +143,11 @@ static int query_formats(AVFilterContext *ctx) · 142 unmodified lines | |||
| 143 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}; | 143 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}; |
| 144 | int ret; | 144 | int ret; |
| 145 | if ((ret = ff_formats_ref(ff_make_format_list(in_fmts), | 145 | if ((ret = ff_formats_ref(ff_make_format_list(in_fmts), |
| 146 | &ctx->inputs[0]->out_formats)) < 0 || | 146 | &ctx->inputs[0]->outcfg.formats)) < 0 || |
| 147 | (ret = ff_formats_ref(ff_make_format_list(inpal_fmts), | 147 | (ret = ff_formats_ref(ff_make_format_list(inpal_fmts), |
| 148 | &ctx->inputs[1]->out_formats)) < 0 || | 148 | &ctx->inputs[1]->outcfg.formats)) < 0 || |
| 149 | (ret = ff_formats_ref(ff_make_format_list(out_fmts), | 149 | (ret = ff_formats_ref(ff_make_format_list(out_fmts), |
| 150 | &ctx->outputs[0]->in_formats)) < 0) | 150 | &ctx->outputs[0]->incfg.formats)) < 0) |
| 151 | return ret; | 151 | return ret; |
| 152 | return 0; | 152 | return 0; |
| 153 | } | 153 | } |
| @@ -116,14 +116,14 @@ static int query_formats(AVFilterContext *ctx) · 115 unmodified lines | |||
| 116 | int ret; | 116 | int ret; |
| 117 | 117 | ||
| 118 | pix_formats = ff_make_format_list(s->format ? gray_pix_fmts : pix_fmts); | 118 | pix_formats = ff_make_format_list(s->format ? gray_pix_fmts : pix_fmts); |
| 119 | if ((ret = ff_formats_ref(pix_formats, &ctx->inputs[0]->out_formats)) < 0 || | 119 | if ((ret = ff_formats_ref(pix_formats, &ctx->inputs[0]->outcfg.formats)) < 0 || |
| 120 | (ret = ff_formats_ref(pix_formats, &ctx->outputs[0]->in_formats)) < 0) | 120 | (ret = ff_formats_ref(pix_formats, &ctx->outputs[0]->incfg.formats)) < 0) |
| 121 | return ret; | 121 | return ret; |
| 122 | 122 | ||
| 123 | map_formats = ff_make_format_list(map_fmts); | 123 | map_formats = ff_make_format_list(map_fmts); |
| 124 | if ((ret = ff_formats_ref(map_formats, &ctx->inputs[1]->out_formats)) < 0) | 124 | if ((ret = ff_formats_ref(map_formats, &ctx->inputs[1]->outcfg.formats)) < 0) |
| 125 | return ret; | 125 | return ret; |
| 126 | return ff_formats_ref(map_formats, &ctx->inputs[2]->out_formats); | 126 | return ff_formats_ref(map_formats, &ctx->inputs[2]->outcfg.formats); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | /** | 129 | /** |
| @@ -358,7 +358,7 @@ static int query_formats(AVFilterContext *ctx) · 357 unmodified lines | |||
| 358 | return ret; | 358 | return ret; |
| 359 | } | 359 | } |
| 360 | } | 360 | } |
| 361 | if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->out_formats)) < 0) | 361 | if ((ret = ff_formats_ref(formats, &ctx->inputs[0]->outcfg.formats)) < 0) |
| 362 | return ret; | 362 | return ret; |
| 363 | } | 363 | } |
| 364 | if (ctx->outputs[0]) { | 364 | if (ctx->outputs[0]) { |
| @@ -372,7 +372,7 @@ static int query_formats(AVFilterContext *ctx) · 7 unmodified lines | |||
| 372 | return ret; | 372 | return ret; |
| 373 | } | 373 | } |
| 374 | } | 374 | } |
| 375 | if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->in_formats)) < 0) | 375 | if ((ret = ff_formats_ref(formats, &ctx->outputs[0]->incfg.formats)) < 0) |
| 376 | return ret; | 376 | return ret; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| @@ -47,12 +47,12 @@ static int query_formats(AVFilterContext *ctx) · 46 unmodified lines | |||
| 47 | static const enum AVPixelFormat in_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}; | 47 | static const enum AVPixelFormat in_fmts[] = {AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE}; |
| 48 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; | 48 | static const enum AVPixelFormat out_fmts[] = {AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE}; |
| 49 | int ret = ff_formats_ref(ff_make_format_list(in_fmts), | 49 | int ret = ff_formats_ref(ff_make_format_list(in_fmts), |
| 50 | &ctx->inputs[0]->out_formats); | 50 | &ctx->inputs[0]->outcfg.formats); |
| 51 | if (ret < 0) | 51 | if (ret < 0) |
| 52 | return ret; | 52 | return ret; |
| 53 | 53 | ||
| 54 | return ff_formats_ref(ff_make_format_list(out_fmts), | 54 | return ff_formats_ref(ff_make_format_list(out_fmts), |
| 55 | &ctx->outputs[0]->in_formats); | 55 | &ctx->outputs[0]->incfg.formats); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static int config_output(AVFilterLink *outlink) | 58 | static int config_output(AVFilterLink *outlink) |
| @@ -216,23 +216,23 @@ static int query_formats(AVFilterContext *ctx) · 215 unmodified lines | |||
| 216 | AVFilterFormats *avff; | 216 | AVFilterFormats *avff; |
| 217 | int depth, rgb, i, ret; | 217 | int depth, rgb, i, ret; |
| 218 | 218 | ||
| 219 | if (!ctx->inputs[0]->in_formats || | 219 | if (!ctx->inputs[0]->incfg.formats || |
| 220 | !ctx->inputs[0]->in_formats->nb_formats) { | 220 | !ctx->inputs[0]->incfg.formats->nb_formats) { |
| 221 | return AVERROR(EAGAIN); | 221 | return AVERROR(EAGAIN); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | if (!ctx->inputs[0]->out_formats) { | 224 | if (!ctx->inputs[0]->outcfg.formats) { |
| 225 | const enum AVPixelFormat *in_pix_fmts; | 225 | const enum AVPixelFormat *in_pix_fmts; |
| 226 | 226 | ||
| 227 | if ((s->x == 1 && s->y == 2) || (s->x == 2 && s->y == 1)) | 227 | if ((s->x == 1 && s->y == 2) || (s->x == 2 && s->y == 1)) |
| 228 | in_pix_fmts = in2_pix_fmts; | 228 | in_pix_fmts = in2_pix_fmts; |
| 229 | else | 229 | else |
| 230 | in_pix_fmts = in1_pix_fmts; | 230 | in_pix_fmts = in1_pix_fmts; |
| 231 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->out_formats)) < 0) | 231 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0) |
| 232 | return ret; | 232 | return ret; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | avff = ctx->inputs[0]->in_formats; | 235 | avff = ctx->inputs[0]->incfg.formats; |
| 236 | desc = av_pix_fmt_desc_get(avff->formats[0]); | 236 | desc = av_pix_fmt_desc_get(avff->formats[0]); |
| 237 | rgb = desc->flags & AV_PIX_FMT_FLAG_RGB; | 237 | rgb = desc->flags & AV_PIX_FMT_FLAG_RGB; |
| 238 | depth = desc->comp[0].depth; | 238 | depth = desc->comp[0].depth; |
| @@ -261,7 +261,7 @@ static int query_formats(AVFilterContext *ctx) · 22 unmodified lines | |||
| 261 | out_pix_fmts = out_yuv12_pix_fmts; | 261 | out_pix_fmts = out_yuv12_pix_fmts; |
| 262 | else | 262 | else |
| 263 | return AVERROR(EAGAIN); | 263 | return AVERROR(EAGAIN); |
| 264 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats)) < 0) | 264 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->incfg.formats)) < 0) |
| 265 | return ret; | 265 | return ret; |
| 266 | 266 | ||
| 267 | return 0; | 267 | return 0; |
| @@ -505,11 +505,11 @@ static int query_formats(AVFilterContext *ctx) · 504 unmodified lines | |||
| 505 | }; | 505 | }; |
| 506 | 506 | ||
| 507 | ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), | 507 | ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), |
| 508 | &ctx->inputs[0]->out_formats); | 508 | &ctx->inputs[0]->outcfg.formats); |
| 509 | if (ret < 0) | 509 | if (ret < 0) |
| 510 | return ret; | 510 | return ret; |
| 511 | return ff_formats_ref(ff_make_format_list(out_pix_fmts), | 511 | return ff_formats_ref(ff_make_format_list(out_pix_fmts), |
| 512 | &ctx->outputs[0]->in_formats); | 512 | &ctx->outputs[0]->incfg.formats); |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | static av_cold void vpp_uninit(AVFilterContext *ctx) | 515 | static av_cold void vpp_uninit(AVFilterContext *ctx) |
| @@ -319,8 +319,8 @@ static int query_formats(AVFilterContext *ctx) · 318 unmodified lines | |||
| 319 | AVFilterFormats *avff, *avff2; | 319 | AVFilterFormats *avff, *avff2; |
| 320 | int depth, depth2, rgb, i, ret, ncomp, ncomp2; | 320 | int depth, depth2, rgb, i, ret, ncomp, ncomp2; |
| 321 | 321 | ||
| 322 | if (!ctx->inputs[0]->in_formats || | 322 | if (!ctx->inputs[0]->incfg.formats || |
| 323 | !ctx->inputs[0]->in_formats->nb_formats) { | 323 | !ctx->inputs[0]->incfg.formats->nb_formats) { |
| 324 | return AVERROR(EAGAIN); | 324 | return AVERROR(EAGAIN); |
| 325 | } | 325 | } |
| 326 | 326 | ||
| @@ -336,13 +336,13 @@ static int query_formats(AVFilterContext *ctx) · 9 unmodified lines | |||
| 336 | default: return AVERROR_BUG; | 336 | default: return AVERROR_BUG; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | if (!ctx->inputs[0]->out_formats) { | 339 | if (!ctx->inputs[0]->outcfg.formats) { |
| 340 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->out_formats)) < 0) | 340 | if ((ret = ff_formats_ref(ff_make_format_list(in_pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0) |
| 341 | return ret; | 341 | return ret; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | avff = ctx->inputs[0]->in_formats; | 344 | avff = ctx->inputs[0]->incfg.formats; |
| 345 | avff2 = ctx->inputs[0]->out_formats; | 345 | avff2 = ctx->inputs[0]->outcfg.formats; |
| 346 | desc = av_pix_fmt_desc_get(avff->formats[0]); | 346 | desc = av_pix_fmt_desc_get(avff->formats[0]); |
| 347 | desc2 = av_pix_fmt_desc_get(avff2->formats[0]); | 347 | desc2 = av_pix_fmt_desc_get(avff2->formats[0]); |
| 348 | ncomp = desc->nb_components; | 348 | ncomp = desc->nb_components; |
| @@ -385,7 +385,7 @@ static int query_formats(AVFilterContext *ctx) · 36 unmodified lines | |||
| 385 | out_pix_fmts = out_yuv12_lowpass_pix_fmts; | 385 | out_pix_fmts = out_yuv12_lowpass_pix_fmts; |
| 386 | else | 386 | else |
| 387 | return AVERROR(EAGAIN); | 387 | return AVERROR(EAGAIN); |
| 388 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats)) < 0) | 388 | if ((ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->incfg.formats)) < 0) |
| 389 | return ret; | 389 | return ret; |
| 390 | 390 | ||
| 391 | return 0; | 391 | return 0; |
| @@ -216,10 +216,10 @@ static int deint_cuda_query_formats(AVFilterContext *ctx) · 215 unmodified lines | |||
| 216 | int ret; | 216 | int ret; |
| 217 | 217 | ||
| 218 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), | 218 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), |
| 219 | &ctx->inputs[0]->out_formats)) < 0) | 219 | &ctx->inputs[0]->outcfg.formats)) < 0) |
| 220 | return ret; | 220 | return ret; |
| 221 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), | 221 | if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), |
| 222 | &ctx->outputs[0]->in_formats)) < 0) | 222 | &ctx->outputs[0]->incfg.formats)) < 0) |
| 223 | return ret; | 223 | return ret; |
| 224 | 224 | ||
| 225 | return 0; | 225 | return 0; |
| @@ -187,10 +187,10 @@ static int query_formats(AVFilterContext *ctx) · 186 unmodified lines | |||
| 187 | }; | 187 | }; |
| 188 | int ret; | 188 | int ret; |
| 189 | 189 | ||
| 190 | ret = ff_formats_ref(ff_make_format_list(pixel_fmts), &ctx->inputs[0]->out_formats); | 190 | ret = ff_formats_ref(ff_make_format_list(pixel_fmts), &ctx->inputs[0]->outcfg.formats); |
| 191 | if (ret < 0) | 191 | if (ret < 0) |
| 192 | return ret; | 192 | return ret; |
| 193 | return ff_formats_ref(ff_make_format_list(pixel_fmts), &ctx->outputs[0]->in_formats); | 193 | return ff_formats_ref(ff_make_format_list(pixel_fmts), &ctx->outputs[0]->incfg.formats); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | static int config_props(AVFilterLink *outlink) | 196 | static int config_props(AVFilterLink *outlink) |