* qatar/master: rtmp: Add a new option 'rtmp_buffer', for setting the client buffer time rtmp: Set the client buffer time to 3s instead of 0.26s rtmp: Handle server bandwidth packets rtmp: Display a verbose message when an unknown packet type is received lavfi/audio: use av_samples_copy() instead of custom code. configure: add all filters hardcoded into avconv to avconv_deps avfiltergraph: remove a redundant call to avfilter_get_by_name(). lavfi: allow building without swscale. build: Do not delete tests/vsynth2 directory, which is no longer created. lavfi: replace AVFilterContext.input/output_count with nb_inputs/outputs lavfi: make AVFilterPad opaque after two major bumps. lavfi: add avfilter_pad_get_type() and avfilter_pad_get_name(). lavfi: make avfilter_get_video_buffer() private on next bump. jack: update to new latency range API as the old one has been deprecated rtmp: Tokenize the AMF connection parameters manually instead of using strtok_r ppc: Rename H.264 optimization template file for consistency. lavfi: add channelsplit audio filter. golomb: check remaining bits during unary decoding in get_ur_golomb_jpegls() sws: fix planar RGB input conversions for 9/10/16 bpp. Conflicts: Changelog configure doc/APIchanges ffmpeg.c libavcodec/golomb.h libavcodec/v210dec.h libavfilter/Makefile libavfilter/allfilters.c libavfilter/asrc_anullsrc.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/avfiltergraph.c libavfilter/buffersrc.c libavfilter/formats.c libavfilter/version.h libavfilter/vf_frei0r.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavfilter/video.h libavfilter/vsrc_color.c libavformat/rtmpproto.c libswscale/input.c tests/Makefile
Showing the changes to libavfilter/avfiltergraph.c (1 of 68 files). Show all
Unified · Split
| @@ -118,7 +118,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 117 unmodified lines | ||
| 118 | 118 | for (i = 0; i < graph->filter_count; i++) { |
| 119 | 119 | filt = graph->filters[i]; |
| 120 | 120 | |
| 121 | − for (j = 0; j < filt->input_count; j++) { | |
| 121 | + for (j = 0; j < filt->nb_inputs; j++) { | |
| 122 | 122 | if (!filt->inputs[j] || !filt->inputs[j]->src) { |
| 123 | 123 | av_log(log_ctx, AV_LOG_ERROR, |
| 124 | 124 | "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n", |
| @@ -127,7 +127,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 2 unmodified lines | ||
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | − for (j = 0; j < filt->output_count; j++) { | |
| 130 | + for (j = 0; j < filt->nb_outputs; j++) { | |
| 131 | 131 | if (!filt->outputs[j] || !filt->outputs[j]->dst) { |
| 132 | 132 | av_log(log_ctx, AV_LOG_ERROR, |
| 133 | 133 | "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n", |
| @@ -153,7 +153,7 @@ static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx) · 19 unmodified lines | ||
| 153 | 153 | for (i=0; i < graph->filter_count; i++) { |
| 154 | 154 | filt = graph->filters[i]; |
| 155 | 155 | |
| 156 | − if (!filt->output_count) { | |
| 156 | + if (!filt->nb_outputs) { | |
| 157 | 157 | if ((ret = avfilter_config_links(filt))) |
| 158 | 158 | return ret; |
| 159 | 159 | } |
| @@ -271,7 +271,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 111 unmodified lines | ||
| 271 | 271 | /* Call query_formats on sources first. |
| 272 | 272 | This is a temporary workaround for amerge, |
| 273 | 273 | until format renegociation is implemented. */ |
| 274 | − if (!graph->filters[i]->input_count == j) | |
| 274 | + if (!graph->filters[i]->nb_inputs == j) | |
| 275 | 275 | continue; |
| 276 | 276 | if (graph->filters[i]->filter->query_formats) |
| 277 | 277 | ret = filter_query_formats(graph->filters[i]); |
| @@ -286,7 +286,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 8 unmodified lines | ||
| 286 | 286 | for (i = 0; i < graph->filter_count; i++) { |
| 287 | 287 | AVFilterContext *filter = graph->filters[i]; |
| 288 | 288 | |
| 289 | − for (j = 0; j < filter->input_count; j++) { | |
| 289 | + for (j = 0; j < filter->nb_inputs; j++) { | |
| 290 | 290 | AVFilterLink *link = filter->inputs[j]; |
| 291 | 291 | #if 0 |
| 292 | 292 | if (!link) continue; |
| @@ -348,11 +348,16 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 55 unmodified lines | ||
| 348 | 348 | /* couldn't merge format lists. auto-insert conversion filter */ |
| 349 | 349 | switch (link->type) { |
| 350 | 350 | case AVMEDIA_TYPE_VIDEO: |
| 351 | + if (!(filter = avfilter_get_by_name("scale"))) { | |
| 352 | + av_log(log_ctx, AV_LOG_ERROR, "'scale' filter " | |
| 353 | + "not present, cannot convert pixel formats.\n"); | |
| 354 | + return AVERROR(EINVAL); | |
| 355 | + } | |
| 356 | + | |
| 351 | 357 | snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d", |
| 352 | 358 | scaler_count++); |
| 353 | 359 | snprintf(scale_args, sizeof(scale_args), "0:0:%s", graph->scale_sws_opts); |
| 354 | − if ((ret = avfilter_graph_create_filter(&convert, | |
| 355 | − avfilter_get_by_name("scale"), | |
| 360 | + if ((ret = avfilter_graph_create_filter(&convert, filter, | |
| 356 | 361 | inst_name, scale_args, NULL, |
| 357 | 362 | graph)) < 0) |
| 358 | 363 | return ret; |
| @@ -366,8 +371,7 @@ static int query_formats(AVFilterGraph *graph, AVClass *log_ctx) · 7 unmodified lines | ||
| 366 | 371 | |
| 367 | 372 | snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d", |
| 368 | 373 | resampler_count++); |
| 369 | − if ((ret = avfilter_graph_create_filter(&convert, | |
| 370 | − avfilter_get_by_name("aresample"), | |
| 374 | + if ((ret = avfilter_graph_create_filter(&convert, filter, | |
| 371 | 375 | inst_name, NULL, NULL, graph)) < 0) |
| 372 | 376 | return ret; |
| 373 | 377 | break; |
| @@ -464,7 +468,7 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) · 90 unmodified lines | ||
| 464 | 468 | |
| 465 | 469 | #define REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format) \ |
| 466 | 470 | do { \ |
| 467 | − for (i = 0; i < filter->input_count; i++) { \ | |
| 471 | + for (i = 0; i < filter->nb_inputs; i++) { \ | |
| 468 | 472 | AVFilterLink *link = filter->inputs[i]; \ |
| 469 | 473 | fmt_type fmt; \ |
| 470 | 474 | \ |
| @@ -472,7 +476,7 @@ do { \ · 1 unmodified line | ||
| 472 | 476 | continue; \ |
| 473 | 477 | fmt = link->out_ ## list->var[0]; \ |
| 474 | 478 | \ |
| 475 | − for (j = 0; j < filter->output_count; j++) { \ | |
| 479 | + for (j = 0; j < filter->nb_outputs; j++) { \ | |
| 476 | 480 | AVFilterLink *out_link = filter->outputs[j]; \ |
| 477 | 481 | list_type *fmts; \ |
| 478 | 482 | \ |
| @@ -529,19 +533,19 @@ static void swap_samplerates_on_filter(AVFilterContext *filter) · 50 unmodified lines | ||
| 529 | 533 | int sample_rate; |
| 530 | 534 | int i, j; |
| 531 | 535 | |
| 532 | − for (i = 0; i < filter->input_count; i++) { | |
| 536 | + for (i = 0; i < filter->nb_inputs; i++) { | |
| 533 | 537 | link = filter->inputs[i]; |
| 534 | 538 | |
| 535 | 539 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 536 | 540 | link->out_samplerates->format_count == 1) |
| 537 | 541 | break; |
| 538 | 542 | } |
| 539 | − if (i == filter->input_count) | |
| 543 | + if (i == filter->nb_inputs) | |
| 540 | 544 | return; |
| 541 | 545 | |
| 542 | 546 | sample_rate = link->out_samplerates->formats[0]; |
| 543 | 547 | |
| 544 | − for (i = 0; i < filter->output_count; i++) { | |
| 548 | + for (i = 0; i < filter->nb_outputs; i++) { | |
| 545 | 549 | AVFilterLink *outlink = filter->outputs[i]; |
| 546 | 550 | int best_idx, best_diff = INT_MAX; |
| 547 | 551 | |
| @@ -576,19 +580,19 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 28 unmodified lines | ||
| 576 | 580 | uint64_t chlayout; |
| 577 | 581 | int i, j; |
| 578 | 582 | |
| 579 | − for (i = 0; i < filter->input_count; i++) { | |
| 583 | + for (i = 0; i < filter->nb_inputs; i++) { | |
| 580 | 584 | link = filter->inputs[i]; |
| 581 | 585 | |
| 582 | 586 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 583 | 587 | link->out_channel_layouts->nb_channel_layouts == 1) |
| 584 | 588 | break; |
| 585 | 589 | } |
| 586 | − if (i == filter->input_count) | |
| 590 | + if (i == filter->nb_inputs) | |
| 587 | 591 | return; |
| 588 | 592 | |
| 589 | 593 | chlayout = link->out_channel_layouts->channel_layouts[0]; |
| 590 | 594 | |
| 591 | − for (i = 0; i < filter->output_count; i++) { | |
| 595 | + for (i = 0; i < filter->nb_outputs; i++) { | |
| 592 | 596 | AVFilterLink *outlink = filter->outputs[i]; |
| 593 | 597 | int best_idx, best_score = INT_MIN; |
| 594 | 598 | |
| @@ -629,20 +633,20 @@ static void swap_sample_fmts_on_filter(AVFilterContext *filter) · 34 unmodified lines | ||
| 629 | 633 | int format, bps; |
| 630 | 634 | int i, j; |
| 631 | 635 | |
| 632 | − for (i = 0; i < filter->input_count; i++) { | |
| 636 | + for (i = 0; i < filter->nb_inputs; i++) { | |
| 633 | 637 | link = filter->inputs[i]; |
| 634 | 638 | |
| 635 | 639 | if (link->type == AVMEDIA_TYPE_AUDIO && |
| 636 | 640 | link->out_formats->format_count == 1) |
| 637 | 641 | break; |
| 638 | 642 | } |
| 639 | − if (i == filter->input_count) | |
| 643 | + if (i == filter->nb_inputs) | |
| 640 | 644 | return; |
| 641 | 645 | |
| 642 | 646 | format = link->out_formats->formats[0]; |
| 643 | 647 | bps = av_get_bytes_per_sample(format); |
| 644 | 648 | |
| 645 | − for (i = 0; i < filter->output_count; i++) { | |
| 649 | + for (i = 0; i < filter->nb_outputs; i++) { | |
| 646 | 650 | AVFilterLink *outlink = filter->outputs[i]; |
| 647 | 651 | int best_idx, best_score = INT_MIN; |
| 648 | 652 | |
| @@ -700,24 +704,24 @@ static int pick_formats(AVFilterGraph *graph) · 51 unmodified lines | ||
| 700 | 704 | change = 0; |
| 701 | 705 | for (i = 0; i < graph->filter_count; i++) { |
| 702 | 706 | AVFilterContext *filter = graph->filters[i]; |
| 703 | − if (filter->input_count){ | |
| 704 | − for (j = 0; j < filter->input_count; j++){ | |
| 707 | + if (filter->nb_inputs){ | |
| 708 | + for (j = 0; j < filter->nb_inputs; j++){ | |
| 705 | 709 | if(filter->inputs[j]->in_formats && filter->inputs[j]->in_formats->format_count == 1) { |
| 706 | 710 | pick_format(filter->inputs[j], NULL); |
| 707 | 711 | change = 1; |
| 708 | 712 | } |
| 709 | 713 | } |
| 710 | 714 | } |
| 711 | − if (filter->output_count){ | |
| 712 | − for (j = 0; j < filter->output_count; j++){ | |
| 715 | + if (filter->nb_outputs){ | |
| 716 | + for (j = 0; j < filter->nb_outputs; j++){ | |
| 713 | 717 | if(filter->outputs[j]->in_formats && filter->outputs[j]->in_formats->format_count == 1) { |
| 714 | 718 | pick_format(filter->outputs[j], NULL); |
| 715 | 719 | change = 1; |
| 716 | 720 | } |
| 717 | 721 | } |
| 718 | 722 | } |
| 719 | − if (filter->input_count && filter->output_count && filter->inputs[0]->format>=0) { | |
| 720 | − for (j = 0; j < filter->output_count; j++) { | |
| 723 | + if (filter->nb_inputs && filter->nb_outputs && filter->inputs[0]->format>=0) { | |
| 724 | + for (j = 0; j < filter->nb_outputs; j++) { | |
| 721 | 725 | if(filter->outputs[j]->format<0) { |
| 722 | 726 | pick_format(filter->outputs[j], filter->inputs[0]); |
| 723 | 727 | change = 1; |
| @@ -730,10 +734,10 @@ static int pick_formats(AVFilterGraph *graph) · 6 unmodified lines | ||
| 730 | 734 | for (i = 0; i < graph->filter_count; i++) { |
| 731 | 735 | AVFilterContext *filter = graph->filters[i]; |
| 732 | 736 | |
| 733 | − for (j = 0; j < filter->input_count; j++) | |
| 737 | + for (j = 0; j < filter->nb_inputs; j++) | |
| 734 | 738 | if ((ret = pick_format(filter->inputs[j], NULL)) < 0) |
| 735 | 739 | return ret; |
| 736 | − for (j = 0; j < filter->output_count; j++) | |
| 740 | + for (j = 0; j < filter->nb_outputs; j++) | |
| 737 | 741 | if ((ret = pick_format(filter->outputs[j], NULL)) < 0) |
| 738 | 742 | return ret; |
| 739 | 743 | } |
| @@ -778,18 +782,18 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph, · 38 unmodified lines | ||
| 778 | 782 | |
| 779 | 783 | for (i = 0; i < graph->filter_count; i++) { |
| 780 | 784 | f = graph->filters[i]; |
| 781 | − for (j = 0; j < f->input_count; j++) { | |
| 785 | + for (j = 0; j < f->nb_inputs; j++) { | |
| 782 | 786 | f->inputs[j]->graph = graph; |
| 783 | 787 | f->inputs[j]->age_index = -1; |
| 784 | 788 | } |
| 785 | − for (j = 0; j < f->output_count; j++) { | |
| 789 | + for (j = 0; j < f->nb_outputs; j++) { | |
| 786 | 790 | f->outputs[j]->graph = graph; |
| 787 | 791 | f->outputs[j]->age_index= -1; |
| 788 | 792 | } |
| 789 | − if (!f->output_count) { | |
| 790 | − if (f->input_count > INT_MAX - sink_links_count) | |
| 793 | + if (!f->nb_outputs) { | |
| 794 | + if (f->nb_inputs > INT_MAX - sink_links_count) | |
| 791 | 795 | return AVERROR(EINVAL); |
| 792 | − sink_links_count += f->input_count; | |
| 796 | + sink_links_count += f->nb_inputs; | |
| 793 | 797 | } |
| 794 | 798 | } |
| 795 | 799 | sinks = av_calloc(sink_links_count, sizeof(*sinks)); |
| @@ -797,8 +801,8 @@ static int ff_avfilter_graph_config_pointers(AVFilterGraph *graph, · 1 unmodified line | ||
| 797 | 801 | return AVERROR(ENOMEM); |
| 798 | 802 | for (i = 0; i < graph->filter_count; i++) { |
| 799 | 803 | f = graph->filters[i]; |
| 800 | − if (!f->output_count) { | |
| 801 | − for (j = 0; j < f->input_count; j++) { | |
| 804 | + if (!f->nb_outputs) { | |
| 805 | + for (j = 0; j < f->nb_inputs; j++) { | |
| 802 | 806 | sinks[n] = f->inputs[j]; |
| 803 | 807 | f->inputs[j]->age_index = n++; |
| 804 | 808 | } |