History

avfilter/avfilter: Add avfilter_filter_pad_count()

It is intended as replacement for avfilter_pad_count(). In contrast to the latter, it avoids a loop.

Andreas Rheinhardt committed 5 years ago

Commit 7c5f9981 parent 8be701d4 files · +14 −1Browse files

Showing the changes to libavfilter (3 of 4 files). Show all

Unified · Split

3 files
  1. libavfilter/avfilter.c +5 −0
  2. libavfilter/avfilter.h +5 −0
  3. libavfilter/version.h +1 −1
libavfilter/avfilter.c+5−0
@@ -556,6 +556,11 @@ int avfilter_pad_count(const AVFilterPad *pads) · 555 unmodified lines
556556 av_assert0(!"AVFilterPad list not from a filter");
557557 }
558558
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+
559564 static const char *default_filter_name(void *filter_ctx)
560565 {
561566 AVFilterContext *ctx = filter_ctx;
libavfilter/avfilter.h+5−0
@@ -325,6 +325,11 @@ typedef struct AVFilter { · 324 unmodified lines
325325 int (*activate)(AVFilterContext *ctx);
326326 } AVFilter;
327327
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+
328333 /**
329334 * Process multiple parts of the frame concurrently.
330335 */
libavfilter/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 #include "libavutil/version.h"
3131
3232 #define LIBAVFILTER_VERSION_MAJOR 8
33−#define LIBAVFILTER_VERSION_MINOR 2
33+#define LIBAVFILTER_VERSION_MINOR 3
3434 #define LIBAVFILTER_VERSION_MICRO 100
3535
3636

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t