mirror of
https://github.com/mpv-player/mpv
synced 2025-01-31 04:02:06 +00:00
video/out: remove options argument from preinit()
All VOs use proper option parsing now, and compatibility hacks are not needed.
This commit is contained in:
parent
1df2ad7e03
commit
1f5ffe7d30
@ -157,9 +157,10 @@ static struct vo *vo_create(struct mp_vo_opts *opts,
|
|||||||
if (vo->driver->encode != !!vo->encode_lavc_ctx)
|
if (vo->driver->encode != !!vo->encode_lavc_ctx)
|
||||||
goto error;
|
goto error;
|
||||||
struct m_config *config = m_config_from_obj_desc(vo, &desc);
|
struct m_config *config = m_config_from_obj_desc(vo, &desc);
|
||||||
if (m_config_initialize_obj(config, &desc, &vo->priv, &args) < 0)
|
if (m_config_set_obj_params(config, args) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
if (vo->driver->preinit(vo, (char *)args))
|
vo->priv = config->optstruct;
|
||||||
|
if (vo->driver->preinit(vo))
|
||||||
goto error;
|
goto error;
|
||||||
return vo;
|
return vo;
|
||||||
error:
|
error:
|
||||||
|
@ -151,11 +151,9 @@ struct vo_driver {
|
|||||||
|
|
||||||
const vo_info_t *info;
|
const vo_info_t *info;
|
||||||
/*
|
/*
|
||||||
* Preinitializes driver (real INITIALIZATION)
|
|
||||||
* arg - currently it's vo_subdevice
|
|
||||||
* returns: zero on successful initialization, non-zero on error.
|
* returns: zero on successful initialization, non-zero on error.
|
||||||
*/
|
*/
|
||||||
int (*preinit)(struct vo *vo, const char *arg);
|
int (*preinit)(struct vo *vo);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Whether the given image format is supported and config() will succeed.
|
* Whether the given image format is supported and config() will succeed.
|
||||||
|
@ -246,13 +246,8 @@ static void uninit(struct vo *vo)
|
|||||||
caca_free_canvas(canvas);
|
caca_free_canvas(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
if (arg) {
|
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "vo_caca: Unknown subdevice: %s\n", arg);
|
|
||||||
return ENOSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas = caca_create_canvas(0, 0);
|
canvas = caca_create_canvas(0, 0);
|
||||||
if (canvas == NULL) {
|
if (canvas == NULL) {
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "vo_caca: failed to create canvas\n");
|
mp_msg(MSGT_VO, MSGL_ERR, "vo_caca: failed to create canvas\n");
|
||||||
|
@ -263,7 +263,7 @@ static void uninit(struct vo *vo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct priv *p = vo->priv;
|
struct priv *p = vo->priv;
|
||||||
|
|
||||||
|
@ -1157,7 +1157,7 @@ static void update_colorspace(d3d_priv *priv)
|
|||||||
* @return 0 on success, -1 on failure
|
* @return 0 on success, -1 on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
d3d_priv *priv = vo->priv;
|
d3d_priv *priv = vo->priv;
|
||||||
priv->vo = vo;
|
priv->vo = vo;
|
||||||
|
@ -152,7 +152,7 @@ static void uninit(struct vo *vo)
|
|||||||
mp_image_unrefp(&p->current);
|
mp_image_unrefp(&p->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
vo->untimed = true;
|
vo->untimed = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -60,7 +60,7 @@ struct priv {
|
|||||||
struct mp_csp_details colorspace;
|
struct mp_csp_details colorspace;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct priv *vc;
|
struct priv *vc;
|
||||||
if (!encode_lavc_available(vo->encode_lavc_ctx)) {
|
if (!encode_lavc_available(vo->encode_lavc_ctx)) {
|
||||||
|
@ -56,12 +56,8 @@ static void uninit(struct vo *vo)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
if (arg) {
|
|
||||||
mp_tmsg(MSGT_VO, MSGL_WARN, "[VO_NULL] Unknown subdevice: %s.\n", arg);
|
|
||||||
return ENOSYS;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ static void uninit(struct vo *vo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct gl_priv *p = vo->priv;
|
struct gl_priv *p = vo->priv;
|
||||||
p->vo = vo;
|
p->vo = vo;
|
||||||
|
@ -2077,7 +2077,7 @@ static void uninit(struct vo *vo)
|
|||||||
p->gl = NULL;
|
p->gl = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct gl_priv *p = vo->priv;
|
struct gl_priv *p = vo->priv;
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
|
|||||||
osd_draw(osd, vc->osd_res, osd->vo_pts, 0, formats, draw_osd_cb, vo);
|
osd_draw(osd, vc->osd_res, osd->vo_pts, 0, formats, draw_osd_cb, vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct priv *vc = vo->priv;
|
struct priv *vc = vo->priv;
|
||||||
|
|
||||||
|
@ -1439,7 +1439,7 @@ static void uninit(struct vo *vo)
|
|||||||
av_freep(&vc->surface_render[i].bitstream_buffers);
|
av_freep(&vc->surface_render[i].bitstream_buffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct vdpctx *vc = vo->priv;
|
struct vdpctx *vc = vo->priv;
|
||||||
|
|
||||||
|
@ -602,7 +602,7 @@ static void uninit(struct vo *vo)
|
|||||||
vo_x11_uninit(vo);
|
vo_x11_uninit(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
struct priv *p = vo->priv;
|
struct priv *p = vo->priv;
|
||||||
p->vo = vo;
|
p->vo = vo;
|
||||||
|
@ -722,7 +722,7 @@ static void uninit(struct vo *vo)
|
|||||||
vo_x11_uninit(vo);
|
vo_x11_uninit(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int preinit(struct vo *vo, const char *arg)
|
static int preinit(struct vo *vo)
|
||||||
{
|
{
|
||||||
XvPortID xv_p;
|
XvPortID xv_p;
|
||||||
int busy_ports = 0;
|
int busy_ports = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user