From 4d2f354da651a3c1fd9776ed5829f57961a46c10 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 27 Sep 2013 16:48:45 +0200 Subject: vaapi: potentially make reading surfaces back to system RAM faster Don't allocate a VAImage and a mp_image every time. VAImage are cached in the surfaces themselves, and for mp_image an explicit pool is created. The retry loop runs only once for each surface now. This also makes use of vaDeriveImage() if possible. --- video/vaapi.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video/vaapi.h') diff --git a/video/vaapi.h b/video/vaapi.h index fa87658391..8e09193fd9 100644 --- a/video/vaapi.h +++ b/video/vaapi.h @@ -72,6 +72,8 @@ #include "mp_image.h" +struct mp_image_pool; + struct mp_vaapi_ctx { VADisplay display; struct va_image_formats *image_formats; @@ -117,6 +119,8 @@ struct mp_image * va_surface_wrap(struct va_surface *surface); // takes o VASurfaceID va_surface_id(const struct va_surface *surface); VASurfaceID va_surface_id_in_mp_image(const struct mp_image *mpi); bool va_surface_upload(struct va_surface *surface, const struct mp_image *mpi); -struct mp_image * va_surface_download(const struct va_surface *surface, const struct va_image_formats *formats); +struct mp_image * va_surface_download(struct va_surface *surface, + const struct va_image_formats *formats, + struct mp_image_pool *pool); #endif -- cgit v1.2.3