* commit '7e8fe4be5fb4c98aa3c6a4ed3cec999f4e3cc3aa': lavfi: add a function for counting elements in AVFilterPad arrays.
Unified · Split
| @@ -170,6 +170,7 @@ API changes, most recent first: · 169 unmodified lines | ||
| 170 | 170 | Add avfilter_init_str(), deprecate avfilter_init_filter(). |
| 171 | 171 | Add avfilter_init_dict(). |
| 172 | 172 | Add AVFilter.flags field and AVFILTER_FLAG_DYNAMIC_{INPUTS,OUTPUTS} flags. |
| 173 | + Add avfilter_pad_count() for counting filter inputs/outputs. | |
| 173 | 174 | |
| 174 | 175 | 2013-xx-xx - lavfi 3.7.0 - avfilter.h |
| 175 | 176 | Add AVFilter.priv_class for exporting filter options through the AVOptions API |
| @@ -436,7 +436,7 @@ void avfilter_uninit(void) · 435 unmodified lines | ||
| 436 | 436 | next_registered_avfilter_idx = 0; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | −static int pad_count(const AVFilterPad *pads) | |
| 439 | +int avfilter_pad_count(const AVFilterPad *pads) | |
| 440 | 440 | { |
| 441 | 441 | int count; |
| 442 | 442 | |
| @@ -515,7 +515,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) · 72 unmodified lines | ||
| 515 | 515 | av_opt_set_defaults(ret->priv); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | − ret->nb_inputs = pad_count(filter->inputs); | |
| 518 | + ret->nb_inputs = avfilter_pad_count(filter->inputs); | |
| 519 | 519 | if (ret->nb_inputs ) { |
| 520 | 520 | ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_inputs); |
| 521 | 521 | if (!ret->input_pads) |
| @@ -526,7 +526,7 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name) · 4 unmodified lines | ||
| 526 | 526 | goto err; |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | − ret->nb_outputs = pad_count(filter->outputs); | |
| 529 | + ret->nb_outputs = avfilter_pad_count(filter->outputs); | |
| 530 | 530 | if (ret->nb_outputs) { |
| 531 | 531 | ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->nb_outputs); |
| 532 | 532 | if (!ret->output_pads) |
| @@ -388,6 +388,12 @@ struct AVFilterPad { · 387 unmodified lines | ||
| 388 | 388 | }; |
| 389 | 389 | #endif |
| 390 | 390 | |
| 391 | +/** | |
| 392 | + * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. | |
| 393 | + * AVFilter.inputs/outputs). | |
| 394 | + */ | |
| 395 | +int avfilter_pad_count(const AVFilterPad *pads); | |
| 396 | + | |
| 391 | 397 | /** |
| 392 | 398 | * Get the name of an AVFilterPad. |
| 393 | 399 | * |