From 49d13f76ca727488de8622a8d176b5f71853bc61 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Mar 2014 18:22:35 +0100 Subject: vaapi: make struct va_surface private It's not really needed to be public. Other code can just use mp_image. The only disadvantage is that the other code needs to call an accessor to get the VASurfaceID. --- video/decode/vaapi.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'video/decode') diff --git a/video/decode/vaapi.c b/video/decode/vaapi.c index 82855c04eb..d9267936d0 100644 --- a/video/decode/vaapi.c +++ b/video/decode/vaapi.c @@ -170,7 +170,7 @@ static bool preallocate_surfaces(struct lavc_ctx *ctx, int num, int w, int h, for (int n = 0; n < num; n++) { reserve[n] = mp_image_pool_get(p->pool, IMGFMT_VAAPI, w, h); - out_surfaces[n] = va_surface_id_in_mp_image(reserve[n]); + out_surfaces[n] = va_surface_id(reserve[n]); if (out_surfaces[n] == VA_INVALID_ID) { MP_ERR(p, "Could not allocate surfaces.\n"); res = false; @@ -433,17 +433,14 @@ static struct mp_image *copy_image(struct lavc_ctx *ctx, struct mp_image *img) { struct priv *p = ctx->hwdec_priv; - struct va_surface *surface = va_surface_in_mp_image(img); - if (surface) { - struct mp_image *simg = va_surface_download(surface, p->sw_pool); - if (simg) { - if (!p->printed_readback_warning) { - MP_WARN(p, "Using GPU readback. This is usually inefficient.\n"); - p->printed_readback_warning = true; - } - talloc_free(img); - return simg; + struct mp_image *simg = va_surface_download(img, p->sw_pool); + if (simg) { + if (!p->printed_readback_warning) { + MP_WARN(p, "Using GPU readback. This is usually inefficient.\n"); + p->printed_readback_warning = true; } + talloc_free(img); + return simg; } return img; } -- cgit v1.2.3