It is intended as replacement for avfilter_pad_count(). In contrast to the latter, it avoids a loop.
Unified · Split
| @@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | API changes, most recent first: |
| 16 | 16 | |
| 17 | +2021-08-20 - xxxxxxxxxx - lavfi 8.3.100 - avfilter.H | |
| 18 | + Add avfilter_filter_pad_count() as a replacement for avfilter_pad_count(). | |
| 19 | + | |
| 17 | 20 | 2021-08-17 - xxxxxxxxxx - lavu 57.4.101 - opt.h |
| 18 | 21 | av_opt_copy() now guarantees that allocated src and dst options |
| 19 | 22 | don't alias each other even on error. |
| @@ -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; |
| @@ -325,6 +325,11 @@ typedef struct AVFilter { · 324 unmodified lines | ||
| 325 | 325 | int (*activate)(AVFilterContext *ctx); |
| 326 | 326 | } AVFilter; |
| 327 | 327 | |
| 328 | +/** | |
| 329 | + * Get the number of elements in an AVFilter's inputs or outputs array. | |
| 330 | + */ | |
| 331 | +unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output); | |
| 332 | + | |
| 328 | 333 | /** |
| 329 | 334 | * Process multiple parts of the frame concurrently. |
| 330 | 335 | */ |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include "libavutil/version.h" |
| 31 | 31 | |
| 32 | 32 | #define LIBAVFILTER_VERSION_MAJOR 8 |
| 33 | −#define LIBAVFILTER_VERSION_MINOR 2 | |
| 33 | +#define LIBAVFILTER_VERSION_MINOR 3 | |
| 34 | 34 | #define LIBAVFILTER_VERSION_MICRO 100 |
| 35 | 35 | |
| 36 | 36 | |