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