It is intended as replacement for avfilter_pad_count(). In contrast to the latter, it avoids a loop.
Showing the changes to libavfilter/avfilter.c (1 of 4 files). Show all
Unified · Split
| @@ -556,6 +556,11 @@ int avfilter_pad_count(const AVFilterPad *pads) · 555 unmodified lines | ||
| 556 | 556 | av_assert0(!"AVFilterPad list not from a filter"); |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | +unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output) | |
| 560 | +{ | |
| 561 | + return is_output ? filter->nb_outputs : filter->nb_inputs; | |
| 562 | +} | |
| 563 | + | |
| 559 | 564 | static const char *default_filter_name(void *filter_ctx) |
| 560 | 565 | { |
| 561 | 566 | AVFilterContext *ctx = filter_ctx; |