mirror of
https://github.com/mpv-player/mpv
synced 2025-04-18 05:07:18 +00:00
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.
This commit is contained in:
parent
e448e10fd7
commit
291f301c10
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -130,13 +130,6 @@ struct voctrl_get_equalizer_args {
|
||||
#define VO_NOTAVAIL -2
|
||||
#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,
|
||||
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user