summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-17 18:22:35 +0100
committerwm4 <wm4@nowhere>2014-03-17 18:22:35 +0100
commit49d13f76ca727488de8622a8d176b5f71853bc61 (patch)
tree03a8a9f3ae0d2372075f563ad4220fc571f81e38 /video/decode
parent31fc5e85636f8e7b3bec5f133cb82b78e3c86ddb (diff)
downloadmpv-49d13f76ca727488de8622a8d176b5f71853bc61.tar.bz2
mpv-49d13f76ca727488de8622a8d176b5f71853bc61.tar.xz
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.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vaapi.c19
1 files changed, 8 insertions, 11 deletions
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;
}