diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-11 21:54:31 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-22 16:13:25 +0200 |
commit | f308f37441ec0d49166641843acd5302c1e26e6a (patch) | |
tree | 163308d8d314a883f385b96661048844c0b3b362 /libavfilter/internal.h | |
parent | dff1709eb2dc6f3f8128abb4e2c764cc7c5fc92b (diff) |
avfilter/avfilter: Allow to free non-static pads generically
This can be enabled/disabled on a per-pad basis by setting
the AVFILTERPAD_FLAG_FREE_NAME flag; variants of ff_append_(in|out)pads
that do this for you have been added and will be put to use in the
following commits.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/internal.h')
-rw-r--r-- | libavfilter/internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavfilter/internal.h b/libavfilter/internal.h index cc95f06c4c..6ddf024d93 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -69,6 +69,11 @@ struct AVFilterPad { #define AVFILTERPAD_FLAG_NEEDS_WRITABLE (1 << 0) /** + * The pad's name is allocated and should be freed generically. + */ +#define AVFILTERPAD_FLAG_FREE_NAME (1 << 1) + + /** * A combination of AVFILTERPAD_FLAG_* flags. */ int flags; @@ -231,9 +236,14 @@ void ff_tlog_link(void *ctx, AVFilterLink *link, int end); /** * Append a new input/output pad to the filter's list of such pads. + * + * The *_free_name versions will set the AVFILTERPAD_FLAG_FREE_NAME flag + * ensuring that the name will be freed generically (even on insertion error). */ int ff_append_inpad (AVFilterContext *f, AVFilterPad *p); int ff_append_outpad(AVFilterContext *f, AVFilterPad *p); +int ff_append_inpad_free_name (AVFilterContext *f, AVFilterPad *p); +int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p); /** * Request an input frame from the filter at the other end of the link. |