From fa417fcd278a003530fe6bf851f8194177a5e71f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 30 May 2012 10:31:48 +0200 Subject: lavfi: make avfilter_insert_pad and pals private on next bump. They are only useful inside filters and we don't allow user filters for now. --- libavfilter/internal.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'libavfilter/internal.h') diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 4eb65305f9..7f7cf45771 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -36,4 +36,37 @@ int ff_fmt_is_in(int fmt, const int *fmts); void ff_dlog_link(void *ctx, AVFilterLink *link, int end); +/** + * Insert a new pad. + * + * @param idx Insertion point. Pad is inserted at the end if this point + * is beyond the end of the list of pads. + * @param count Pointer to the number of pads in the list + * @param padidx_off Offset within an AVFilterLink structure to the element + * to increment when inserting a new pad causes link + * numbering to change + * @param pads Pointer to the pointer to the beginning of the list of pads + * @param links Pointer to the pointer to the beginning of the list of links + * @param newpad The new pad to add. A copy is made when adding. + */ +void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, + AVFilterPad **pads, AVFilterLink ***links, + AVFilterPad *newpad); + +/** Insert a new input pad for the filter. */ +static inline void ff_insert_inpad(AVFilterContext *f, unsigned index, + AVFilterPad *p) +{ + ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), + &f->input_pads, &f->inputs, p); +} + +/** Insert a new output pad for the filter. */ +static inline void ff_insert_outpad(AVFilterContext *f, unsigned index, + AVFilterPad *p) +{ + ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), + &f->output_pads, &f->outputs, p); +} + #endif /* AVFILTER_INTERNAL_H */ -- cgit v1.2.3