summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-22 22:52:42 +0200
committerwm4 <wm4@nowhere>2013-07-22 22:52:42 +0200
commit1f5ffe7d30a5537cc83fbfb8dad37d01af27427b (patch)
tree7e450c6208e14a2c4fe71e14461469c8fab1b7c8 /video
parent1df2ad7e034c1c42a8ae86e8b3077c2342ad40bd (diff)
downloadmpv-1f5ffe7d30a5537cc83fbfb8dad37d01af27427b.tar.bz2
mpv-1f5ffe7d30a5537cc83fbfb8dad37d01af27427b.tar.xz
video/out: remove options argument from preinit()
All VOs use proper option parsing now, and compatibility hacks are not needed.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c5
-rw-r--r--video/out/vo.h4
-rw-r--r--video/out/vo_caca.c7
-rw-r--r--video/out/vo_corevideo.m2
-rw-r--r--video/out/vo_direct3d.c2
-rw-r--r--video/out/vo_image.c2
-rw-r--r--video/out/vo_lavc.c2
-rw-r--r--video/out/vo_null.c6
-rw-r--r--video/out/vo_opengl.c2
-rw-r--r--video/out/vo_opengl_old.c2
-rw-r--r--video/out/vo_sdl.c2
-rw-r--r--video/out/vo_vdpau.c2
-rw-r--r--video/out/vo_x11.c2
-rw-r--r--video/out/vo_xv.c2
14 files changed, 16 insertions, 26 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 474d4e0c52..2db6afa05a 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -157,9 +157,10 @@ static struct vo *vo_create(struct mp_vo_opts *opts,
if (vo->driver->encode != !!vo->encode_lavc_ctx)
goto error;
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;
- if (vo->driver->preinit(vo, (char *)args))
+ vo->priv = config->optstruct;
+ if (vo->driver->preinit(vo))
goto error;
return vo;
error:
diff --git a/video/out/vo.h b/video/out/vo.h
index 80c51dfc08..ae84f9d0c9 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -151,11 +151,9 @@ struct vo_driver {
const vo_info_t *info;
/*
- * Preinitializes driver (real INITIALIZATION)
- * arg - currently it's vo_subdevice
* 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.
diff --git a/video/out/vo_caca.c b/video/out/vo_caca.c
index dd6d76f311..a14441e4f4 100644
--- a/video/out/vo_caca.c
+++ b/video/out/vo_caca.c
@@ -246,13 +246,8 @@ static void uninit(struct vo *vo)
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);
if (canvas == NULL) {
mp_msg(MSGT_VO, MSGL_ERR, "vo_caca: failed to create canvas\n");
diff --git a/video/out/vo_corevideo.m b/video/out/vo_corevideo.m
index 3a45c42921..cb60fef95d 100644
--- a/video/out/vo_corevideo.m
+++ b/video/out/vo_corevideo.m
@@ -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;
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 9c5a306363..cc8b4d67f8 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -1157,7 +1157,7 @@ static void update_colorspace(d3d_priv *priv)
* @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;
priv->vo = vo;
diff --git a/video/out/vo_image.c b/video/out/vo_image.c
index af9b0edd4c..03869146f7 100644
--- a/video/out/vo_image.c
+++ b/video/out/vo_image.c
@@ -152,7 +152,7 @@ static void uninit(struct vo *vo)
mp_image_unrefp(&p->current);
}
-static int preinit(struct vo *vo, const char *arg)
+static int preinit(struct vo *vo)
{
vo->untimed = true;
return 0;
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index 6c28169baa..7ee372f053 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -60,7 +60,7 @@ struct priv {
struct mp_csp_details colorspace;
};
-static int preinit(struct vo *vo, const char *arg)
+static int preinit(struct vo *vo)
{
struct priv *vc;
if (!encode_lavc_available(vo->encode_lavc_ctx)) {
diff --git a/video/out/vo_null.c b/video/out/vo_null.c
index 685b9c3a84..88c355033f 100644
--- a/video/out/vo_null.c
+++ b/video/out/vo_null.c
@@ -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;
}
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 6e523a6b8c..f460ea95f0 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -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;
p->vo = vo;
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c
index 59f63205e8..2caf0c3f28 100644
--- a/video/out/vo_opengl_old.c
+++ b/video/out/vo_opengl_old.c
@@ -2077,7 +2077,7 @@ static void uninit(struct vo *vo)
p->gl = NULL;
}
-static int preinit(struct vo *vo, const char *arg)
+static int preinit(struct vo *vo)
{
struct gl_priv *p = vo->priv;
diff --git a/video/out/vo_sdl.c b/video/out/vo_sdl.c
index 35d3ab4962..c5ecc2be8c 100644
--- a/video/out/vo_sdl.c
+++ b/video/out/vo_sdl.c
@@ -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);
}
-static int preinit(struct vo *vo, const char *arg)
+static int preinit(struct vo *vo)
{
struct priv *vc = vo->priv;
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 6319945ddb..85ad4ecf80 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -1439,7 +1439,7 @@ static void uninit(struct vo *vo)
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;
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 0762d55400..6eef918b9e 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -602,7 +602,7 @@ static void uninit(struct vo *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;
p->vo = vo;
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 6c91e7bcd4..b7e3687ef7 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -722,7 +722,7 @@ static void uninit(struct vo *vo)
vo_x11_uninit(vo);
}
-static int preinit(struct vo *vo, const char *arg)
+static int preinit(struct vo *vo)
{
XvPortID xv_p;
int busy_ports = 0;