From 70af7ab8e55e117e62303b407f2886f29b5500d1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Dec 2013 18:11:01 +0100 Subject: vaapi: mp_msg conversions This ended up a little bit messy. In order to get a mp_log everywhere, mostly make use of the fact that va_surface already references global state anyway. --- video/vaapi.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'video/vaapi.h') diff --git a/video/vaapi.h b/video/vaapi.h index 2dbf03a208..1136725af3 100644 --- a/video/vaapi.h +++ b/video/vaapi.h @@ -73,8 +73,10 @@ #include "mp_image.h" struct mp_image_pool; +struct mp_log; struct mp_vaapi_ctx { + struct mp_log *log; VADisplay display; struct va_image_formats *image_formats; }; @@ -89,28 +91,30 @@ struct va_surface { struct va_surface_priv *p; }; -bool check_va_status(VAStatus status, const char *msg); +bool check_va_status(struct mp_log *log, VAStatus status, const char *msg); + +#define CHECK_VA_STATUS(ctx, msg) check_va_status((ctx)->log, status, msg) int va_get_colorspace_flag(enum mp_csp csp); -struct mp_vaapi_ctx *va_initialize(VADisplay *display); +struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *log); void va_destroy(struct mp_vaapi_ctx *ctx); enum mp_imgfmt va_fourcc_to_imgfmt(uint32_t fourcc); uint32_t va_fourcc_from_imgfmt(int imgfmt); VAImageFormat * va_image_format_from_imgfmt(const struct va_image_formats *formats, int imgfmt); -bool va_image_map(VADisplay display, VAImage *image, struct mp_image *mpi); -bool va_image_unmap(VADisplay display, VAImage *image); +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(VADisplay display, int rt_format); +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, const struct va_image_formats *formats, int imgfmt, int w, int h); -struct mp_image * va_surface_pool_get_wrapped(struct va_surface_pool *pool, const struct va_image_formats *formats, int imgfmt, 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); @@ -120,7 +124,6 @@ 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, - const struct va_image_formats *formats, struct mp_image_pool *pool); #endif -- cgit v1.2.3