diff options
author | wm4 <wm4@nowhere> | 2013-12-21 18:11:01 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-21 20:50:11 +0100 |
commit | 70af7ab8e55e117e62303b407f2886f29b5500d1 (patch) | |
tree | cc28a681a02508ad40954c5496b3cd996956cfbe /video/out/gl_hwdec_vaglx.c | |
parent | 9e0b84c32173573cf5e5a09804d399a24a44c7ca (diff) | |
download | mpv-70af7ab8e55e117e62303b407f2886f29b5500d1.tar.bz2 mpv-70af7ab8e55e117e62303b407f2886f29b5500d1.tar.xz |
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.
Diffstat (limited to 'video/out/gl_hwdec_vaglx.c')
-rw-r--r-- | video/out/gl_hwdec_vaglx.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/video/out/gl_hwdec_vaglx.c b/video/out/gl_hwdec_vaglx.c index 53beceb197..47e7bb6e07 100644 --- a/video/out/gl_hwdec_vaglx.c +++ b/video/out/gl_hwdec_vaglx.c @@ -29,6 +29,7 @@ #include "video/hwdec.h" struct priv { + struct mp_log *log; struct mp_vaapi_ctx *ctx; VADisplay *display; GLuint gl_texture; @@ -42,7 +43,7 @@ static void destroy_texture(struct gl_hwdec *hw) if (p->vaglx_surface) { status = vaDestroySurfaceGLX(p->display, p->vaglx_surface); - check_va_status(status, "vaDestroySurfaceGLX()"); + CHECK_VA_STATUS(p, "vaDestroySurfaceGLX()"); p->vaglx_surface = NULL; } @@ -65,10 +66,11 @@ static int create(struct gl_hwdec *hw) return -1; struct priv *p = talloc_zero(hw, struct priv); hw->priv = p; + p->log = hw->log; p->display = vaGetDisplayGLX(hw->mpgl->vo->x11->display); if (!p->display) return -1; - p->ctx = va_initialize(p->display); + p->ctx = va_initialize(p->display, p->log); if (!p->ctx) { vaTerminate(p->display); return -1; @@ -98,7 +100,7 @@ static int reinit(struct gl_hwdec *hw, const struct mp_image_params *params) status = vaCreateSurfaceGLX(p->display, GL_TEXTURE_2D, p->gl_texture, &p->vaglx_surface); - return check_va_status(status, "vaCreateSurfaceGLX()") ? 0 : -1; + return CHECK_VA_STATUS(p, "vaCreateSurfaceGLX()") ? 0 : -1; } static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, @@ -113,7 +115,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, status = vaCopySurfaceGLX(p->display, p->vaglx_surface, va_surface_id_in_mp_image(hw_image), va_get_colorspace_flag(hw_image->colorspace)); - if (!check_va_status(status, "vaCopySurfaceGLX()")) + if (!CHECK_VA_STATUS(p, "vaCopySurfaceGLX()")) return -1; out_textures[0] = p->gl_texture; |