Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions av/filter/pad.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ cdef tuple alloc_filter_pads(Filter filter, const lib.AVFilterPad *ptr, bint is_
cdef int i = 0
cdef int count
if context is None:
# This is a custom function defined using a macro in avfilter.pxd. Its usage
# can be changed after we stop supporting FFmpeg < 5.0.
count = lib.pyav_get_num_pads(filter.ptr, not is_input, ptr)
count = lib.avfilter_filter_pad_count(filter.ptr, not is_input)
else:
count = (context.ptr.nb_inputs if is_input else context.ptr.nb_outputs)

Expand Down
15 changes: 1 addition & 14 deletions include/libavfilter/avfilter.pxd
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@

cdef extern from "libavfilter/avfilter.h" nogil:
"""
#if (LIBAVFILTER_VERSION_INT >= 525156)
// avfilter_filter_pad_count is available since version 8.3.100 of libavfilter (FFmpeg 5.0)
#define _avfilter_get_num_pads(filter, is_output, pads) (avfilter_filter_pad_count(filter, is_output))
#else
// avfilter_filter_pad_count has been deprecated as of version 8.3.100 of libavfilter (FFmpeg 5.0)
#define _avfilter_get_num_pads(filter, is_output, pads) (avfilter_pad_count(pads))
#endif
"""
cdef int avfilter_version()
cdef char* avfilter_configuration()
cdef char* avfilter_license()
Expand All @@ -20,10 +10,9 @@ cdef extern from "libavfilter/avfilter.h" nogil:
const char* avfilter_pad_get_name(const AVFilterPad *pads, int index)
AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int index)

int pyav_get_num_pads "_avfilter_get_num_pads" (const AVFilter *filter, int is_output, const AVFilterPad *pads)
cdef unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output)

cdef struct AVFilter:

AVClass *priv_class

const char *name
Expand All @@ -48,7 +37,6 @@ cdef extern from "libavfilter/avfilter.h" nogil:
cdef struct AVFilterLink # Defined later.

cdef struct AVFilterContext:

AVClass *av_class
AVFilter *filter

Expand All @@ -68,7 +56,6 @@ cdef extern from "libavfilter/avfilter.h" nogil:
cdef AVClass* avfilter_get_class()

cdef struct AVFilterLink:

AVFilterContext *src
AVFilterPad *srcpad
AVFilterContext *dst
Expand Down
Loading