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 | API changes, most recent first: | 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 | 2021-08-17 - xxxxxxxxxx - lavu 57.4.101 - opt.h | 20 | 2021-08-17 - xxxxxxxxxx - lavu 57.4.101 - opt.h |
| 18 | av_opt_copy() now guarantees that allocated src and dst options | 21 | av_opt_copy() now guarantees that allocated src and dst options |
| 19 | don't alias each other even on error. | 22 | don't alias each other even on error. |
| @@ -556,6 +556,11 @@ int avfilter_pad_count(const AVFilterPad *pads) · 555 unmodified lines | |||
| 556 | av_assert0(!"AVFilterPad list not from a filter"); | 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 | static const char *default_filter_name(void *filter_ctx) | 564 | static const char *default_filter_name(void *filter_ctx) |
| 560 | { | 565 | { |
| 561 | AVFilterContext *ctx = filter_ctx; | 566 | AVFilterContext *ctx = filter_ctx; |
| @@ -325,6 +325,11 @@ typedef struct AVFilter { · 324 unmodified lines | |||
| 325 | int (*activate)(AVFilterContext *ctx); | 325 | int (*activate)(AVFilterContext *ctx); |
| 326 | } AVFilter; | 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 | * Process multiple parts of the frame concurrently. | 334 | * Process multiple parts of the frame concurrently. |
| 330 | */ | 335 | */ |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | |||
| 30 | #include "libavutil/version.h" | 30 | #include "libavutil/version.h" |
| 31 | 31 | ||
| 32 | #define LIBAVFILTER_VERSION_MAJOR 8 | 32 | #define LIBAVFILTER_VERSION_MAJOR 8 |
| 33 | #define LIBAVFILTER_VERSION_MINOR 2 | 33 | #define LIBAVFILTER_VERSION_MINOR 3 |
| 34 | #define LIBAVFILTER_VERSION_MICRO 100 | 34 | #define LIBAVFILTER_VERSION_MICRO 100 |
| 35 | 35 | ||
| 36 | 36 | ||