annotate libvo/vo_ggi.c @ 4828:0ae597cc28e6

totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
author alex
date Sat, 23 Feb 2002 23:31:08 +0000
parents 32e1f5042f65
children 2c1dd0b15622
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
1 /*
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
2 vo_ggi.c - General Graphics Interface (GGI) Renderer for MPlayer
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
3
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
4 (C) Alex Beregszaszi <alex@naxine.org>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
5
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
6 Uses libGGI - http://www.ggi-project.org/
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
7
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
8 Thanks to Andreas Beck for his patches.
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
9 Many thanks to Atmosfear, he hacked this driver to working with Planar
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
10 formats, and he fixed the RGB handling.
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
11 */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
12
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
13 #include <stdio.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
14 #include <stdlib.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
15 #include <string.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
16 #include <errno.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
17
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
18 #include "mp_msg.h"
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
19
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
20 #include "../config.h"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
21 #include "video_out.h"
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
22 #include "video_out_internal.h"
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
23
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
24 #include "fastmemcpy.h"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
25
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
26 #include <ggi/ggi.h>
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
27
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
28 #undef GET_DB_INFO
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
29
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
30 #define GGI_FRAMES 4
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
31
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
32 /* do not make conversions from planar formats */
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
33 #undef GGI_YUV_SUPPORT
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
34
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
35 #ifndef GGI_YUV_SUPPORT
2732
ae79207a3055 Move yuv2rgb to postprocess
nick
parents: 1501
diff changeset
36 #include "../postproc/rgb2rgb.h"
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
37 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
38
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
39 LIBVO_EXTERN (ggi)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
40
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
41 static vo_info_t vo_info =
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
42 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
43 "General Graphics Interface (GGI) output",
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
44 "ggi",
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
45 "Alex Beregszaszi <alex@naxine.org>",
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
46 "under developement"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
47 };
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
48
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
49 static struct ggi_conf_s {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
50 char *driver;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
51
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
52 ggi_visual_t vis;
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
53 ggi_directbuffer *buffer[GGI_FRAMES];
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
54 ggi_mode gmode;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
55
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
56 int frames;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
57 int currframe;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
58
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
59 uint8_t bpp;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
60 uint8_t bppmul;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
61
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
62 uint8_t mode;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
63 #define YUV 0
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
64 #define RGB 1
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
65 #define BGR 2
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
66
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
67 /* YUV */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
68 int framePlaneY, framePlaneUV, framePlaneYUY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
69 int stridePlaneY, stridePlaneUV, stridePlaneYUY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
70
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
71 /* RGB */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
72 int framePlaneRGB;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
73 int stridePlaneRGB;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
74
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
75 /* original */
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
76 int srcwidth, srcheight;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
77 int srcformat;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
78 int srcdepth;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
79 int srctype;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
80
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
81 /* destination */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
82 int dstwidth, dstheight;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
83
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
84 /* source image format */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
85 int format;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
86 } ggi_conf;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
87
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
88 static int ggi_setmode(uint32_t d_width, uint32_t d_height, int d_depth)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
89 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
90 ggi_mode mode =
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
91 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
92 GGI_FRAMES, /* frames */
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
93 { GGI_AUTO, GGI_AUTO }, /* visible */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
94 { GGI_AUTO, GGI_AUTO }, /* virt */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
95 { GGI_AUTO, GGI_AUTO }, /* size */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
96 GT_AUTO, /* graphtype */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
97 { GGI_AUTO, GGI_AUTO } /* dots per pixel */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
98 };
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
99 ggi_color pal[256];
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
100
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
101 mp_msg(MSGT_VO, MSGL_V, "[ggi] mode requested: %dx%d (%d depth)\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
102 d_width, d_height, d_depth);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
103
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
104 // mode.size.x = vo_screenwidth;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
105 // mode.size.y = vo_screenheight;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
106 mode.visible.x = d_width;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
107 mode.visible.y = d_height;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
108
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
109 switch(d_depth)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
110 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
111 case 1:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
112 mode.graphtype = GT_1BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
113 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
114 case 2:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
115 mode.graphtype = GT_2BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
116 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
117 case 4:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
118 mode.graphtype = GT_4BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
119 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
120 case 8:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
121 mode.graphtype = GT_8BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
122 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
123 case 15:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
124 mode.graphtype = GT_15BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
125 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
126 case 16:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
127 mode.graphtype = GT_16BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
128 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
129 case 24:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
130 mode.graphtype = GT_24BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
131 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
132 case 32:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
133 mode.graphtype = GT_32BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
134 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
135 default:
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
136 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unknown bit depth - using auto\n");
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
137 mode.graphtype = GT_AUTO;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
138 }
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
139
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
140 /* FIXME */
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
141 ggiCheckMode(ggi_conf.vis, &mode);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
142
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
143 if (ggiSetMode(ggi_conf.vis, &mode) != 0)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
144 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
145 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set mode\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
146 uninit();
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
147 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
148 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
149
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
150 if (ggiGetMode(ggi_conf.vis, &mode) != 0)
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
151 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
152 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get mode\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
153 uninit();
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
154 return(-1);
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
155 }
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
156
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
157 ggi_conf.gmode = mode;
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
158
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
159 vo_screenwidth = mode.visible.x;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
160 vo_screenheight = mode.visible.y;
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
161 vo_depthonscreen = d_depth;
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
162 // vo_depthonscreen = GT_DEPTH(mode.graphtype);
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
163 // ggi_bpp = GT_SIZE(mode.graphtype);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
164 ggi_conf.bpp = vo_depthonscreen;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
165
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
166 #ifdef GET_DB_INFO
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
167 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
168 const ggi_directbuffer *db = ggiDBGetBuffer(ggi_conf.vis, 0);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
169
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
170 if (db)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
171 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
172 vo_depthonscreen = db->buffer.plb.pixelformat->depth;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
173 ggi_conf.bpp = db->buffer.plb.pixelformat->size / 8;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
174 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
175 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
176 #endif
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
177
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
178 if (GT_SCHEME(mode.graphtype) == GT_PALETTE)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
179 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
180 ggiSetColorfulPalette(ggi_conf.vis);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
181 ggiGetPalette(ggi_conf.vis, 0, 1 << ggi_conf.bpp, pal);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
182 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
183
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
184 #if 0
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
185 printf("[ggi] mode: ");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
186 ggiPrintMode(&ggi_conf.gmode);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
187 printf("\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
188 #endif
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
189
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
190 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] screen: %dx%dx%d frames: %d\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
191 vo_screenwidth, vo_screenheight, vo_depthonscreen, ggi_conf.gmode.frames);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
192
1198
e7c9e8eaa426 Should fix bytes per pixel for 15bpp.
atmosfear
parents: 1172
diff changeset
193 ggi_conf.bppmul = (ggi_conf.bpp+7)/8;
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
194
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
195 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
196 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
197
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
198
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
199 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
200 uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format,const vo_tune_info_t *info)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
201 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
202 int i;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
203
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
204 vo_depthonscreen = 32;
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
205 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] This driver has got bugs, if you can, fix them.\n");
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
206
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
207 /* source image parameters */
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
208 ggi_conf.srcwidth = width;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
209 ggi_conf.srcheight = height;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
210 ggi_conf.srcformat = format;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
211 if (IMGFMT_IS_RGB(ggi_conf.srcformat))
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
212 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
213 ggi_conf.srcdepth = IMGFMT_RGB_DEPTH(ggi_conf.srcformat);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
214 ggi_conf.srctype = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
215 }
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
216 else
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
217 if (IMGFMT_IS_BGR(ggi_conf.srcformat))
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
218 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
219 ggi_conf.srcdepth = IMGFMT_BGR_DEPTH(ggi_conf.srcformat);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
220 ggi_conf.srctype = BGR;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
221 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
222 else
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
223 switch(ggi_conf.srcformat)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
224 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
225 case IMGFMT_IYUV:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
226 case IMGFMT_I420:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
227 case IMGFMT_YV12:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
228 #ifdef GGI_YUV_SUPPORT
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
229 ggi_conf.srcdepth = 12;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
230 ggi_conf.srctype = YUV;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
231 #else
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
232 ggi_conf.bpp = vo_depthonscreen;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
233 ggi_conf.mode = RGB;
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
234 yuv2rgb_init(vo_depthonscreen, MODE_RGB);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
235 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
236 break;
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
237 case IMGFMT_UYVY:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
238 case IMGFMT_YUY2:
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
239 #ifdef GGI_YUV_SUPPORT
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
240 ggi_conf.srcdepth = 16;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
241 ggi_conf.srctype = YUV;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
242 #else
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
243 ggi_conf.bpp = vo_depthonscreen;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
244 ggi_conf.mode = RGB;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
245 yuv2rgb_init(vo_depthonscreen, MODE_RGB);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
246 #endif
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
247 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
248 default:
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
249 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] Unknown image format: %s\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
250 vo_format_name(ggi_conf.srcformat));
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
251 uninit();
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
252 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
253 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
254
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
255 ggi_conf.format = format;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
256
1198
e7c9e8eaa426 Should fix bytes per pixel for 15bpp.
atmosfear
parents: 1172
diff changeset
257 ggi_conf.framePlaneRGB = width * height * ((ggi_conf.bpp+7)/8); /* fix it! */
e7c9e8eaa426 Should fix bytes per pixel for 15bpp.
atmosfear
parents: 1172
diff changeset
258 ggi_conf.stridePlaneRGB = width * ((ggi_conf.bpp+7)/8);
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
259 #ifdef GGI_YUV_SUPPORT
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
260 ggi_conf.framePlaneY = width * height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
261 ggi_conf.framePlaneUV = (width * height) >> 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
262 ggi_conf.framePlaneYUY = width * height * 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
263 ggi_conf.stridePlaneY = width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
264 ggi_conf.stridePlaneUV = width/2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
265 ggi_conf.stridePlaneYUY = width * 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
266 #endif
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
267 // ggi_conf.width = width;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
268 // ggi_conf.height = height;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
269 ggi_conf.dstwidth = d_width ? d_width : width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
270 ggi_conf.dstheight = d_height ? d_height : height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
271
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
272 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
273 #if 0
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
274 ggi_aspect_ret asp;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
275
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
276 if (width != d_width || height != d_height)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
277 asp = aspect_size(width, height, d_width, d_height);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
278 else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
279 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
280 asp.w = width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
281 asp.h = height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
282 }
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
283 #endif
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
284
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
285 if (ggi_setmode(width, height, vo_depthonscreen) != 0)
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
286 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
287 printf("ggi-init: setmode returned with error\n");
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
288 return(-1);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
289 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
290 }
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
291
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
292 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] input: %d bpp %s - screen depth: %d\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
293 ggi_conf.bpp, vo_format_name(ggi_conf.format), vo_depthonscreen);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
294
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
295 // ggiSetFlags(ggi_conf.vis, GGIFLAG_ASYNC);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
296
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
297 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
298 ggi_directbuffer *DB;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
299
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
300 for (i = 0; i < GGI_FRAMES; i++)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
301 ggi_conf.buffer[i] = NULL;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
302
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
303 ggi_conf.frames = ggi_conf.currframe = 0;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
304
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
305 for (i = 0; DB = ggiDBGetBuffer(ggi_conf.vis, i); i++)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
306 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
307 if (!(DB->type & GGI_DB_SIMPLE_PLB) ||
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
308 (DB->page_size != 0) ||
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
309 (DB->write == NULL) ||
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
310 (DB->noaccess != 0) ||
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
311 (DB->align != 0) ||
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
312 (DB->layout != blPixelLinearBuffer))
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
313 continue;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
314
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
315 ggi_conf.buffer[DB->frame] = DB;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
316 ggi_conf.frames++;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
317 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
318 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
319
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
320
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
321 if (ggi_conf.buffer[0] == NULL)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
322 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
323 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] direct buffer is not available\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
324 uninit();
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
325 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
326 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
327
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
328 for (i = 0; i < ggi_conf.frames; i++)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
329 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
330 if (ggi_conf.buffer[i] == NULL)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
331 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
332 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] direct buffer for doublbuffering is not available\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
333 uninit();
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
334 return(-1);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
335 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
336 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
337
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
338 ggiSetDisplayFrame(ggi_conf.vis, ggi_conf.currframe);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
339 ggiSetWriteFrame(ggi_conf.vis, ggi_conf.currframe);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
340
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
341 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
342 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
343
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
344 static const vo_info_t *get_info(void)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
345 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
346 return &vo_info;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
347 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
348
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
349 static uint32_t draw_frame(uint8_t *src[])
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
350 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
351 int x, y, size;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
352 unsigned char *ptr, *ptr2, *spt;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
353
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
354 ggiResourceAcquire(ggi_conf.buffer[ggi_conf.currframe]->resource,
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
355 GGI_ACTYPE_WRITE);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
356
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
357 ggiSetWriteFrame(ggi_conf.vis, ggi_conf.currframe);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
358
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
359 #if 1
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
360 ptr = ggi_conf.buffer[ggi_conf.currframe]->write;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
361 spt = src[0];
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
362 size = ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.pixelformat->size/8;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
363
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
364 for (y = 0; y < ggi_conf.srcheight; y++)
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
365 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
366 ptr2 = ptr;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
367 for (x = 0; x < ggi_conf.srcwidth; x++)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
368 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
369 ptr2[0] = *spt++;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
370 ptr2[1] = *spt++;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
371 ptr2[2] = *spt++;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
372 switch(ggi_conf.format)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
373 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
374 case IMGFMT_BGR32:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
375 case IMGFMT_RGB32:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
376 spt++;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
377 break;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
378 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
379 ptr2 += size;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
380 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
381 ptr += ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.stride;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
382 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
383 #else
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
384 memcpy(ggi_conf.buffer[ggi_conf.currframe]->write, src[0], ggi_conf.framePlaneRGB);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
385 #endif
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
386
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
387 ggiResourceRelease(ggi_conf.buffer[ggi_conf.currframe]->resource);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
388 return(0);
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
389 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
390
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
391 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
392 unsigned char *srca, int stride)
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
393 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
394 switch(ggi_conf.format)
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
395 {
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
396 case IMGFMT_YV12:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
397 case IMGFMT_I420:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
398 case IMGFMT_IYUV:
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
399 #ifdef GGI_YUV_SUPPORT
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
400 vo_draw_alpha_yv12(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
401 ggi_conf.buffer[ggi_conf.currframe]->write+(ggi_conf.srcwidth*y0+x0),
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
402 ggi_conf.srcwidth);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
403 #else
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
404 switch (vo_depthonscreen)
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
405 {
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
406 case 32:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
407 vo_draw_alpha_rgb32(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
408 ggi_conf.buffer[ggi_conf.currframe]->write+4*(ggi_conf.srcwidth*y0+x0), 4*ggi_conf.srcwidth);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
409 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
410 case 24:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
411 vo_draw_alpha_rgb24(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
412 ggi_conf.buffer[ggi_conf.currframe]->write+3*(ggi_conf.srcwidth*y0+x0), 3*ggi_conf.srcwidth);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
413 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
414 case 16:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
415 vo_draw_alpha_rgb16(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
416 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0), 2*ggi_conf.srcwidth);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
417 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
418 case 15:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
419 vo_draw_alpha_rgb15(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
420 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0), 2*ggi_conf.srcwidth);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
421 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
422 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
423 #endif
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
424 break;
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
425 case IMGFMT_YUY2:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
426 case IMGFMT_YVYU:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
427 vo_draw_alpha_yuy2(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
428 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0),
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
429 2*ggi_conf.srcwidth);
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
430 break;
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
431 case IMGFMT_UYVY:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
432 vo_draw_alpha_yuy2(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
433 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0)+1,
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
434 2*ggi_conf.srcwidth);
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
435 break;
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
436 case IMGFMT_RGB15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
437 case IMGFMT_BGR15:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
438 vo_draw_alpha_rgb15(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
439 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0), 2*ggi_conf.srcwidth);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
440 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
441 case IMGFMT_RGB16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
442 case IMGFMT_BGR16:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
443 vo_draw_alpha_rgb16(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
444 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.srcwidth*y0+x0), 2*ggi_conf.srcwidth);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
445 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
446 case IMGFMT_RGB24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
447 case IMGFMT_BGR24:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
448 vo_draw_alpha_rgb24(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
449 ggi_conf.buffer[ggi_conf.currframe]->write+3*(ggi_conf.srcwidth*y0+x0), 3*ggi_conf.srcwidth);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
450 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
451 case IMGFMT_RGB32:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
452 case IMGFMT_BGR32:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
453 vo_draw_alpha_rgb32(w, h, src, srca, stride,
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
454 ggi_conf.buffer[ggi_conf.currframe]->write+4*(ggi_conf.srcwidth*y0+x0), 4*ggi_conf.srcwidth);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
455 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
456 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
457 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
458
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1198
diff changeset
459 static void draw_osd(void)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
460 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
461 vo_draw_text(ggi_conf.srcwidth, ggi_conf.srcheight, draw_alpha);
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1198
diff changeset
462 }
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1198
diff changeset
463
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1198
diff changeset
464 static void flip_page(void)
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 1198
diff changeset
465 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
466 ggiSetDisplayFrame(ggi_conf.vis, ggi_conf.currframe);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
467 mp_dbg(MSGT_VO, MSGL_DBG2, "flip_page: current write frame: %d, display frame: %d\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
468 ggiGetWriteFrame(ggi_conf.vis), ggiGetDisplayFrame(ggi_conf.vis));
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
469
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
470 ggi_conf.currframe = (ggi_conf.currframe+1) % ggi_conf.frames;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
471 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
472
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
473 static uint32_t draw_slice(uint8_t *src[], int stride[], int w, int h,
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
474 int x, int y)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
475 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
476 ggiResourceAcquire(ggi_conf.buffer[ggi_conf.currframe]->resource,
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
477 GGI_ACTYPE_WRITE);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
478
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
479 ggiSetWriteFrame(ggi_conf.vis, ggi_conf.currframe);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
480
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
481 #ifndef GGI_YUV_SUPPORT
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
482 yuv2rgb(((uint8_t *) ggi_conf.buffer[ggi_conf.currframe]->write)+
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
483 ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.stride*y+
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
484 x*(ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.pixelformat->size/8),
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
485 src[0], src[1], src[2], w, h, ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.stride,
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
486 stride[0], stride[1]);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
487 #else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
488 int i;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
489
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
490 ggi_conf.buffer[ggi_conf.currframe]->write += (ggi_conf.stridePlaneY * y + x);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
491 for (i = 0; i < h; i++)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
492 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
493 memcpy(ggi_conf.buffer[ggi_conf.currframe]->write, src[0], w);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
494 src[0] += stride[0];
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
495 ggi_conf.buffer[ggi_conf.currframe]->write += ggi_conf.stridePlaneY;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
496 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
497
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
498 x /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
499 y /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
500 w /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
501 h /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
502
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
503 ggi_conf.buffer[ggi_conf.currframe]->write += ggi_conf.stridePlaneY + (ggi_conf.stridePlaneUV * y + x);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
504 for (i = 0; i < h; i++)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
505 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
506 memcpy(ggi_conf.buffer[ggi_conf.currframe]->write, src[1], w);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
507 src[1] += stride[1];
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
508 ggi_conf.buffer[ggi_conf.currframe]->write += ggi_conf.stridePlaneUV;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
509 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
510 #endif
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
511
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
512 ggiResourceRelease(ggi_conf.buffer[ggi_conf.currframe]->resource);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
513 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
514 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
515
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
516 static uint32_t query_format(uint32_t format)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
517 {
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
518 switch(format)
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
519 {
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
520 case IMGFMT_YV12:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
521 case IMGFMT_I420:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
522 case IMGFMT_IYUV:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
523 /* case IMGFMT_YUY2:
1148
93a9a0ca5fb0 bennehagytam egy bugot :(
al3x
parents: 1147
diff changeset
524 case IMGFMT_YVYU:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
525 case IMGFMT_UYVY:*/
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
526 return(0x6);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
527 case IMGFMT_RGB8:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
528 case IMGFMT_RGB15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
529 case IMGFMT_RGB16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
530 case IMGFMT_RGB24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
531 case IMGFMT_RGB32:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
532 case IMGFMT_BGR8:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
533 case IMGFMT_BGR15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
534 case IMGFMT_BGR16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
535 case IMGFMT_BGR24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
536 case IMGFMT_BGR32:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
537 return(0x5);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
538 }
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
539 return(0);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
540 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
541
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
542 static uint32_t preinit(const char *arg)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
543 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
544 if (ggiInit() != 0)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
545 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
546 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to initialize GGI\n");
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
547 return(-1);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
548 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
549
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
550 if (arg)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
551 ggi_conf.driver = arg;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
552 else
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
553 ggi_conf.driver = NULL;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
554
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
555 if ((ggi_conf.vis = ggiOpen(ggi_conf.driver)) == NULL)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
556 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
557 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to open '%s' output\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
558 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
559 ggiExit();
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
560 return(-1);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
561 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
562
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
563 mp_msg(MSGT_VO, MSGL_V, "[ggi] using '%s' output\n",
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
564 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver);
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
565
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
566 return 0;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
567 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
568
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
569 static void uninit(void)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
570 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
571 ggiClose(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
572 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
573 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
574
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
575 static uint32_t control(uint32_t request, void *data, ...)
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
576 {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
577 switch (request) {
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
578 case VOCTRL_QUERY_FORMAT:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
579 return query_format(*((uint32_t*)data));
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
580 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
581 return VO_NOTIMPL;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
582 }
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
583
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
584 #include "../linux/keycodes.h"
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
585 extern void mplayer_put_key(int code);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
586
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
587 static void check_events(void)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
588 {
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
589 struct timeval tv = {0, 0};
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
590 ggi_event event;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
591 ggi_event_mask mask;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
592
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
593 if ((mask = ggiEventPoll(ggi_conf.vis, emAll, &tv)))
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
594 if (ggiEventRead(ggi_conf.vis, &event, emAll) != 0)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
595 {
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
596 mp_dbg(MSGT_VO, MSGL_DBG3, "type: %4x, origin: %4x, sym: %4x, label: %4x, button=%4x\n",
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
597 event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button);
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
598
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
599 if (event.key.type == evKeyPress)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
600 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
601 switch(event.key.sym)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
602 {
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
603 case GIIK_PAsterisk: /* PStar */
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
604 case GIIUC_Asterisk:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
605 mplayer_put_key('*');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
606 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
607 case GIIK_PSlash:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
608 case GIIUC_Slash:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
609 mplayer_put_key('/');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
610 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
611 case GIIK_PPlus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
612 case GIIUC_Plus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
613 mplayer_put_key('+');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
614 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
615 case GIIK_PMinus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
616 case GIIUC_Minus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
617 mplayer_put_key('-');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
618 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
619 case GIIUC_o:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
620 case GIIUC_O:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
621 mplayer_put_key('o');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
622 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
623 case GIIUC_g:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
624 case GIIUC_G:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
625 mplayer_put_key('g');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
626 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
627 case GIIUC_z:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
628 case GIIUC_Z:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
629 mplayer_put_key('z');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
630 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
631 case GIIUC_x:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
632 case GIIUC_X:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
633 mplayer_put_key('x');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
634 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
635 case GIIUC_m:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
636 case GIIUC_M:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
637 mplayer_put_key('m');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
638 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
639 case GIIUC_d:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
640 case GIIUC_D:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
641 mplayer_put_key('d');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
642 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
643 case GIIUC_q:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
644 case GIIUC_Q:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
645 mplayer_put_key('q');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
646 break;
4828
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
647 case GIIUC_h:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
648 case GIIUC_H:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
649 mplayer_put_key('h');
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
650 break;
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
651 case GIIUC_l:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
652 case GIIUC_L:
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
653 mplayer_put_key('l');
0ae597cc28e6 totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents: 4737
diff changeset
654 break;
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
655 case GIIUC_Space:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
656 case GIIUC_p:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
657 case GIIUC_P:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
658 mplayer_put_key('p');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
659 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
660 case GIIK_Up:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
661 mplayer_put_key(KEY_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
662 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
663 case GIIK_Down:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
664 mplayer_put_key(KEY_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
665 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
666 case GIIK_Left:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
667 mplayer_put_key(KEY_LEFT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
668 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
669 case GIIK_Right:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
670 mplayer_put_key(KEY_RIGHT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
671 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
672 case GIIK_PageUp:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
673 mplayer_put_key(KEY_PAGE_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
674 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
675 case GIIK_PageDown:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
676 mplayer_put_key(KEY_PAGE_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
677 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
678 default:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
679 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
680 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
681 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
682 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
683 return;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
684 }