summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r--libvo/vo_gl.c83
1 files changed, 44 insertions, 39 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 4fd8efb671..cf5cbcbbb2 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"
static const vo_info_t info =
{
@@ -56,11 +53,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,
@@ -309,11 +325,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;
}
@@ -338,8 +354,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;
@@ -600,16 +616,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;
@@ -1230,7 +1238,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:
@@ -1253,7 +1261,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()) {
@@ -1262,8 +1269,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;
@@ -1284,33 +1289,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;
}
@@ -1318,6 +1315,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;
}