aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2016-12-20 15:56:48 +0100
committerNicolas George <george@nsup.org>2017-01-12 14:06:16 +0100
commit4c24f3ac166a0138cd33de71674ab8b383f41e30 (patch)
tree301417120910f8842cc9abd6de4f1c2524e19bc6 /libavfilter/avfilter.c
parent485617ea0f7bfe3715389b23edf977ffef293d15 (diff)
downloadffmpeg-4c24f3ac166a0138cd33de71674ab8b383f41e30.tar.gz
lavfi: add ff_inlink_acknowledge_status().
Also introduce libavfilter/filters.h for all functions needed to implement filters.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 12f12d1406..f3dea6e65e 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -39,6 +39,7 @@
#include "audio.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "internal.h"
@@ -1543,6 +1544,21 @@ int ff_filter_activate(AVFilterContext *filter)
return ret;
}
+int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts)
+{
+ *rpts = link->current_pts;
+ if (ff_framequeue_queued_frames(&link->fifo))
+ return *rstatus = 0;
+ if (link->status_out)
+ return *rstatus = link->status_out;
+ if (!link->status_in)
+ return *rstatus = 0;
+ *rstatus = link->status_out = link->status_in;
+ ff_update_link_current_pts(link, link->status_in_pts);
+ *rpts = link->current_pts;
+ return 1;
+}
+
const AVClass *avfilter_get_class(void)
{
return &avfilter_class;