summaryrefslogtreecommitdiffstats
path: root/video/out/vo_sdl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-24 21:22:25 +0100
committerwm4 <wm4@nowhere>2014-01-24 21:22:25 +0100
commit2e66f4b89b525f15a709df95ac86cccbcab6bd49 (patch)
tree8c08885e202b4fa25f4de1652c8813014290617d /video/out/vo_sdl.c
parent7a6227a18476aee655df5dc76d27c281cc3590c2 (diff)
downloadmpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.bz2
mpv-2e66f4b89b525f15a709df95ac86cccbcab6bd49.tar.xz
video/out: do remaining config to reconfig replacements
The main difference between the old and new callbacks is that the old callbacks required passing the window size, which is and always was very inconvenient and confusing, since the window size is already in vo->dwidth and vo->dheight.
Diffstat (limited to 'video/out/vo_sdl.c')
-rw-r--r--video/out/vo_sdl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 3f743a17a4..915909578e 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -398,11 +398,11 @@ static void set_fullscreen(struct vo *vo)
force_resize(vo);
}
-static int config(struct vo *vo, uint32_t width, uint32_t height,
- uint32_t d_width, uint32_t d_height, uint32_t flags,
- uint32_t format)
+static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
{
struct priv *vc = vo->priv;
+ int win_w = vo->dwidth;
+ int win_h = vo->dheight;
if (vc->reinit_renderer) {
destroy_renderer(vo);
@@ -410,9 +410,9 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
}
if (vc->window)
- SDL_SetWindowSize(vc->window, d_width, d_height);
+ SDL_SetWindowSize(vc->window, win_w, win_h);
else {
- if (init_renderer(vo, d_width, d_height) != 0)
+ if (init_renderer(vo, win_w, win_h) != 0)
return -1;
}
@@ -432,14 +432,15 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
vc->tex_swapped = texfmt == SDL_PIXELFORMAT_YV12;
vc->tex = SDL_CreateTexture(vc->renderer, texfmt,
- SDL_TEXTUREACCESS_STREAMING, width, height);
+ SDL_TEXTUREACCESS_STREAMING,
+ params->w, params->h);
if (!vc->tex) {
MP_ERR(vo, "Could not create a texture\n");
return -1;
}
mp_image_t *texmpi = &vc->texmpi;
- mp_image_set_size(texmpi, width, height);
+ mp_image_set_size(texmpi, params->w, params->h);
mp_image_setfmt(texmpi, format);
switch (texmpi->num_planes) {
case 1:
@@ -452,7 +453,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
return -1;
}
- resize(vo, d_width, d_height);
+ resize(vo, win_w, win_h);
SDL_DisableScreenSaver();
@@ -1011,7 +1012,7 @@ const struct vo_driver video_out_sdl = {
},
.preinit = preinit,
.query_format = query_format,
- .config = config,
+ .reconfig = reconfig,
.control = control,
.draw_image = draw_image,
.uninit = uninit,