aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 22:13:30 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 22:13:30 +0000
commita9c81431bdbb1eef04c8d0a292f90f1dd0b7587e (patch)
tree960f2b8c4c823f1ec5737851bdff30da78525683 /libavfilter
parent85322466efacc40158b0a27daeded52c40d48c94 (diff)
downloadffmpeg-a9c81431bdbb1eef04c8d0a292f90f1dd0b7587e.tar.gz
Helper functions for adding new pads to filters at runtime
Commited in SoC by Bobby Bingham on 2007-08-07 22:31:56 Originally committed as revision 12093 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avfilter.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 180b0d6dec..617e512a70 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -22,6 +22,7 @@
#ifndef FFMPEG_AVFILTER_H
#define FFMPEG_AVFILTER_H
+#include <stddef.h>
#include "avcodec.h"
typedef struct AVFilterContext AVFilterContext;
@@ -240,4 +241,36 @@ void avfilter_destroy(AVFilterContext *filter);
int *avfilter_make_format_list(int len, ...);
+/**
+ * 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 avfilter_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 avfilter_insert_inpad(AVFilterContext *f, unsigned index,
+ AVFilterPad *p)
+{
+ avfilter_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 avfilter_insert_outpad(AVFilterContext *f, unsigned index,
+ AVFilterPad *p)
+{
+ avfilter_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
+ &f->output_pads, &f->outputs, p);
+}
+
#endif /* FFMPEG_AVFILTER_H */