diff options
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r-- | libvo/vo_gl.c | 83 |
1 files changed, 44 insertions, 39 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index c44e21a3e8..00c0d62167 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -31,11 +31,8 @@ #include "gl_common.h" #include "aspect.h" -#ifdef CONFIG_GUI -#include "gui/interface.h" -#endif #include "fastmemcpy.h" -#include "libass/ass_mp.h" +#include "ass_mp.h" #ifdef CONFIG_GL_SDL #ifdef CONFIG_SDL_SDL_H @@ -64,11 +61,30 @@ static const vo_info_t info_nosw = "" }; static int preinit_nosw(const char *arg); -#define info info_nosw -#define preinit preinit_nosw -const LIBVO_EXTERN(gl_nosw) -#undef info -#undef preinit +const struct vo_driver video_out_gl_nosw = +{ + .is_new = 0, + .info = &info_nosw, + .preinit = old_vo_preinit, + .config = old_vo_config, + .control = old_vo_control, + .draw_slice = old_vo_draw_slice, + .draw_osd = old_vo_draw_osd, + .flip_page = old_vo_flip_page, + .check_events = old_vo_check_events, + .uninit = old_vo_uninit, + .old_functions = &(struct vo_old_functions){ + preinit_nosw, + config, + control, + draw_frame, + draw_slice, + draw_osd, + flip_page, + check_events, + uninit, + } +}; #ifdef CONFIG_GL_X11 static int wsGLXAttrib[] = { GLX_RGBA, @@ -317,11 +333,11 @@ static void clearEOSD(void) { eosdtex = NULL; } -static inline int is_tinytex(ass_image_t *i, int tinytexcur) { +static inline int is_tinytex(ASS_Image *i, int tinytexcur) { return i->w < TINYTEX_SIZE && i->h < TINYTEX_SIZE && tinytexcur < TINYTEX_MAX; } -static inline int is_smalltex(ass_image_t *i, int smalltexcur) { +static inline int is_smalltex(ASS_Image *i, int smalltexcur) { return i->w < SMALLTEX_SIZE && i->h < SMALLTEX_SIZE && smalltexcur < SMALLTEX_MAX; } @@ -346,8 +362,8 @@ static void genEOSD(mp_eosd_images_t *imgs) { int smalltexcur = 0; GLuint *curtex; GLint scale_type = scaled_osd ? GL_LINEAR : GL_NEAREST; - ass_image_t *img = imgs->imgs; - ass_image_t *i; + ASS_Image *img = imgs->imgs; + ASS_Image *i; if (imgs->changed == 0) // there are elements, but they are unchanged return; @@ -620,16 +636,8 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin is_yuv |= (xs << 8) | (ys << 16); glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type); - int_pause = 0; vo_flipped = !!(flags & VOFLAG_FLIPPING); -#ifdef CONFIG_GUI - if (use_gui) { - // GUI creates and manages window for us - guiGetEvent(guiSetShVideo, 0); - goto glconfig; - } -#endif if (create_window(d_width, d_height, flags, title) < 0) return -1; @@ -1251,7 +1259,7 @@ static const struct { {NULL, NULL, 0 } }; -static int control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data) { switch (request) { case VOCTRL_PAUSE: @@ -1274,7 +1282,6 @@ static int control(uint32_t request, void *data, ...) { mp_eosd_res_t *r = data; r->w = vo_dwidth; r->h = vo_dheight; - r->srcw = image_width; r->srch = image_height; r->mt = r->mb = r->ml = r->mr = 0; if (scaled_osd) {r->w = image_width; r->h = image_height;} else if (aspect_scaling()) { @@ -1283,8 +1290,6 @@ static int control(uint32_t request, void *data, ...) } } return VO_TRUE; - case VOCTRL_GUISUPPORT: - return VO_TRUE; case VOCTRL_ONTOP: glctx.ontop(); return VO_TRUE; @@ -1305,33 +1310,25 @@ static int control(uint32_t request, void *data, ...) return VO_TRUE; case VOCTRL_GET_EQUALIZER: if (is_yuv) { + struct voctrl_get_equalizer_args *args = data; int i; - va_list va; - int *value; - va_start(va, data); - value = va_arg(va, int *); - va_end(va); for (i = 0; eq_map[i].name; i++) - if (strcmp(data, eq_map[i].name) == 0) break; + if (strcmp(args->name, eq_map[i].name) == 0) break; if (!(eq_map[i].supportmask & (1 << use_yuv))) break; - *value = *eq_map[i].value; + *args->valueptr = *eq_map[i].value; return VO_TRUE; } break; case VOCTRL_SET_EQUALIZER: if (is_yuv) { + struct voctrl_set_equalizer_args *args = data; int i; - va_list va; - int value; - va_start(va, data); - value = va_arg(va, int); - va_end(va); for (i = 0; eq_map[i].name; i++) - if (strcmp(data, eq_map[i].name) == 0) break; + if (strcmp(args->name, eq_map[i].name) == 0) break; if (!(eq_map[i].supportmask & (1 << use_yuv))) break; - *eq_map[i].value = value; + *eq_map[i].value = args->value; update_yuvconv(); return VO_TRUE; } @@ -1339,6 +1336,14 @@ static int control(uint32_t request, void *data, ...) case VOCTRL_UPDATE_SCREENINFO: glctx.update_xinerama_info(); return VO_TRUE; + case VOCTRL_REDRAW_OSD: + if (vo_doublebuffering) + do_render(); + draw_osd(); + if (vo_doublebuffering) + do_render_osd(2); + flip_page(); + return VO_TRUE; } return VO_NOTIMPL; } |