summaryrefslogtreecommitdiffstats
path: root/video/out/vo_sdl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-12-22 21:46:22 +0100
committerwm4 <wm4@nowhere>2013-01-13 20:04:11 +0100
commit0c5311f17cb9078f0ddde7c41cad61d00aea4a94 (patch)
treee8254feab42d21e0c6932ce68a34228529247f66 /video/out/vo_sdl.c
parent15c7f7a33968edebe305e2845b32eb2383457d46 (diff)
downloadmpv-0c5311f17cb9078f0ddde7c41cad61d00aea4a94.tar.bz2
mpv-0c5311f17cb9078f0ddde7c41cad61d00aea4a94.tar.xz
video: cleanup: replace old mp_image function names
mp_image_alloc() also changes argument order compared to alloc_mpi(). The format now comes first, then width/height.
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r--video/out/vo_sdl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 2eeed1b66a..c3ed3c6774 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -448,7 +448,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
return -1;
}
- vc->ssmpi = alloc_mpi(width, height, format);
+ vc->ssmpi = mp_image_alloc(format, width, height);
resize(vo, d_width, d_height);
@@ -593,7 +593,7 @@ static void uninit(struct vo *vo)
{
struct priv *vc = vo->priv;
destroy_renderer(vo);
- free_mp_image(vc->ssmpi);
+ talloc_free(vc->ssmpi);
SDL_QuitSubSystem(SDL_INIT_VIDEO);
talloc_free(vc);
}
@@ -857,7 +857,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
if (color_add > 255)
color_add = 255;
- // typically this runs in parallel with the following copy_mpi call
+ // typically this runs in parallel with the following mp_image_copy call
SDL_SetRenderDrawColor(vc->renderer, color_add, color_add, color_add, 255);
SDL_RenderClear(vc->renderer);
@@ -894,7 +894,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
texmpi->stride[2] = pitch / 2;
}
}
- copy_mpi(texmpi, mpi);
+ mp_image_copy(texmpi, mpi);
SDL_UnlockTexture(vc->tex);
}
@@ -909,7 +909,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
dst.w = vc->dst_rect.x1 - vc->dst_rect.x0;
dst.h = vc->dst_rect.y1 - vc->dst_rect.y0;
- // typically this runs in parallel with the following copy_mpi call
+ // typically this runs in parallel with the following mp_image_copy call
if (color_mod > 255) {
SDL_SetTextureColorMod(vc->tex, color_mod / 2, color_mod / 2, color_mod / 2);
SDL_RenderCopy(vc->renderer, vc->tex, &src, &dst);
@@ -919,7 +919,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
SDL_RenderCopy(vc->renderer, vc->tex, &src, &dst);
}
if (mpi)
- copy_mpi(vc->ssmpi, mpi);
+ mp_image_copy(vc->ssmpi, mpi);
}
static void update_screeninfo(struct vo *vo)
@@ -940,19 +940,18 @@ static void update_screeninfo(struct vo *vo)
static struct mp_image *get_screenshot(struct vo *vo)
{
struct priv *vc = vo->priv;
- mp_image_t *image = alloc_mpi(vc->ssmpi->w, vc->ssmpi->h, vc->ssmpi->imgfmt);
- copy_mpi(image, vc->ssmpi);
- return image;
+ return mp_image_new_copy(vc->ssmpi);
}
static struct mp_image *get_window_screenshot(struct vo *vo)
{
struct priv *vc = vo->priv;
- mp_image_t *image = alloc_mpi(vo->dwidth, vo->dheight, vc->osd_format.mpv);
+ struct mp_image *image = mp_image_alloc(vc->osd_format.mpv, vo->dwidth,
+ vo->dheight);
if (SDL_RenderReadPixels(vc->renderer, NULL, vc->osd_format.sdl,
image->planes[0], image->stride[0])) {
mp_msg(MSGT_VO, MSGL_ERR, "[sdl] SDL_RenderReadPixels failed\n");
- free_mp_image(image);
+ talloc_free(image);
return NULL;
}
return image;