From c54fc507da8edcc2c5d3bc3f50b0881d1c1406d7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 5 Nov 2012 14:25:04 +0100 Subject: video/filter: change filter API, use refcounting, remove filter DR Change the entire filter API to use reference counted images instead of vf_get_image(). Remove filter "direct rendering". This was useful for vf_expand and (in rare cases) vf_sub: DR allowed these filters to pass a cropped image to the filters before them. Then, on filtering, the image was "uncropped", so that black bars could be added around the image without copying. This means that in some cases, vf_expand will be slower (-vf gradfun,expand for example). Note that another form of DR used for in-place filters has been replaced by simpler logic. Instead of trying to do DR, filters can check if the image is writeable (with mp_image_is_writeable()), and do true in-place if that's the case. This affects filters like vf_gradfun and vf_sub. Everything has to support strides now. If something doesn't, making a copy of the image data is required. --- video/mp_image.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video/mp_image.h') diff --git a/video/mp_image.h b/video/mp_image.h index 2fb693eb65..989f3ba909 100644 --- a/video/mp_image.h +++ b/video/mp_image.h @@ -144,8 +144,10 @@ typedef struct mp_image { int chroma_y_shift; // vertical enum mp_csp colorspace; enum mp_csp_levels levels; + /* only inside filter chain */ + double pts; /* memory management */ - int number, usage_count; // used by old VF/DR and vdpau code only + int number, usage_count; struct m_refcount *refcount; /* for private use by filter or vo driver (to store buffer id or dmpi) */ void* priv; -- cgit v1.2.3