summaryrefslogtreecommitdiffstats
path: root/video/vaapi.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-17 18:22:25 +0100
committerwm4 <wm4@nowhere>2014-03-17 18:22:25 +0100
commit31fc5e85636f8e7b3bec5f133cb82b78e3c86ddb (patch)
tree702027b802cb1d2f00b266280faac3de1b5b13f2 /video/vaapi.h
parent88aa3b8c986e0fdb74ae805b6a09d43789fb903e (diff)
downloadmpv-31fc5e85636f8e7b3bec5f133cb82b78e3c86ddb.tar.bz2
mpv-31fc5e85636f8e7b3bec5f133cb82b78e3c86ddb.tar.xz
vaapi: replace image pool implementation with mp_image_pool
Although I at first thought it would be better to have a separate implementation for hwaccels because the difference to software images are too large, it turns out you can actually save some code with it. Note that the old implementation had a small memory management bug. This got painted over in commit 269c1e1, but is hereby solved properly. Also note that I couldn't test vf_vavpp.c (due to lack of hardware), and I hope I didn't accidentally break it.
Diffstat (limited to 'video/vaapi.h')
-rw-r--r--video/vaapi.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/video/vaapi.h b/video/vaapi.h
index 1136725af3..0396d01320 100644
--- a/video/vaapi.h
+++ b/video/vaapi.h
@@ -106,24 +106,17 @@ VAImageFormat * va_image_format_from_imgfmt(const struct va_image_forma
bool va_image_map(struct mp_vaapi_ctx *ctx, VAImage *image, struct mp_image *mpi);
bool va_image_unmap(struct mp_vaapi_ctx *ctx, VAImage *image);
-struct va_surface_pool * va_surface_pool_alloc(struct mp_vaapi_ctx *ctx, int rt_format);
-void va_surface_pool_release(struct va_surface_pool *pool);
-void va_surface_pool_releasep(struct va_surface_pool **pool);
-void va_surface_pool_clear(struct va_surface_pool *pool);
-bool va_surface_pool_reserve(struct va_surface_pool *pool, int count, int w, int h);
-int va_surface_pool_rt_format(const struct va_surface_pool *pool);
-struct va_surface * va_surface_pool_get(struct va_surface_pool *pool, int w, int h);
-struct va_surface * va_surface_pool_get_by_imgfmt(struct va_surface_pool *pool, int imgfmt, int w, int h);
-struct mp_image * va_surface_pool_get_wrapped(struct va_surface_pool *pool, int imgfmt, int w, int h);
-
-void va_surface_release(struct va_surface *surface);
-void va_surface_releasep(struct va_surface **surface);
+void va_pool_set_allocator(struct mp_image_pool *pool, struct mp_vaapi_ctx *ctx,
+ int rt_format);
+
struct va_surface * va_surface_in_mp_image(struct mp_image *mpi);
-struct mp_image * va_surface_wrap(struct va_surface *surface); // takes ownership
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, struct mp_image *mpi);
struct mp_image * va_surface_download(struct va_surface *surface,
struct mp_image_pool *pool);
+int va_surface_image_alloc_imgfmt(struct mp_image *img, int imgfmt);
+int va_surface_upload_image(struct mp_image *va_dst, struct mp_image *sw_src);
+
#endif