diff options
author | wm4 <wm4@nowhere> | 2014-03-17 18:22:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-17 18:22:35 +0100 |
commit | 49d13f76ca727488de8622a8d176b5f71853bc61 (patch) | |
tree | 03a8a9f3ae0d2372075f563ad4220fc571f81e38 /video/out | |
parent | 31fc5e85636f8e7b3bec5f133cb82b78e3c86ddb (diff) | |
download | mpv-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')
-rw-r--r-- | video/out/gl_hwdec_vaglx.c | 2 | ||||
-rw-r--r-- | video/out/vo_vaapi.c | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/video/out/gl_hwdec_vaglx.c b/video/out/gl_hwdec_vaglx.c index 47e7bb6e07..278718c67a 100644 --- a/video/out/gl_hwdec_vaglx.c +++ b/video/out/gl_hwdec_vaglx.c @@ -113,7 +113,7 @@ static int map_image(struct gl_hwdec *hw, struct mp_image *hw_image, return -1; status = vaCopySurfaceGLX(p->display, p->vaglx_surface, - va_surface_id_in_mp_image(hw_image), + va_surface_id(hw_image), va_get_colorspace_flag(hw_image->colorspace)); if (!CHECK_VA_STATUS(p, "vaCopySurfaceGLX()")) return -1; 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; |