* commit 'b01f6041f4260fba053c2f96ce1611ea77e833a0': lavfi: rename AVFilterFormats.format_count to nb_formats Conflicts: libavfilter/avfiltergraph.c libavfilter/filtfmts.c libavfilter/formats.c
Showing the changes to libavfilter/avfiltergraph.c (1 of 6 files). Show all
Unified · Split
| @@ -503,28 +503,28 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 502 unmodified lines | |||
| 503 | int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; | 503 | int has_alpha= av_pix_fmt_desc_get(ref->format)->nb_components % 2 == 0; |
| 504 | enum AVPixelFormat best= AV_PIX_FMT_NONE; | 504 | enum AVPixelFormat best= AV_PIX_FMT_NONE; |
| 505 | int i; | 505 | int i; |
| 506 | for (i=0; i<link->in_formats->format_count; i++) { | 506 | for (i=0; i<link->in_formats->nb_formats; i++) { |
| 507 | enum AVPixelFormat p = link->in_formats->formats[i]; | 507 | enum AVPixelFormat p = link->in_formats->formats[i]; |
| 508 | best= avcodec_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL); | 508 | best= avcodec_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL); |
| 509 | } | 509 | } |
| 510 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n", | 510 | av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n", |
| 511 | av_get_pix_fmt_name(best), link->in_formats->format_count, | 511 | av_get_pix_fmt_name(best), link->in_formats->nb_formats, |
| 512 | av_get_pix_fmt_name(ref->format), has_alpha); | 512 | av_get_pix_fmt_name(ref->format), has_alpha); |
| 513 | link->in_formats->formats[0] = best; | 513 | link->in_formats->formats[0] = best; |
| 514 | } | 514 | } |
| 515 | } | 515 | } |
| 516 | 516 | ||
| 517 | link->in_formats->format_count = 1; | 517 | link->in_formats->nb_formats = 1; |
| 518 | link->format = link->in_formats->formats[0]; | 518 | link->format = link->in_formats->formats[0]; |
| 519 | 519 | ||
| 520 | if (link->type == AVMEDIA_TYPE_AUDIO) { | 520 | if (link->type == AVMEDIA_TYPE_AUDIO) { |
| 521 | if (!link->in_samplerates->format_count) { | 521 | if (!link->in_samplerates->nb_formats) { |
| 522 | av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for" | 522 | av_log(link->src, AV_LOG_ERROR, "Cannot select sample rate for" |
| 523 | " the link between filters %s and %s.\n", link->src->name, | 523 | " the link between filters %s and %s.\n", link->src->name, |
| 524 | link->dst->name); | 524 | link->dst->name); |
| 525 | return AVERROR(EINVAL); | 525 | return AVERROR(EINVAL); |
| 526 | } | 526 | } |
| 527 | link->in_samplerates->format_count = 1; | 527 | link->in_samplerates->nb_formats = 1; |
| 528 | link->sample_rate = link->in_samplerates->formats[0]; | 528 | link->sample_rate = link->in_samplerates->formats[0]; |
| 529 | 529 | ||
| 530 | if (link->in_channel_layouts->all_layouts) { | 530 | if (link->in_channel_layouts->all_layouts) { |
| @@ -591,9 +591,9 @@ static int reduce_formats_on_filter(AVFilterContext *filter) · 60 unmodified lines | |||
| 591 | int i, j, k, ret = 0; | 591 | int i, j, k, ret = 0; |
| 592 | 592 | ||
| 593 | REDUCE_FORMATS(int, AVFilterFormats, formats, formats, | 593 | REDUCE_FORMATS(int, AVFilterFormats, formats, formats, |
| 594 | format_count, ff_add_format); | 594 | nb_formats, ff_add_format); |
| 595 | REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats, | 595 | REDUCE_FORMATS(int, AVFilterFormats, samplerates, formats, |
| 596 | format_count, ff_add_format); | 596 | nb_formats, ff_add_format); |
| 597 | 597 | ||
| 598 | /* reduce channel layouts */ | 598 | /* reduce channel layouts */ |
| 599 | for (i = 0; i < filter->nb_inputs; i++) { | 599 | for (i = 0; i < filter->nb_inputs; i++) { |
| @@ -656,7 +656,7 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 56 unmodified lines | |||
| 656 | link = filter->inputs[i]; | 656 | link = filter->inputs[i]; |
| 657 | 657 | ||
| 658 | if (link->type == AVMEDIA_TYPE_AUDIO && | 658 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 659 | link->out_samplerates->format_count == 1) | 659 | link->out_samplerates->nb_formats== 1) |
| 660 | break; | 660 | break; |
| 661 | } | 661 | } |
| 662 | if (i == filter->nb_inputs) | 662 | if (i == filter->nb_inputs) |
| @@ -669,10 +669,10 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 6 unmodified lines | |||
| 669 | int best_idx, best_diff = INT_MAX; | 669 | int best_idx, best_diff = INT_MAX; |
| 670 | 670 | ||
| 671 | if (outlink->type != AVMEDIA_TYPE_AUDIO || | 671 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 672 | outlink->in_samplerates->format_count < 2) | 672 | outlink->in_samplerates->nb_formats < 2) |
| 673 | continue; | 673 | continue; |
| 674 | 674 | ||
| 675 | for (j = 0; j < outlink->in_samplerates->format_count; j++) { | 675 | for (j = 0; j < outlink->in_samplerates->nb_formats; j++) { |
| 676 | int diff = abs(sample_rate - outlink->in_samplerates->formats[j]); | 676 | int diff = abs(sample_rate - outlink->in_samplerates->formats[j]); |
| 677 | 677 | ||
| 678 | if (diff < best_diff) { | 678 | if (diff < best_diff) { |
| @@ -834,7 +834,7 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 155 unmodified lines | |||
| 834 | link = filter->inputs[i]; | 834 | link = filter->inputs[i]; |
| 835 | 835 | ||
| 836 | if (link->type == AVMEDIA_TYPE_AUDIO && | 836 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 837 | link->out_formats->format_count == 1) | 837 | link->out_formats->nb_formats == 1) |
| 838 | break; | 838 | break; |
| 839 | } | 839 | } |
| 840 | if (i == filter->nb_inputs) | 840 | if (i == filter->nb_inputs) |
| @@ -848,10 +848,10 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 7 unmodified lines | |||
| 848 | int best_idx = -1, best_score = INT_MIN; | 848 | int best_idx = -1, best_score = INT_MIN; |
| 849 | 849 | ||
| 850 | if (outlink->type != AVMEDIA_TYPE_AUDIO || | 850 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 851 | outlink->in_formats->format_count < 2) | 851 | outlink->in_formats->nb_formats < 2) |
| 852 | continue; | 852 | continue; |
| 853 | 853 | ||
| 854 | for (j = 0; j < outlink->in_formats->format_count; j++) { | 854 | for (j = 0; j < outlink->in_formats->nb_formats; j++) { |
| 855 | int out_format = outlink->in_formats->formats[j]; | 855 | int out_format = outlink->in_formats->formats[j]; |
| 856 | int out_bps = av_get_bytes_per_sample(out_format); | 856 | int out_bps = av_get_bytes_per_sample(out_format); |
| 857 | int score; | 857 | int score; |
| @@ -904,7 +904,7 @@ static int pick_formats(AVFilterGraph *graph) · 46 unmodified lines | |||
| 904 | AVFilterContext *filter = graph->filters[i]; | 904 | AVFilterContext *filter = graph->filters[i]; |
| 905 | if (filter->nb_inputs){ | 905 | if (filter->nb_inputs){ |
| 906 | for (j = 0; j < filter->nb_inputs; j++){ | 906 | for (j = 0; j < filter->nb_inputs; j++){ |
| 907 | if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->format_count == 1) { | 907 | if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->nb_formats == 1) { |
| 908 | if ((ret = pick_format(filter->inputs[j], NULL)) < 0) | 908 | if ((ret = pick_format(filter->inputs[j], NULL)) < 0) |
| 909 | return ret; | 909 | return ret; |
| 910 | change = 1; | 910 | change = 1; |
| @@ -913,7 +913,7 @@ static int pick_formats(AVFilterGraph *graph) · 2 unmodified lines | |||
| 913 | } | 913 | } |
| 914 | if (filter->nb_outputs){ | 914 | if (filter->nb_outputs){ |
| 915 | for (j = 0; j < filter->nb_outputs; j++){ | 915 | for (j = 0; j < filter->nb_outputs; j++){ |
| 916 | if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->format_count == 1) { | 916 | if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->nb_formats == 1) { |
| 917 | if ((ret = pick_format(filter->outputs[j], NULL)) < 0) | 917 | if ((ret = pick_format(filter->outputs[j], NULL)) < 0) |
| 918 | return ret; | 918 | return ret; |
| 919 | change = 1; | 919 | change = 1; |