aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/dualinput.h
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-05-25 16:25:46 +0200
committerClément Bœsch <ubitux@gmail.com>2013-05-27 20:32:28 +0200
commit43286028906adab67ec87bc15ff3010d0f6c2ff0 (patch)
tree8192ba7da138231855eac0df78066327b9645e90 /libavfilter/dualinput.h
parent3cec29cf5981c35cfbe2b43fcdea3f6b9bb108b9 (diff)
downloadffmpeg-43286028906adab67ec87bc15ff3010d0f6c2ff0.tar.gz
lavfi: add dual input helpers.
Diffstat (limited to 'libavfilter/dualinput.h')
-rw-r--r--libavfilter/dualinput.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/libavfilter/dualinput.h b/libavfilter/dualinput.h
new file mode 100644
index 0000000000..98d05442c7
--- /dev/null
+++ b/libavfilter/dualinput.h
@@ -0,0 +1,46 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Double input streams helper for filters
+ */
+
+#ifndef AVFILTER_DUALINPUT_H
+#define AVFILTER_DUALINPUT_H
+
+#include <stdint.h>
+#include "bufferqueue.h"
+#include "internal.h"
+
+typedef struct {
+ uint8_t frame_requested;
+ uint8_t second_eof;
+ AVFrame *second_frame;
+ struct FFBufQueue queue[2];
+ AVFrame *(*process)(AVFilterContext *ctx, AVFrame *main, const AVFrame *second);
+ int shortest; ///< terminate stream when the second input terminates
+ int repeatlast; ///< repeat last second frame
+} FFDualInputContext;
+
+int ff_dualinput_filter_frame_main(FFDualInputContext *s, AVFilterLink *inlink, AVFrame *in);
+int ff_dualinput_filter_frame_second(FFDualInputContext *s, AVFilterLink *inlink, AVFrame *in);
+int ff_dualinput_request_frame(FFDualInputContext *s, AVFilterLink *outlink);
+void ff_dualinput_uninit(FFDualInputContext *s);
+
+#endif /* AVFILTER_DUALINPUT_H */