It is intended as replacement for avfilter_pad_count(). In contrast to the latter, it avoids a loop.
Showing the changes to libavfilter (3 of 4 files). Show all
Unified · Split
| @@ -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 | ||