* 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/avfilter.c (1 of 68 files). Show all
Unified · Split
| @@ -120,8 +120,8 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, · 119 unmodified lines | ||
| 120 | 120 | { |
| 121 | 121 | AVFilterLink *link; |
| 122 | 122 | |
| 123 | − if (src->output_count <= srcpad || dst->input_count <= dstpad || | |
| 124 | − src->outputs[srcpad] || dst->inputs[dstpad]) | |
| 123 | + if (src->nb_outputs <= srcpad || dst->nb_inputs <= dstpad || | |
| 124 | + src->outputs[srcpad] || dst->inputs[dstpad]) | |
| 125 | 125 | return -1; |
| 126 | 126 | |
| 127 | 127 | if (src->output_pads[srcpad].type != dst->input_pads[dstpad].type) { |
| @@ -200,9 +200,9 @@ int avfilter_config_links(AVFilterContext *filter) · 72 unmodified lines | ||
| 200 | 200 | unsigned i; |
| 201 | 201 | int ret; |
| 202 | 202 | |
| 203 | − for (i = 0; i < filter->input_count; i ++) { | |
| 203 | + for (i = 0; i < filter->nb_inputs; i ++) { | |
| 204 | 204 | AVFilterLink *link = filter->inputs[i]; |
| 205 | − AVFilterLink *inlink = link->src->input_count ? | |
| 205 | + AVFilterLink *inlink = link->src->nb_inputs ? | |
| 206 | 206 | link->src->inputs[0] : NULL; |
| 207 | 207 | |
| 208 | 208 | if (!link) continue; |
| @@ -222,7 +222,7 @@ int avfilter_config_links(AVFilterContext *filter) · 13 unmodified lines | ||
| 222 | 222 | return ret; |
| 223 | 223 | |
| 224 | 224 | if (!(config_link = link->srcpad->config_props)) { |
| 225 | − if (link->src->input_count != 1) { | |
| 225 | + if (link->src->nb_inputs != 1) { | |
| 226 | 226 | av_log(link->src, AV_LOG_ERROR, "Source filters and filters " |
| 227 | 227 | "with more than one input " |
| 228 | 228 | "must set config_props() " |
| @@ -335,7 +335,7 @@ int ff_poll_frame(AVFilterLink *link) · 106 unmodified lines | ||
| 335 | 335 | if (link->srcpad->poll_frame) |
| 336 | 336 | return link->srcpad->poll_frame(link); |
| 337 | 337 | |
| 338 | − for (i = 0; i < link->src->input_count; i++) { | |
| 338 | + for (i = 0; i < link->src->nb_inputs; i++) { | |
| 339 | 339 | int val; |
| 340 | 340 | if (!link->src->inputs[i]) |
| 341 | 341 | return -1; |
| @@ -450,27 +450,31 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in · 108 unmodified lines | ||
| 450 | 450 | goto err; |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | − ret->input_count = pad_count(filter->inputs); | |
| 454 | − if (ret->input_count) { | |
| 455 | − ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->input_count); | |
| 453 | + ret->nb_inputs = pad_count(filter->inputs); | |
| 454 | + if (ret->nb_inputs ) { | |
| 455 | + ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_inputs); | |
| 456 | 456 | if (!ret->input_pads) |
| 457 | 457 | goto err; |
| 458 | − memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->input_count); | |
| 459 | − ret->inputs = av_mallocz(sizeof(AVFilterLink*) * ret->input_count); | |
| 458 | + memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->nb_inputs); | |
| 459 | + ret->inputs = av_mallocz(sizeof(AVFilterLink*) * ret->nb_inputs); | |
| 460 | 460 | if (!ret->inputs) |
| 461 | 461 | goto err; |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | − ret->output_count = pad_count(filter->outputs); | |
| 465 | − if (ret->output_count) { | |
| 466 | − ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->output_count); | |
| 464 | + ret->nb_outputs = pad_count(filter->outputs); | |
| 465 | + if (ret->nb_outputs) { | |
| 466 | + ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_outputs); | |
| 467 | 467 | if (!ret->output_pads) |
| 468 | 468 | goto err; |
| 469 | − memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->output_count); | |
| 470 | − ret->outputs = av_mallocz(sizeof(AVFilterLink*) * ret->output_count); | |
| 469 | + memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->nb_outputs); | |
| 470 | + ret->outputs = av_mallocz(sizeof(AVFilterLink*) * ret->nb_outputs); | |
| 471 | 471 | if (!ret->outputs) |
| 472 | 472 | goto err; |
| 473 | 473 | } |
| 474 | +#if FF_API_FOO_COUNT | |
| 475 | + ret->output_count = ret->nb_outputs; | |
| 476 | + ret->input_count = ret->nb_inputs; | |
| 477 | +#endif | |
| 474 | 478 | |
| 475 | 479 | *filter_ctx = ret; |
| 476 | 480 | return 0; |
| @@ -478,10 +482,10 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in · 1 unmodified line | ||
| 478 | 482 | err: |
| 479 | 483 | av_freep(&ret->inputs); |
| 480 | 484 | av_freep(&ret->input_pads); |
| 481 | − ret->input_count = 0; | |
| 485 | + ret->nb_inputs = 0; | |
| 482 | 486 | av_freep(&ret->outputs); |
| 483 | 487 | av_freep(&ret->output_pads); |
| 484 | − ret->output_count = 0; | |
| 488 | + ret->nb_outputs = 0; | |
| 485 | 489 | av_freep(&ret->priv); |
| 486 | 490 | av_free(ret); |
| 487 | 491 | return AVERROR(ENOMEM); |
| @@ -498,7 +502,7 @@ void avfilter_free(AVFilterContext *filter) · 10 unmodified lines | ||
| 498 | 502 | if (filter->filter->uninit) |
| 499 | 503 | filter->filter->uninit(filter); |
| 500 | 504 | |
| 501 | − for (i = 0; i < filter->input_count; i++) { | |
| 505 | + for (i = 0; i < filter->nb_inputs; i++) { | |
| 502 | 506 | if ((link = filter->inputs[i])) { |
| 503 | 507 | if (link->src) |
| 504 | 508 | link->src->outputs[link->srcpad - link->src->output_pads] = NULL; |
| @@ -511,7 +515,7 @@ void avfilter_free(AVFilterContext *filter) · 6 unmodified lines | ||
| 511 | 515 | } |
| 512 | 516 | avfilter_link_free(&link); |
| 513 | 517 | } |
| 514 | − for (i = 0; i < filter->output_count; i++) { | |
| 518 | + for (i = 0; i < filter->nb_outputs; i++) { | |
| 515 | 519 | if ((link = filter->outputs[i])) { |
| 516 | 520 | if (link->dst) |
| 517 | 521 | link->dst->inputs[link->dstpad - link->dst->input_pads] = NULL; |
| @@ -546,6 +550,16 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque · 28 unmodified lines | ||
| 546 | 550 | return ret; |
| 547 | 551 | } |
| 548 | 552 | |
| 553 | +const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx) | |
| 554 | +{ | |
| 555 | + return pads[pad_idx].name; | |
| 556 | +} | |
| 557 | + | |
| 558 | +enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx) | |
| 559 | +{ | |
| 560 | + return pads[pad_idx].type; | |
| 561 | +} | |
| 562 | + | |
| 549 | 563 | #if FF_API_DEFAULT_CONFIG_OUTPUT_LINK |
| 550 | 564 | void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, |
| 551 | 565 | AVFilterPad **pads, AVFilterLink ***links, |
| @@ -556,14 +570,20 @@ void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, · 4 unmodified lines | ||
| 556 | 570 | void avfilter_insert_inpad(AVFilterContext *f, unsigned index, |
| 557 | 571 | AVFilterPad *p) |
| 558 | 572 | { |
| 559 | − ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), | |
| 573 | + ff_insert_pad(index, &f->nb_inputs, offsetof(AVFilterLink, dstpad), | |
| 560 | 574 | &f->input_pads, &f->inputs, p); |
| 575 | +#if FF_API_FOO_COUNT | |
| 576 | + f->input_count = f->nb_inputs; | |
| 577 | +#endif | |
| 561 | 578 | } |
| 562 | 579 | void avfilter_insert_outpad(AVFilterContext *f, unsigned index, |
| 563 | 580 | AVFilterPad *p) |
| 564 | 581 | { |
| 565 | − ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), | |
| 582 | + ff_insert_pad(index, &f->nb_outputs, offsetof(AVFilterLink, srcpad), | |
| 566 | 583 | &f->output_pads, &f->outputs, p); |
| 584 | +#if FF_API_FOO_COUNT | |
| 585 | + f->output_count = f->nb_outputs; | |
| 586 | +#endif | |
| 567 | 587 | } |
| 568 | 588 | int avfilter_poll_frame(AVFilterLink *link) |
| 569 | 589 | { |