summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vaapi.c
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/out/vo_vaapi.c
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/out/vo_vaapi.c')
-rw-r--r--video/out/vo_vaapi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index fc9e93b2c4..266313d4ca 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -137,7 +137,7 @@ static bool alloc_swdec_surfaces(struct priv *p, int w, int h, int imgfmt)
free_video_specific(p);
for (int i = 0; i < MAX_OUTPUT_SURFACES; i++) {
p->swdec_surfaces[i] = mp_image_pool_get(p->pool, IMGFMT_VAAPI, w, h);
- if (va_surface_image_alloc_imgfmt(p->swdec_surfaces[i], imgfmt) < 0)
+ if (va_surface_alloc_imgfmt(p->swdec_surfaces[i], imgfmt) < 0)
return false;
}
return true;
@@ -184,7 +184,7 @@ static bool render_to_screen(struct priv *p, struct mp_image *mpi)
{
VAStatus status;
- VASurfaceID surface = va_surface_id_in_mp_image(mpi);
+ VASurfaceID surface = va_surface_id(mpi);
if (surface == VA_INVALID_ID) {
if (!p->black_surface) {
int w = p->image_params.w, h = p->image_params.h;
@@ -194,12 +194,12 @@ static bool render_to_screen(struct priv *p, struct mp_image *mpi)
if (p->black_surface) {
struct mp_image *img = mp_image_alloc(fmt, w, h);
mp_image_clear(img, 0, 0, w, h);
- if (va_surface_upload_image(p->black_surface, img) < 0)
+ if (va_surface_upload(p->black_surface, img) < 0)
mp_image_unrefp(&p->black_surface);
talloc_free(img);
}
}
- surface = va_surface_id_in_mp_image(p->black_surface);
+ surface = va_surface_id(p->black_surface);
}
int fields = mpi ? mpi->fields : 0;
@@ -273,7 +273,7 @@ static void draw_image(struct vo *vo, struct mp_image *mpi)
if (mpi->imgfmt != IMGFMT_VAAPI) {
struct mp_image *dst = p->swdec_surfaces[p->output_surface];
- if (!dst || va_surface_upload_image(dst, mpi) < 0) {
+ if (!dst || va_surface_upload(dst, mpi) < 0) {
MP_WARN(vo, "Could not upload surface.\n");
return;
}
@@ -286,11 +286,10 @@ static void draw_image(struct vo *vo, struct mp_image *mpi)
static struct mp_image *get_screenshot(struct priv *p)
{
- struct va_surface *surface =
- va_surface_in_mp_image(p->output_surfaces[p->visible_surface]);
- if (!surface)
+ struct mp_image *hwimg = p->output_surfaces[p->visible_surface];
+ if (!hwimg)
return NULL;
- struct mp_image *img = va_surface_download(surface, NULL);
+ struct mp_image *img = va_surface_download(hwimg, NULL);
if (!img)
return NULL;
struct mp_image_params params = p->image_params;