--- mplayer/libvo/vo_ggi.c 2006-07-01 19:42:29.000000000 -0600 +++ mplayer-ggi-patch/libvo/vo_ggi.c 2006-07-01 19:46:14.000000000 -0600 @@ -26,6 +26,7 @@ #include "video_out_internal.h" #include "fastmemcpy.h" +#include "sub.h" #include @@ -120,7 +121,7 @@ uint32_t format) { ggi_mode mode = { - 1, /* frames */ + 2, /* frames */ {width, height}, /* visible */ {GGI_AUTO, GGI_AUTO}, /* virt */ {GGI_AUTO, GGI_AUTO}, /* size */ @@ -137,8 +138,16 @@ printf("\n"); #endif + /* first try with two frames for page flipping */ ggiCheckMode(ggi_conf.vis, &mode); + /* if ggiCheckMode decreased the height, then there was not enough + memory for two frames */ + if(mode.virt.y < (int16_t)height) { + mode.frames = 1; + ggiCheckMode(ggi_conf.vis, &mode); + } + if (ggiSetMode(ggi_conf.vis, &mode) < 0) { mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set display mode\n"); return (-1); @@ -224,7 +233,8 @@ return (-1); } - mp_msg(MSGT_VO, MSGL_INFO, "[ggi] input: %dx%dx%d, output: %dx%dx%d\n", + mp_msg(MSGT_VO, MSGL_INFO, "[ggi] %d frames, input: %dx%dx%d, output: %dx%dx%d\n", + mode.frames, ggi_conf.srcwidth, ggi_conf.srcheight, ggi_conf.srcdepth, mode.virt.x, mode.virt.y, vo_dbpp); @@ -289,9 +299,34 @@ return (0); } +static void draw_alpha(int x, int y, int w, int h, unsigned char *src, + unsigned char *srca, int stride) { + int bytespp = (vo_dbpp + 1) >> 3; + char box[w*h*bytespp]; + + ggiGetBox(ggi_conf.drawvis, vo_dx + x, vo_dy + y, w, h, box); + switch (vo_dbpp) { + case 32: + vo_draw_alpha_rgb32(w, h, src, srca, stride, box, w * bytespp); + break; + case 24: + vo_draw_alpha_rgb24(w, h, src, srca, stride, box, w * bytespp); + break; + case 16: + vo_draw_alpha_rgb16(w, h, src, srca, stride, box, w * bytespp); + break; + case 15: + vo_draw_alpha_rgb15(w, h, src, srca, stride, box, w * bytespp); + break; + default: + return; + } + ggiPutBox(ggi_conf.drawvis, vo_dx + x, vo_dy + y, w, h, box); +} + static void draw_osd(void) { - return; + vo_draw_text(ggi_conf.srcwidth, ggi_conf.srcheight, draw_alpha); } static void flip_page(void) @@ -318,6 +353,13 @@ ggi_conf.flushregion.x1 = ggi_conf.flushregion.x2 = -1; ggi_conf.flushregion.y1 = ggi_conf.flushregion.y2 = -1; + + + static int current_frame; + ggiSetDisplayFrame(ggi_conf.vis, current_frame); + ggiSetWriteFrame(ggi_conf.vis, current_frame); + ggiSetReadFrame(ggi_conf.vis, current_frame); /* for osd */ + current_frame = !current_frame; } static int draw_slice(uint8_t *src[], int stride[], @@ -494,6 +536,27 @@ case GIIUC_Asterisk: mplayer_put_key('*'); break; + case GIIUC_1: + mplayer_put_key('1'); + break; + case GIIUC_2: + mplayer_put_key('2'); + break; + case GIIUC_3: + mplayer_put_key('3'); + break; + case GIIUC_4: + mplayer_put_key('4'); + break; + case GIIUC_9: + mplayer_put_key('9'); + break; + case GIIUC_0: + mplayer_put_key('0'); + break; + case GIIUC_Period: + mplayer_put_key('.'); + break; case GIIK_PSlash: case GIIUC_Slash: mplayer_put_key('/');