diff options
author | wm4 <wm4@nowhere> | 2014-09-18 19:25:46 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-18 19:36:27 +0200 |
commit | 580cf433bd3713f1c00a612be2d57d5b959e8496 (patch) | |
tree | 327fedd77fc0c095009201f6a527b70cdf459e70 /video/filter/vf.h | |
parent | 5c8549ac68c1a8a4921e5f0ea842969aa8072a18 (diff) | |
download | mpv-580cf433bd3713f1c00a612be2d57d5b959e8496.tar.bz2 mpv-580cf433bd3713f1c00a612be2d57d5b959e8496.tar.xz |
video/filter: allow better dataflow
Consider a filter which turns 1 frame into 2 frames (such as an
deinterlacer). Until now, we forced filters to produce all output frames
at once. This was done for simplicity.
Change the filter API such that a filter can produce frames
incrementally.
Diffstat (limited to 'video/filter/vf.h')
-rw-r--r-- | video/filter/vf.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/video/filter/vf.h b/video/filter/vf.h index 71dcb699c2..6f0985293e 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -75,6 +75,15 @@ typedef struct vf_instance { // can be used to output delayed or otherwise remaining images. int (*filter_ext)(struct vf_instance *vf, struct mp_image *mpi); + // Produce an output frame. This is called after filter or filter_ext. + // You can add 0 or more frames with vf_add_output_frame(). (This allows + // distributing the filter load over time -> typically add at most 1 frame.) + // If this adds no frame (or is NULL), then the caller assumes that the + // filter needs new input. + // Return a negative value on error. (No more frames is not an error.) + // May be called multiple times, even if the filter gives no output. + int (*filter_out)(struct vf_instance *vf); + void (*uninit)(struct vf_instance *vf); char *label; |