annotate libvo/vo_ggi.c @ 1346:d6e6132bff35

AUDIO_ENCODING_LINEAR8 format is not available on sunos 5.5. Format is unsupported in mplayer for now, to get the code compiled on that old version of the OS.
author jkeil
date Thu, 19 Jul 2001 20:04:54 +0000
parents e7c9e8eaa426
children d40f2b686846
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
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
8 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
9 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
10 */
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 #include <stdio.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
13 #include <stdlib.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
14 #include <string.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
15 #include <errno.h>
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
16
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
17 #include "../config.h"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
18 #include "video_out.h"
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
19 #include "video_out_internal.h"
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
20
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
21 #include "fastmemcpy.h"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
22
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
23 #include <ggi/ggi.h>
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
24
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
25 #undef GGI_OST
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
26 #undef GII_BUGGY_KEYCODES
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
27 #define GGI_OSD
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
28
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
29 #undef get_db_info
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
30
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
31 /* do not make conversions from planar formats */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
32 #undef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
33
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
34 #ifndef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
35 #include "yuv2rgb.h"
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
36 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
37
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
38 LIBVO_EXTERN (ggi)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
39
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
40 static vo_info_t vo_info =
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
41 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
42 "General Graphics Interface (GGI) output",
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
43 "ggi",
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
44 "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
45 "under developement"
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
46 };
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 extern int verbose;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
49
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
50 /* idea stolen from vo_sdl.c :) */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
51 static struct ggi_conf_s {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
52 char *driver;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
53
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
54 ggi_visual_t vis;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
55 ggi_directbuffer *buffer;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
56
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
57 uint8_t bpp;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
58 uint8_t bppmul;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
59
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
60 uint8_t mode;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
61 #define YUV 0
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
62 #define RGB 1
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
63 #define BGR 2
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
64
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
65 /* YUV */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
66 int framePlaneY, framePlaneUV, framePlaneYUY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
67 int stridePlaneY, stridePlaneUV, stridePlaneYUY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
68
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
69 /* RGB */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
70 int framePlaneRGB;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
71 int stridePlaneRGB;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
72
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
73 /* original */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
74 int width, height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
75
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
76 /* destination */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
77 int dstwidth, dstheight;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
78
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
79 /* source image format */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
80 int format;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
81
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
82 /* direct buffer */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
83 uint8_t *dbuff;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
84
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
85 /* i.e. need lock */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
86 int need_acquire;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
87
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
88 #ifdef GGI_OST
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
89 ggi_pixel white;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
90 ggi_pixel black;
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
91 #endif
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
92 } ggi_conf;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
93
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
94 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
95 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
96 ggi_mode mode =
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
97 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
98 1, /* frames */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
99 { GGI_AUTO, GGI_AUTO }, /* visible */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
100 { GGI_AUTO, GGI_AUTO }, /* virt */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
101 { GGI_AUTO, GGI_AUTO }, /* size */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
102 GT_AUTO, /* graphtype */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
103 { 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
104 };
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
105 ggi_color pal[256];
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
106
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
107 if (verbose)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
108 printf("ggi-setmode: requested: %dx%d (%d depth)\n",
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
109 d_width, d_height, d_depth);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
110
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
111 mode.size.x = vo_screenwidth;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
112 mode.size.y = vo_screenheight;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
113 mode.visible.x = mode.virt.x = d_width;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
114 mode.visible.y = mode.virt.y = d_height;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
115
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
116 switch(d_depth)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
117 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
118 case 1:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
119 mode.graphtype = GT_1BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
120 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
121 case 2:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
122 mode.graphtype = GT_2BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
123 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
124 case 4:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
125 mode.graphtype = GT_4BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
126 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
127 case 8:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
128 mode.graphtype = GT_8BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
129 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
130 case 15:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
131 mode.graphtype = GT_15BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
132 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
133 case 16:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
134 mode.graphtype = GT_16BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
135 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
136 case 24:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
137 mode.graphtype = GT_24BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
138 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
139 case 32:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
140 mode.graphtype = GT_32BIT;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
141 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
142 default:
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
143 printf("ggi-setmode: unknown bit depth - using auto\n");
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
144 mode.graphtype = GT_AUTO;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
145 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
146
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
147 ggiCheckMode(ggi_conf.vis, &mode);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
148
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
149 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
150 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
151 printf("ggi-setmode: unable to set mode\n");
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
152 ggiClose(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
153 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
154 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
155 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
156
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
157 if (ggiGetMode(ggi_conf.vis, &mode) != 0)
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
158 {
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
159 printf("ggi-setmode: unable to get mode\n");
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
160 ggiClose(ggi_conf.vis);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
161 ggiExit();
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
162 return(-1);
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
163 }
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
164
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
165 ggi_conf.width = mode.virt.x;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
166 ggi_conf.height = mode.virt.y;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
167 vo_screenwidth = mode.visible.x;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
168 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
169 vo_depthonscreen = d_depth;
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
170 // vo_depthonscreen = GT_DEPTH(mode.graphtype);
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
171 // ggi_bpp = GT_SIZE(mode.graphtype);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
172 ggi_conf.bpp = vo_depthonscreen;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
173
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
174 #ifdef get_db_info
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
175 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
176 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
177
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
178 if (db)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
179 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
180 vo_depthonscreen = db->buffer.plb.pixelformat->depth;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
181 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
182 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
183 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
184 #endif
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
185
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
186 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
187 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
188 ggiSetColorfulPalette(ggi_conf.vis);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
189 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
190 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
191
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
192 if (verbose)
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
193 printf("ggi-setmode: %dx%d (virt: %dx%d) (size: %dx%d) screen depth: %d, bpp: %d\n",
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
194 vo_screenwidth, vo_screenheight, ggi_conf.width, ggi_conf.height,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
195 mode.size.x, mode.size.y,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
196 vo_depthonscreen, ggi_conf.bpp);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
197
1198
e7c9e8eaa426 Should fix bytes per pixel for 15bpp.
atmosfear
parents: 1172
diff changeset
198 ggi_conf.bppmul = (ggi_conf.bpp+7)/8;
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
199
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
200 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
201 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
202
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
203 typedef struct ggi_aspect_ret_s { int w, h, x, y; } ggi_aspect_ret;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
204
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
205 /* stolen from vo_sdl.c */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
206 #define MONITOR_ASPECT 4.0/3.0
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
207 static ggi_aspect_ret aspect_size(int srcw, int srch, int dstw, int dsth)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
208 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
209 ggi_aspect_ret ret;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
210 float float_h;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
211
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
212 if (verbose)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
213 printf("ggi-aspectsize: src: %dx%d dst: %dx%d\n",
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
214 srcw, srch, dstw, dsth);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
215
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
216 float_h = ((float)dsth / (float)srcw * (float)srch) * ((float)dsth /
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
217 ((float)dstw / (MONITOR_ASPECT)));
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
218
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
219 if (float_h > dsth)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
220 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
221 ret.w = (int)((float)dsth / (float)float_h) * dstw;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
222 ret.h = dsth;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
223 ret.x = (dstw - ret.w) / 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
224 ret.y = 0;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
225 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
226 else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
227 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
228 ret.h = (int)float_h;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
229 ret.w = dstw;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
230 ret.x = 0;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
231 ret.y = (dsth - ret.h) / 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
232 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
233
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
234 printf("ggi-aspectsize: %dx%d (x: %d, y: %d)\n", ret.w, ret.h, ret.x, ret.y);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
235 return(ret);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
236 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
237
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
238 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
239 uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
240 {
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
241 vo_depthonscreen = 32;
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
242 printf("ggi-init: 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
243
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
244 if (ggiInit() != 0)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
245 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
246 printf("ggi-init: unable to initialize GGI\n");
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
247 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
248 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
249
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
250 ggi_conf.driver = NULL;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
251
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
252 if ((ggi_conf.vis = ggiOpen(ggi_conf.driver)) == NULL)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
253 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
254 printf("ggi-init: unable to open GGI for %s output\n",
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
255 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
256 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
257 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
258 }
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
259
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
260 printf("ggi-init: using %s GGI output\n",
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
261 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
262
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
263 switch(format)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
264 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
265 case IMGFMT_RGB8:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
266 ggi_conf.bpp = 8;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
267 ggi_conf.mode = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
268 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
269 case IMGFMT_RGB15:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
270 ggi_conf.bpp = 15;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
271 ggi_conf.mode = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
272 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
273 case IMGFMT_RGB16:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
274 ggi_conf.bpp = 16;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
275 ggi_conf.mode = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
276 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
277 case IMGFMT_RGB24:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
278 ggi_conf.bpp = 24;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
279 ggi_conf.mode = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
280 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
281 case IMGFMT_RGB32:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
282 ggi_conf.bpp = 32;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
283 ggi_conf.mode = RGB;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
284 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
285 case IMGFMT_BGR8:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
286 ggi_conf.bpp = 8;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
287 ggi_conf.mode = BGR;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
288 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
289 case IMGFMT_BGR15:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
290 ggi_conf.bpp = 15;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
291 ggi_conf.mode = BGR;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
292 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
293 case IMGFMT_BGR16:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
294 ggi_conf.bpp = 16;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
295 ggi_conf.mode = BGR;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
296 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
297 case IMGFMT_BGR24:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
298 ggi_conf.bpp = 24;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
299 ggi_conf.mode = BGR;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
300 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
301 case IMGFMT_BGR32:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
302 ggi_conf.bpp = 32;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
303 ggi_conf.mode = BGR;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
304 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
305 case IMGFMT_YV12: /* rgb, 24bit */
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
306 case IMGFMT_I420:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
307 case IMGFMT_IYUV:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
308 ggi_conf.bpp = 16;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
309 ggi_conf.mode = YUV;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
310 #ifndef GGI_PLANAR_NOCONV
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
311 yuv2rgb_init(32/*vo_depthonscreen*/, MODE_RGB);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
312 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
313 break;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
314 case IMGFMT_YUY2:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
315 ggi_conf.bpp = 24;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
316 ggi_conf.mode = YUV;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
317 #ifndef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
318 yuv2rgb_init(32, MODE_RGB);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
319 #endif
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
320 break;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
321 default:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
322 printf("ggi-init: no suitable image format found (requested: %s)\n",
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
323 vo_format_name(format));
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
324 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
325 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
326
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
327 ggi_conf.format = format;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
328
1198
e7c9e8eaa426 Should fix bytes per pixel for 15bpp.
atmosfear
parents: 1172
diff changeset
329 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
330 ggi_conf.stridePlaneRGB = width * ((ggi_conf.bpp+7)/8);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
331 #ifdef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
332 ggi_conf.framePlaneY = width * height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
333 ggi_conf.framePlaneUV = (width * height) >> 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
334 ggi_conf.framePlaneYUY = width * height * 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
335 ggi_conf.stridePlaneY = width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
336 ggi_conf.stridePlaneUV = width/2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
337 ggi_conf.stridePlaneYUY = width * 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
338 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
339 ggi_conf.width = width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
340 ggi_conf.height = height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
341 ggi_conf.dstwidth = d_width ? d_width : width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
342 ggi_conf.dstheight = d_height ? d_height : height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
343
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
344 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
345 ggi_aspect_ret asp;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
346
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
347 if (width != d_width || height != d_height)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
348 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
349 else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
350 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
351 asp.w = width;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
352 asp.h = height;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
353 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
354
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
355 if (ggi_setmode(asp.w, asp.h, vo_depthonscreen) != 0)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
356 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
357 printf("ggi-init: setmode returned with error\n");
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
358 return(-1);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
359 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
360 }
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
361
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
362 printf("ggi-init: input: %d bpp %s - screen depth: %d\n", ggi_conf.bpp,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
363 vo_format_name(ggi_conf.format), vo_depthonscreen);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
364
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
365 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
366
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
367 ggi_conf.buffer = (ggi_directbuffer *)ggiDBGetBuffer(ggi_conf.vis, 0);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
368
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
369 if (ggi_conf.buffer == NULL)
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
370 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
371 printf("ggi-init: double buffering is not available\n");
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
372 ggiClose(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
373 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
374 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
375 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
376
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
377 if (!(ggi_conf.buffer->type & GGI_DB_SIMPLE_PLB) ||
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
378 (ggi_conf.buffer->page_size != 0) ||
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
379 (ggi_conf.buffer->write == NULL) ||
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
380 (ggi_conf.buffer->noaccess != 0) ||
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
381 (ggi_conf.buffer->align != 0) ||
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
382 (ggi_conf.buffer->layout != blPixelLinearBuffer))
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
383 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
384 printf("ggi-init: incorrect video memory type\n");
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
385 ggiClose(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
386 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
387 return(-1);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
388 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
389
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
390 if (ggi_conf.buffer->resource != NULL)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
391 ggi_conf.need_acquire = 1;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
392
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
393 if (verbose && ggi_conf.need_acquire)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
394 printf("ggi-init: ggi needs acquire\n");
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
395
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
396 ggi_conf.dbuff = ggi_conf.buffer->write;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
397
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
398 #ifdef GGI_OST
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
399 /* just for fun */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
400 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
401 ggi_color col;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
402
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
403 /* set black */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
404 col.r = col.g = col.b = 0x0000;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
405 ggi_conf.black = ggiMapColor(ggi_conf.vis, &col);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
406
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
407 /* set white */
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
408 col.r = col.g = col.b = 0xffff;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
409 ggi_conf.white = ggiMapColor(ggi_conf.vis, &col);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
410
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
411 ggiSetGCForeground(ggi_conf.vis, ggi_conf.white);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
412 ggiSetGCBackground(ggi_conf.vis, ggi_conf.black);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
413 }
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
414 #endif
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
415
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
416 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
417 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
418
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
419 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
420 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
421 return &vo_info;
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
422 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
423
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
424 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
425 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
426 if (ggi_conf.need_acquire)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
427 ggiResourceAcquire(ggi_conf.buffer->resource, GGI_ACTYPE_WRITE);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
428
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
429 // ggiSetDisplayFrame(ggi_conf.vis, ggi_conf.buffer->frame);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
430 // ggiSetWriteFrame(ggi_conf.vis, ggi_conf.buffer->frame);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
431
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
432 #ifdef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
433 switch(ggi_conf.format)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
434 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
435 case IMGFMT_YV12:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
436 case IMGFMT_I420:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
437 case IMGFMT_IYUV:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
438 memcpy(ggi_conf.dbuff, src[0], ggi_conf.framePlaneY);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
439 ggi_conf.dbuff += ggi_conf.framePlaneY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
440 memcpy(ggi_conf.dbuff, src[2], ggi_conf.framePlaneUV);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
441 ggi_conf.dbuff += ggi_conf.framePlaneUV;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
442 memcpy(ggi_conf.dbuff, src[1], ggi_conf.framePlaneUV);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
443 printf("yv12 img written");
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
444 break;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
445 default:
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
446 memcpy(ggi_conf.dbuff, src[0], ggi_conf.framePlaneRGB);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
447 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
448 #else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
449 memcpy(ggi_conf.dbuff, 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
450 #endif
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
451
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
452 if (ggi_conf.need_acquire)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
453 ggiResourceRelease(ggi_conf.buffer->resource);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
454 return(0);
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
455 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
456
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
457 #ifdef GGI_OSD
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
458 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
459 unsigned char *srca, int stride)
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
460 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
461 switch(ggi_conf.format)
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
462 {
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
463 case IMGFMT_YV12:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
464 case IMGFMT_I420:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
465 case IMGFMT_IYUV:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
466 #ifdef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
467 vo_draw_alpha_yv12(w, h, src, srca, stride,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
468 ggi_conf.dbuff+(ggi_conf.width*y0+x0),
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
469 ggi_conf.width);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
470 #else
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
471 switch (vo_depthonscreen)
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
472 {
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
473 case 32:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
474 vo_draw_alpha_rgb32(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
475 ggi_conf.dbuff+4*(ggi_conf.width*y0+x0), 4*ggi_conf.width);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
476 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
477 case 24:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
478 vo_draw_alpha_rgb24(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
479 ggi_conf.dbuff+3*(ggi_conf.width*y0+x0), 3*ggi_conf.width);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
480 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
481 case 16:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
482 vo_draw_alpha_rgb16(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
483 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0), 2*ggi_conf.width);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
484 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
485 case 15:
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
486 vo_draw_alpha_rgb15(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
487 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0), 2*ggi_conf.width);
1147
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
488 break;
82bbd3ee8ce7 hacked osd working on yv12
al3x
parents: 1145
diff changeset
489 }
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
490 #endif
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
491 break;
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
492 case IMGFMT_YUY2:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
493 case IMGFMT_YVYU:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
494 vo_draw_alpha_yuy2(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
495 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0),
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
496 2*ggi_conf.width);
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
497 break;
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
498 case IMGFMT_UYVY:
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
499 vo_draw_alpha_yuy2(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
500 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0)+1,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
501 2*ggi_conf.width);
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
502 break;
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
503 case IMGFMT_RGB15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
504 case IMGFMT_BGR15:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
505 vo_draw_alpha_rgb15(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
506 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0), 2*ggi_conf.width);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
507 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
508 case IMGFMT_RGB16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
509 case IMGFMT_BGR16:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
510 vo_draw_alpha_rgb16(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
511 ggi_conf.dbuff+2*(ggi_conf.width*y0+x0), 2*ggi_conf.width);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
512 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
513 case IMGFMT_RGB24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
514 case IMGFMT_BGR24:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
515 vo_draw_alpha_rgb24(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
516 ggi_conf.dbuff+3*(ggi_conf.width*y0+x0), 3*ggi_conf.width);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
517 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
518 case IMGFMT_RGB32:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
519 case IMGFMT_BGR32:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
520 vo_draw_alpha_rgb32(w, h, src, srca, stride,
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
521 ggi_conf.dbuff+4*(ggi_conf.width*y0+x0), 4*ggi_conf.width);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
522 break;
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
523 }
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
524 }
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
525 #endif
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
526
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
527 static void flip_page(void)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
528 {
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
529 check_events();
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
530 #ifdef GGI_OSD
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
531 vo_draw_text(ggi_conf.width, ggi_conf.height, draw_alpha);
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
532 #endif
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
533 ggiFlush(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
534 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
535
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
536 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
537 int x, int y)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
538 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
539 if (ggi_conf.need_acquire)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
540 ggiResourceAcquire(ggi_conf.buffer->resource, GGI_ACTYPE_WRITE);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
541 #ifndef GGI_PLANAR_NOCONV
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
542 yuv2rgb(((uint8_t *) ggi_conf.dbuff)+(ggi_conf.width*y+x)*ggi_conf.bppmul,
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
543 src[0], src[1], src[2], w, h, ggi_conf.width*ggi_conf.bppmul, stride[0],
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
544 stride[1]);
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
545 #else
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
546 int i;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
547
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
548 ggi_conf.dbuff += (ggi_conf.stridePlaneY * y + x);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
549 for (i = 0; i < h; i++)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
550 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
551 memcpy(ggi_conf.dbuff, src[0], w);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
552 src[0] += stride[0];
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
553 ggi_conf.dbuff += ggi_conf.stridePlaneY;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
554 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
555
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
556 x /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
557 y /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
558 w /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
559 h /= 2;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
560
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
561 ggi_conf.dbuff += ggi_conf.stridePlaneY + (ggi_conf.stridePlaneUV * y + x);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
562 for (i = 0; i < h; i++)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
563 {
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
564 memcpy(ggi_conf.dbuff, src[1], w);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
565 src[1] += stride[1];
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
566 ggi_conf.dbuff += ggi_conf.stridePlaneUV;
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
567 }
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
568 #endif
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
569 if (ggi_conf.need_acquire)
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
570 ggiResourceRelease(ggi_conf.buffer->resource);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
571 return(0);
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
572 }
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 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
575 {
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
576 switch(format)
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
577 {
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
578 case IMGFMT_YV12:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
579 case IMGFMT_I420:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
580 case IMGFMT_IYUV:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
581 /* case IMGFMT_YUY2:
1148
93a9a0ca5fb0 bennehagytam egy bugot :(
al3x
parents: 1147
diff changeset
582 case IMGFMT_YVYU:
1144
7bf91ff0ec28 hacked osd and input control handling
al3x
parents: 1143
diff changeset
583 case IMGFMT_UYVY:*/
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
584 return(0x6);
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
585 case IMGFMT_RGB8:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
586 case IMGFMT_RGB15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
587 case IMGFMT_RGB16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
588 case IMGFMT_RGB24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
589 case IMGFMT_RGB32:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
590 case IMGFMT_BGR8:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
591 case IMGFMT_BGR15:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
592 case IMGFMT_BGR16:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
593 case IMGFMT_BGR24:
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
594 case IMGFMT_BGR32:
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
595 return(0x5);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
596 }
1141
c33f8b7488d1 cleaned up, and merged with my version, also code will be faster too
al3x
parents: 1132
diff changeset
597 return(0);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
598 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
599
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
600 static void uninit(void)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
601 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
602 ggiResourceRelease(ggi_conf.buffer->resource);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
603 ggiClose(ggi_conf.vis);
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
604 ggiExit();
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
605 }
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
606
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
607 #include "../linux/keycodes.h"
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
608 extern void mplayer_put_key(int code);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
609
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
610 static void check_events(void)
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
611 {
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
612 struct timeval tv = {0, 0};
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
613 ggi_event event;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
614 ggi_event_mask mask;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
615
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
616 if ((mask = ggiEventPoll(ggi_conf.vis, emAll, &tv)))
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
617 if (ggiEventRead(ggi_conf.vis, &event, emAll) != 0)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
618 {
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
619 #if 0 /* debug ;) */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
620 printf("type: %4x, origin: %4x, sym: %4x, label: %4x, button=%4x\n",
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
621 event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button);
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
622 #endif
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
623
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
624 if (event.key.type == evKeyPress)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
625 {
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
626 #ifdef GII_BUGGY_KEYCODES
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
627 switch(event.key.button)
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
628 {
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
629 case 0x37:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
630 mplayer_put_key('*');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
631 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
632 case 0x68:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
633 mplayer_put_key('/');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
634 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
635 case 0x4e:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
636 mplayer_put_key('+');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
637 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
638 case 0x4a:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
639 mplayer_put_key('-');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
640 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
641 case 0x18: /* o */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
642 mplayer_put_key('o');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
643 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
644 case 0x22: /* g */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
645 mplayer_put_key('g');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
646 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
647 case 0x15: /* z */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
648 mplayer_put_key('z');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
649 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
650 case 0x2d: /* x */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
651 mplayer_put_key('x');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
652 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
653 case 0x32: /* m */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
654 mplayer_put_key('m');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
655 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
656 case 0x20: /* d */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
657 mplayer_put_key('d');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
658 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
659 case 0x10: /* q */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
660 mplayer_put_key('q');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
661 break;
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
662 case 0x39: /* space */
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
663 case 0x19: /* p */
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
664 mplayer_put_key('p');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
665 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
666 case 0x5a:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
667 mplayer_put_key(KEY_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
668 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
669 case 0x60:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
670 mplayer_put_key(KEY_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
671 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
672 case 0x5c:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
673 mplayer_put_key(KEY_LEFT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
674 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
675 case 0x5e:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
676 mplayer_put_key(KEY_RIGHT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
677 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
678 case 0x5b:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
679 mplayer_put_key(KEY_PAGE_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
680 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
681 case 0x61:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
682 mplayer_put_key(KEY_PAGE_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
683 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
684 default:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
685 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
686 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
687 #else
1172
290353337b44 hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents: 1148
diff changeset
688 switch(event.key.sym)
1143
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
689 {
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
690 case GIIK_PAsterisk: /* PStar */
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
691 case GIIUC_Asterisk:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
692 mplayer_put_key('*');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
693 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
694 case GIIK_PSlash:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
695 case GIIUC_Slash:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
696 mplayer_put_key('/');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
697 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
698 case GIIK_PPlus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
699 case GIIUC_Plus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
700 mplayer_put_key('+');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
701 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
702 case GIIK_PMinus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
703 case GIIUC_Minus:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
704 mplayer_put_key('-');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
705 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
706 case GIIUC_o:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
707 case GIIUC_O:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
708 mplayer_put_key('o');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
709 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
710 case GIIUC_g:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
711 case GIIUC_G:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
712 mplayer_put_key('g');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
713 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
714 case GIIUC_z:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
715 case GIIUC_Z:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
716 mplayer_put_key('z');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
717 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
718 case GIIUC_x:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
719 case GIIUC_X:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
720 mplayer_put_key('x');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
721 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
722 case GIIUC_m:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
723 case GIIUC_M:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
724 mplayer_put_key('m');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
725 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
726 case GIIUC_d:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
727 case GIIUC_D:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
728 mplayer_put_key('d');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
729 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
730 case GIIUC_q:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
731 case GIIUC_Q:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
732 mplayer_put_key('q');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
733 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
734 case GIIUC_Space:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
735 case GIIUC_p:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
736 case GIIUC_P:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
737 mplayer_put_key('p');
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
738 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
739 case GIIK_Up:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
740 mplayer_put_key(KEY_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
741 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
742 case GIIK_Down:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
743 mplayer_put_key(KEY_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
744 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
745 case GIIK_Left:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
746 mplayer_put_key(KEY_LEFT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
747 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
748 case GIIK_Right:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
749 mplayer_put_key(KEY_RIGHT);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
750 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
751 case GIIK_PageUp:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
752 mplayer_put_key(KEY_PAGE_UP);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
753 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
754 case GIIK_PageDown:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
755 mplayer_put_key(KEY_PAGE_DOWN);
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
756 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
757 default:
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
758 break;
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
759 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
760 #endif
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
761 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
762 }
a9d985d6aa91 key controlling implemented
al3x
parents: 1141
diff changeset
763 return;
1132
80a0f8aa2360 Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff changeset
764 }