summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-03 18:20:16 +0200
committerwm4 <wm4@nowhere>2015-10-03 18:20:16 +0200
commit291f301c105ca989db6165108fd9dd1c57cde56d (patch)
treedf9f106e86282f2978136dd6820fa76894ccae5f
parente448e10fd7768c509c528f9291d372fa9760919d (diff)
downloadmpv-291f301c105ca989db6165108fd9dd1c57cde56d.tar.bz2
mpv-291f301c105ca989db6165108fd9dd1c57cde56d.tar.xz
video/out: remove an unused parameter
This parameter has been unused for years (the last flag was removed in commit d658b115). Get rid of it. This affects the general VO API, as well as the vo_opengl backend API, so it touches a lot of files. The VOFLAGs are still used to control OpenGL context creation, so move them to the OpenGL backend code.
-rw-r--r--player/playloop.c2
-rw-r--r--player/video.c2
-rw-r--r--video/out/opengl/cocoa.c2
-rw-r--r--video/out/opengl/common.c5
-rw-r--r--video/out/opengl/common.h11
-rw-r--r--video/out/opengl/rpi.c2
-rw-r--r--video/out/opengl/w32.c2
-rw-r--r--video/out/opengl/wayland.c2
-rw-r--r--video/out/opengl/x11.c2
-rw-r--r--video/out/opengl/x11egl.c2
-rw-r--r--video/out/vo.c9
-rw-r--r--video/out/vo.h12
-rw-r--r--video/out/vo_caca.c2
-rw-r--r--video/out/vo_direct3d.c2
-rw-r--r--video/out/vo_drm.c4
-rw-r--r--video/out/vo_image.c2
-rw-r--r--video/out/vo_lavc.c2
-rw-r--r--video/out/vo_null.c2
-rw-r--r--video/out/vo_opengl.c4
-rw-r--r--video/out/vo_opengl_cb.c2
-rw-r--r--video/out/vo_rpi.c2
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vaapi.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/vo_wayland.c2
-rw-r--r--video/out/vo_x11.c2
-rw-r--r--video/out/vo_xv.c2
27 files changed, 42 insertions, 45 deletions
diff --git a/player/playloop.c b/player/playloop.c
index 1d382c69a1..2972593050 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -917,7 +917,7 @@ int handle_force_window(struct MPContext *mpctx, bool force)
.w = w, .h = h,
.d_w = w, .d_h = h,
};
- if (vo_reconfig(vo, &p, 0) < 0)
+ if (vo_reconfig(vo, &p) < 0)
goto err;
vo_control(vo, VOCTRL_RESTORE_SCREENSAVER, NULL);
vo_set_paused(vo, true);
diff --git a/player/video.c b/player/video.c
index 897c43229e..873ff632a5 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1132,7 +1132,7 @@ void write_video(struct MPContext *mpctx, double endpts)
info->name, p.w, p.h, extra, vo_format_name(p.imgfmt));
MP_VERBOSE(mpctx, "VO: Description: %s\n", info->description);
- int vo_r = vo_reconfig(vo, &p, 0);
+ int vo_r = vo_reconfig(vo, &p);
if (vo_r < 0) {
mpctx->error_playing = MPV_ERROR_VO_INIT_FAILED;
goto error;
diff --git a/video/out/opengl/cocoa.c b/video/out/opengl/cocoa.c
index 50b149b6bc..7d367e99b4 100644
--- a/video/out/opengl/cocoa.c
+++ b/video/out/opengl/cocoa.c
@@ -150,7 +150,7 @@ static int cocoa_init(MPGLContext *ctx, int vo_flags)
return 0;
}
-static int cocoa_reconfig(struct MPGLContext *ctx, int flags)
+static int cocoa_reconfig(struct MPGLContext *ctx)
{
vo_cocoa_config_window(ctx->vo);
return 0;
diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c
index 5c4eeda7fd..f045184373 100644
--- a/video/out/opengl/common.c
+++ b/video/out/opengl/common.c
@@ -629,10 +629,9 @@ MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, int vo_flags)
return ctx;
}
-// flags: passed to the backend function
-bool mpgl_reconfig_window(struct MPGLContext *ctx, int vo_flags)
+int mpgl_reconfig_window(struct MPGLContext *ctx)
{
- return ctx->driver->reconfig(ctx, vo_flags) >= 0;
+ return ctx->driver->reconfig(ctx);
}
int mpgl_control(struct MPGLContext *ctx, int *events, int request, void *arg)
diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h
index 1da095db44..35d303e96c 100644
--- a/video/out/opengl/common.h
+++ b/video/out/opengl/common.h
@@ -74,6 +74,13 @@ enum {
#define MPGL_VER_P(ver) MPGL_VER_GET_MAJOR(ver), MPGL_VER_GET_MINOR(ver)
+enum {
+ VOFLAG_GLES = 1 << 0, // Hint to prefer GLES2 if possible
+ VOFLAG_GL_DEBUG = 1 << 1, // Hint to request debug OpenGL context
+ VOFLAG_ALPHA = 1 << 2, // Hint to request alpha framebuffer
+ VOFLAG_SW = 1 << 3, // Hint to accept a software GL renderer
+};
+
struct MPGLContext;
// A windowing backend (like X11, win32, ...), which provides OpenGL rendering.
@@ -93,7 +100,7 @@ struct mpgl_driver {
// Currently, there is an unfortunate interaction with ctx->vo, and
// display size etc. are determined by it.
// Return 0 on success, negative value (-1) on error.
- int (*reconfig)(struct MPGLContext *ctx, int flags);
+ int (*reconfig)(struct MPGLContext *ctx);
// Present the frame.
void (*swap_buffers)(struct MPGLContext *ctx);
@@ -126,7 +133,7 @@ typedef struct MPGLContext {
MPGLContext *mpgl_init(struct vo *vo, const char *backend_name, int vo_flags);
void mpgl_uninit(MPGLContext *ctx);
-bool mpgl_reconfig_window(struct MPGLContext *ctx, int vo_flags);
+int mpgl_reconfig_window(struct MPGLContext *ctx);
int mpgl_control(struct MPGLContext *ctx, int *events, int request, void *arg);
void mpgl_swap_buffers(struct MPGLContext *ctx);
diff --git a/video/out/opengl/rpi.c b/video/out/opengl/rpi.c
index 0e0f0813e9..79aad522e4 100644
--- a/video/out/opengl/rpi.c
+++ b/video/out/opengl/rpi.c
@@ -214,7 +214,7 @@ fail:
return -1;
}
-static int rpi_reconfig(struct MPGLContext *ctx, int flags)
+static int rpi_reconfig(struct MPGLContext *ctx)
{
struct priv *p = ctx->priv;
ctx->vo->dwidth = p->w;
diff --git a/video/out/opengl/w32.c b/video/out/opengl/w32.c
index c7b09fe87d..dca76b3406 100644
--- a/video/out/opengl/w32.c
+++ b/video/out/opengl/w32.c
@@ -257,7 +257,7 @@ fail:
return -1;
}
-static int w32_reconfig(struct MPGLContext *ctx, int flags)
+static int w32_reconfig(struct MPGLContext *ctx)
{
vo_w32_config(ctx->vo);
return 0;
diff --git a/video/out/opengl/wayland.c b/video/out/opengl/wayland.c
index f345cc1563..d0958e96a0 100644
--- a/video/out/opengl/wayland.c
+++ b/video/out/opengl/wayland.c
@@ -163,7 +163,7 @@ static void egl_create_window(struct vo_wayland_state *wl)
eglSwapInterval(wl->egl_context.egl.dpy, 0);
}
-static int waylandgl_reconfig(struct MPGLContext *ctx, int flags)
+static int waylandgl_reconfig(struct MPGLContext *ctx)
{
struct vo_wayland_state * wl = ctx->vo->wayland;
diff --git a/video/out/opengl/x11.c b/video/out/opengl/x11.c
index dfe86d8d1a..4d7efbac90 100644
--- a/video/out/opengl/x11.c
+++ b/video/out/opengl/x11.c
@@ -264,7 +264,7 @@ static int glx_init(struct MPGLContext *ctx, int vo_flags)
return -1;
}
-static int glx_reconfig(struct MPGLContext *ctx, int flags)
+static int glx_reconfig(struct MPGLContext *ctx)
{
vo_x11_config_vo_window(ctx->vo);
return 0;
diff --git a/video/out/opengl/x11egl.c b/video/out/opengl/x11egl.c
index 2b660f2904..fb29cb6268 100644
--- a/video/out/opengl/x11egl.c
+++ b/video/out/opengl/x11egl.c
@@ -167,7 +167,7 @@ uninit:
return false;
}
-static int mpegl_reconfig(struct MPGLContext *ctx, int flags)
+static int mpegl_reconfig(struct MPGLContext *ctx)
{
vo_x11_config_vo_window(ctx->vo);
return 0;
diff --git a/video/out/vo.c b/video/out/vo.c
index 5a691a6b9d..12083e4784 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -359,8 +359,7 @@ static void run_reconfig(void *p)
void **pp = p;
struct vo *vo = pp[0];
struct mp_image_params *params = pp[1];
- int flags = *(int *)pp[2];
- int *ret = pp[3];
+ int *ret = pp[2];
struct vo_internal *in = vo->in;
@@ -370,7 +369,7 @@ static void run_reconfig(void *p)
talloc_free(vo->params);
vo->params = talloc_memdup(vo, params, sizeof(*params));
- *ret = vo->driver->reconfig(vo, vo->params, flags);
+ *ret = vo->driver->reconfig(vo, vo->params);
vo->config_ok = *ret >= 0;
if (vo->config_ok) {
check_vo_caps(vo);
@@ -388,10 +387,10 @@ static void run_reconfig(void *p)
update_display_fps(vo);
}
-int vo_reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+int vo_reconfig(struct vo *vo, struct mp_image_params *params)
{
int ret;
- void *p[] = {vo, params, &flags, &ret};
+ void *p[] = {vo, params, &ret};
mp_dispatch_run(vo->in->dispatch, run_reconfig, p);
return ret;
}
diff --git a/video/out/vo.h b/video/out/vo.h
index 81ca375270..cc280987a5 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -131,13 +131,6 @@ struct voctrl_get_equalizer_args {
#define VO_NOTIMPL -3
enum {
- VOFLAG_GLES = 1 << 0, // Hint to prefer GLES2 if possible
- VOFLAG_GL_DEBUG = 1 << 1, // Hint to request debug OpenGL context
- VOFLAG_ALPHA = 1 << 2, // Hint to request alpha framebuffer
- VOFLAG_SW = 1 << 3, // Hint to accept a software GL renderer
-};
-
-enum {
// VO does handle mp_image_params.rotate in 90 degree steps
VO_CAP_ROTATE90 = 1 << 0,
// VO does framedrop itself (vo_vdpau). Untimed/encoding VOs never drop.
@@ -224,10 +217,9 @@ struct vo_driver {
/*
* Initialize or reconfigure the display driver.
* params: video parameters, like pixel format and frame size
- * flags: combination of VOFLAG_ values
* returns: < 0 on error, >= 0 on success
*/
- int (*reconfig)(struct vo *vo, struct mp_image_params *params, int flags);
+ int (*reconfig)(struct vo *vo, struct mp_image_params *params);
/*
* Control interface
@@ -326,7 +318,7 @@ struct vo {
struct mpv_global;
struct vo *init_best_video_out(struct mpv_global *global, struct vo_extra *ex);
-int vo_reconfig(struct vo *vo, struct mp_image_params *p, int flags);
+int vo_reconfig(struct vo *vo, struct mp_image_params *p);
int vo_control(struct vo *vo, uint32_t request, void *data);
bool vo_is_ready_for_frame(struct vo *vo, int64_t next_pts);
diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c
index 70c3a4f998..4c5da598e9 100644
--- a/video/out/vo_caca.c
+++ b/video/out/vo_caca.c
@@ -96,7 +96,7 @@ static int resize(struct vo *vo)
return 0;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *priv = vo->priv;
priv->image_height = params->h;
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index d3f6ac506e..4ee5e66d32 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -1327,7 +1327,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
return r;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
d3d_priv *priv = vo->priv;
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
index f853b90dc6..0b60b8eeef 100644
--- a/video/out/vo_drm.c
+++ b/video/out/vo_drm.c
@@ -450,7 +450,7 @@ static void wakeup(struct vo *vo)
vt_switcher_interrupt_poll(&p->vt_switcher);
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *p = vo->priv;
@@ -640,7 +640,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_TRUE;
case VOCTRL_SET_PANSCAN:
if (vo->config_ok)
- reconfig(vo, vo->params, 0);
+ reconfig(vo, vo->params);
return VO_TRUE;
}
return VO_NOTIMPL;
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index e8f9e1f063..e51d90fb3f 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -64,7 +64,7 @@ static bool checked_mkdir(struct vo *vo, const char *buf)
return true;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *p = vo->priv;
mp_image_unrefp(&p->current);
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 3a6903b7fd..09e8af748c 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -89,7 +89,7 @@ static void uninit(struct vo *vo)
vc->shutdown = true;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *vc = vo->priv;
enum AVPixelFormat pix_fmt = imgfmt2pixfmt(params->imgfmt);
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index 52ec934586..aeb2353cea 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -58,7 +58,7 @@ static int query_format(struct vo *vo, int format)
return 1;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
return 0;
}
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index e547bd6346..5440fa1af2 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -173,11 +173,11 @@ static int query_format(struct vo *vo, int format)
return 1;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct gl_priv *p = vo->priv;
- if (!mpgl_reconfig_window(p->glctx, flags))
+ if (mpgl_reconfig_window(p->glctx) < 0)
return -1;
resize(p);
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index c5038fa549..6d27f63e3f 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -452,7 +452,7 @@ static int query_format(struct vo *vo, int format)
return ok;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct vo_priv *p = vo->priv;
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index db65cead27..4f890ad2e4 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -432,7 +432,7 @@ static void disable_renderer(struct vo *vo)
p->renderer_enabled = false;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *p = vo->priv;
MMAL_PORT_T *input = p->renderer->input[0];
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index d46590267f..d1bad6877b 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -453,7 +453,7 @@ static void update_screeninfo(struct vo *vo, struct mp_rect *screenrc)
*screenrc = (struct mp_rect){0, 0, mode.w, mode.h};
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *vc = vo->priv;
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index 413e1b7cb4..2bb9d800cd 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -152,7 +152,7 @@ static void resize(struct priv *p)
p->vo->want_redraw = true;
}
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct priv *p = vo->priv;
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index f8830c8b00..3bb234f401 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -490,7 +490,7 @@ static bool status_ok(struct vo *vo)
* connect to X server, create and map window, initialize all
* VDPAU objects, create different surfaces etc.
*/
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index fa64392c53..c9f909b448 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -544,7 +544,7 @@ static int query_format(struct vo *vo, int format)
return 0;
}
-static int reconfig(struct vo *vo, struct mp_image_params *fmt, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *fmt)
{
struct priv *p = vo->priv;
mp_image_unrefp(&p->original_image);
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index af8a5f7133..7f4e36fbb6 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -188,7 +188,7 @@ const struct fmt_entry {
{0}
};
-static int reconfig(struct vo *vo, struct mp_image_params *fmt, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *fmt)
{
struct priv *p = vo->priv;
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index cf2d92473b..293d9f7929 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -456,7 +456,7 @@ static void resize(struct vo *vo)
* create and map window,
* allocate colors and (shared) memory
*/
-static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
+static int reconfig(struct vo *vo, struct mp_image_params *params)
{
struct vo_x11_state *x11 = vo->x11;
struct xvctx *ctx = vo->priv;