diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/video_out.c | 4 | ||||
-rw-r--r-- | libvo/vo_gl.c | 50 |
2 files changed, 45 insertions, 9 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index 3338dbf551..e796784b1e 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -84,6 +84,7 @@ extern struct vo_driver video_out_vdpau; extern struct vo_driver video_out_xv; extern struct vo_driver video_out_gl_nosw; extern struct vo_driver video_out_gl; +extern struct vo_driver video_out_gl_sdl; extern struct vo_driver video_out_dga; extern struct vo_driver video_out_sdl; extern struct vo_driver video_out_3dfx; @@ -180,6 +181,9 @@ const struct vo_driver *video_out_drivers[] = #ifdef CONFIG_GL &video_out_gl, #endif +#ifdef CONFIG_GL_SDL + &video_out_gl_sdl, +#endif #ifdef CONFIG_DGA &video_out_dga, #endif diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 1a5884c9a6..abea7aeb30 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1270,13 +1270,12 @@ static void uninit(struct vo *vo) p->gl = NULL; } -static int preinit_internal(struct vo *vo, const char *arg, int allow_sw) +static int preinit_internal(struct vo *vo, const char *arg, int allow_sw, + enum MPGLType gltype) { struct gl_priv *p = talloc_zero(vo, struct gl_priv); vo->priv = p; - enum MPGLType gltype = GLTYPE_AUTO; - *p = (struct gl_priv) { .many_fmts = 1, .use_osd = -1, @@ -1412,6 +1411,14 @@ static int preinit_internal(struct vo *vo, const char *arg, int allow_sw) if (!p->glctx) goto err_out; p->gl = p->glctx->gl; + + if (p->glctx->type == GLTYPE_SDL && p->use_yuv == -1) { + // Apparently it's not possible to implement VOFLAG_HIDDEN on SDL 1.2, + // so don't do autodetection. Use a sufficiently useful and safe YUV + // conversion mode. + p->use_yuv = YUV_CONVERSION_FRAGMENT; + } + if (p->use_yuv == -1 || !allow_sw) { if (create_window(vo, 320, 200, VOFLAG_HIDDEN, NULL) < 0) goto err_out; @@ -1444,12 +1451,7 @@ err_out: static int preinit(struct vo *vo, const char *arg) { - return preinit_internal(vo, arg, 1); -} - -static int preinit_nosw(struct vo *vo, const char *arg) -{ - return preinit_internal(vo, arg, 0); + return preinit_internal(vo, arg, 1, GLTYPE_AUTO); } static int control(struct vo *vo, uint32_t request, void *data) @@ -1564,6 +1566,11 @@ const struct vo_driver video_out_gl = { .uninit = uninit, }; +static int preinit_nosw(struct vo *vo, const char *arg) +{ + return preinit_internal(vo, arg, 0, GLTYPE_AUTO); +} + const struct vo_driver video_out_gl_nosw = { .is_new = true, @@ -1582,3 +1589,28 @@ const struct vo_driver video_out_gl_nosw = .check_events = check_events, .uninit = uninit, }; + +#ifdef CONFIG_GL_SDL +static int preinit_sdl(struct vo *vo, const char *arg) +{ + return preinit_internal(vo, arg, 1, GLTYPE_SDL); +} + +const struct vo_driver video_out_gl_sdl = { + .is_new = true, + .info = &(const vo_info_t) { + "OpenGL with SDL", + "gl_sdl", + "Reimar Doeffinger <Reimar.Doeffinger@gmx.de>", + "" + }, + .preinit = preinit_sdl, + .config = config, + .control = control, + .draw_slice = draw_slice, + .draw_osd = draw_osd, + .flip_page = flip_page, + .check_events = check_events, + .uninit = uninit, +}; +#endif |