Mercurial > mplayer.hg
annotate libvo/vo_ggi.c @ 16350:4950a583d855
and again.. sorry :/
author | ods15 |
---|---|
date | Fri, 02 Sep 2005 08:59:28 +0000 |
parents | 7f34acc96aa4 |
children | ff4af59f64b2 |
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 |
10368 | 4 (C) Alex Beregszaszi |
1132
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 |
4841 | 8 TODO: |
9 * check on many devices | |
5703 | 10 * implement gamma handling (VAA isn't obsoleted?) |
11 | |
12 BUGS: | |
11110 | 13 * palettized playback has bad colors, probably swapped palette? |
5703 | 14 * fbdev & DR produces two downscaled images |
15 * fbdev & FLIP (& DR) produces no image | |
4841 | 16 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
17 Thanks to Andreas Beck for his patches. |
5703 | 18 |
4841 | 19 Many thanks to Atmosfear, he hacked this driver to work with Planar |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
20 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
|
21 */ |
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 <stdio.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
24 #include <stdlib.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
25 #include <string.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
26 #include <errno.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
27 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
28 #include "mp_msg.h" |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
29 |
12650
ac3fd2ff2561
Unify the config.h #include, use "config.h" instead of "../config.h"
diego
parents:
11110
diff
changeset
|
30 #include "config.h" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
31 #include "video_out.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
32 #include "video_out_internal.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
33 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
34 #include "fastmemcpy.h" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
35 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
36 #include <ggi/ggi.h> |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
37 |
15406 | 38 #ifdef HAVE_GGIWMH |
39 #include <ggi/wmh.h> | |
40 #endif | |
41 | |
4831
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
42 /* maximum buffers */ |
5703 | 43 #undef GGI_FLIP |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
44 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
45 static vo_info_t info = |
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 "General Graphics Interface (GGI) output", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
48 "ggi", |
10368 | 49 "Alex Beregszaszi", |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
50 "major" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
51 }; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
52 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
53 LIBVO_EXTERN (ggi) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
54 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
55 static struct ggi_conf_s { |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
56 char *driver; |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
57 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
58 ggi_visual_t parentvis; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
59 ggi_visual_t vis; |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
60 |
4830 | 61 /* source image format */ |
62 int srcwidth; | |
63 int srcheight; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
64 int srcformat; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
65 int srcdepth; |
5703 | 66 int srcbpp; |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
67 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
68 /* dirty region */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
69 struct { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
70 int x1, y1; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
71 int x2, y2; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
72 } flushregion; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
73 |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
74 /* destination */ |
4830 | 75 int dstwidth; |
76 int dstheight; | |
4841 | 77 |
78 int async; | |
5703 | 79 |
80 int voflags; | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
81 } ggi_conf; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
82 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
83 |
15406 | 84 #ifdef HAVE_GGIWMH |
85 static void window_ontop(void) | |
86 { | |
87 mp_msg(MSGT_VO, MSGL_V, "[ggi] debug: window_ontop() called\n"); | |
88 ggiWmhZOrder(ggi_conf.parentvis, ZO_TOP); | |
89 return; | |
90 } | |
91 #endif | |
92 | |
93 | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
94 static void set_graphtype(uint32_t format, ggi_mode *mode) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
95 { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
96 switch(format) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
97 { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
98 case IMGFMT_RGB4: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
99 mode->graphtype = GT_4BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
100 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
101 case IMGFMT_BGR4: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
102 mode->graphtype = GT_4BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
103 GT_SETSUBSCHEME(mode->graphtype, GT_SUB_HIGHBIT_RIGHT); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
104 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
105 case IMGFMT_RGB8: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
106 case IMGFMT_BGR8: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
107 mode->graphtype = GT_8BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
108 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
109 case IMGFMT_RGB15: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
110 case IMGFMT_BGR15: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
111 mode->graphtype = GT_15BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
112 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
113 case IMGFMT_RGB16: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
114 case IMGFMT_BGR16: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
115 mode->graphtype = GT_16BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
116 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
117 case IMGFMT_RGB24: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
118 case IMGFMT_BGR24: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
119 mode->graphtype = GT_24BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
120 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
121 case IMGFMT_RGB32: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
122 case IMGFMT_BGR32: |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
123 mode->graphtype = GT_32BIT; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
124 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
125 } |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
126 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
127 return; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
128 } |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
129 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
130 static int config(uint32_t width, uint32_t height, uint32_t d_width, |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6817
diff
changeset
|
131 uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
132 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
133 ggi_mode mode = { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
134 1, /* frames */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
135 { 0, 0 }, /* top, left corner */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
136 { width, height }, /* bottem, right corner */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
137 { GGI_AUTO, GGI_AUTO }, /* size */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
138 GT_AUTO, /* graphtype */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
139 { GGI_AUTO, GGI_AUTO } /* dots per pixel */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
140 }; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
141 ggi_mode parentmode = |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
142 { |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
143 1, /* frames */ |
4830 | 144 { width, height }, /* visible */ |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
145 { GGI_AUTO, GGI_AUTO }, /* virt */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
146 { GGI_AUTO, GGI_AUTO }, /* size */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
147 GT_AUTO, /* graphtype */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
148 { 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
|
149 }; |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
150 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
151 set_graphtype(format, &parentmode); |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
152 |
5703 | 153 #if 0 |
4830 | 154 printf("[ggi] mode: "); |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
155 ggiPrintMode(&parentmode); |
4830 | 156 printf("\n"); |
15406 | 157 |
158 printf("[ggi] submode: "); | |
159 ggiPrintMode(&mode); | |
160 printf("\n"); | |
4830 | 161 #endif |
162 | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
163 ggiCheckMode(ggi_conf.parentvis, &parentmode); |
4830 | 164 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
165 if (ggiSetMode(ggi_conf.parentvis, &parentmode) < 0) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
166 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
167 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set display mode\n"); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
168 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
169 } |
4830 | 170 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
171 if (ggiGetMode(ggi_conf.parentvis, &parentmode) < 0) |
1147 | 172 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
173 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get display mode\n"); |
1147 | 174 return(-1); |
175 } | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
176 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
177 if ((parentmode.graphtype == GT_INVALID) || (parentmode.graphtype == GT_AUTO)) |
4841 | 178 { |
179 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] not supported depth/bpp\n"); | |
180 return(-1); | |
181 } | |
182 | |
15406 | 183 #if 0 |
184 printf("[ggi] mode: "); | |
185 ggiPrintMode(&parentmode); | |
186 printf("\n"); | |
187 #endif | |
188 | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
189 /* calculate top, left corner */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
190 mode.visible.x = (parentmode.virt.x - width) / 2; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
191 mode.visible.y = (parentmode.virt.y - height) / 2; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
192 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
193 /* calculate bottom, right corner */ |
15406 | 194 mode.virt.x = width; |
195 mode.virt.y = height; | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
196 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
197 ggiCheckMode(ggi_conf.vis, &mode); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
198 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
199 if (ggiSetMode(ggi_conf.vis, &mode) < 0) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
200 { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
201 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set video mode\n"); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
202 return(-1); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
203 } |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
204 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
205 if (ggiGetMode(ggi_conf.vis, &mode) < 0) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
206 { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
207 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get video mode\n"); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
208 return(-1); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
209 } |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
210 |
15406 | 211 #ifdef HAVE_GGIWMH |
212 ggiWmhSetTitle(ggi_conf.parentvis, title); | |
213 if (vo_ontop) window_ontop(); | |
214 #endif | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
215 |
5703 | 216 #if 0 |
15406 | 217 printf("[ggi] submode: "); |
4830 | 218 ggiPrintMode(&mode); |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
219 printf("\n"); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
220 #endif |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
221 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
222 vo_depthonscreen = GT_DEPTH(parentmode.graphtype); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
223 vo_screenwidth = parentmode.visible.x; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
224 vo_screenheight = parentmode.visible.y; |
4830 | 225 |
226 vo_dx = vo_dy = 0; | |
227 vo_dwidth = mode.virt.x; | |
228 vo_dheight = mode.virt.y; | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
229 vo_dbpp = GT_SIZE(parentmode.graphtype); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
230 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
231 ggi_conf.srcwidth = width; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
232 ggi_conf.srcheight = height; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
233 ggi_conf.srcformat = format; |
15406 | 234 |
235 ggi_conf.dstwidth = mode.virt.x; | |
236 ggi_conf.dstheight = mode.virt.y; | |
5703 | 237 |
238 ggi_conf.voflags = flags; | |
4830 | 239 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
240 if (IMGFMT_IS_RGB(ggi_conf.srcformat)) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
241 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
242 ggi_conf.srcdepth = IMGFMT_RGB_DEPTH(ggi_conf.srcformat); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
243 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
244 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
245 if (IMGFMT_IS_BGR(ggi_conf.srcformat)) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
246 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
247 ggi_conf.srcdepth = IMGFMT_BGR_DEPTH(ggi_conf.srcformat); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
248 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
249 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
250 { |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
251 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] Unknown image format: %s\n", |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
252 vo_format_name(ggi_conf.srcformat)); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
253 return(-1); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
254 } |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
255 |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
256 ggiSetFlags(ggi_conf.vis, GGIFLAG_ASYNC); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
257 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
258 if (GT_SCHEME(mode.graphtype) == GT_PALETTE) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
259 ggiSetColorfulPalette(ggi_conf.vis); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
260 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
261 if (ggiGetFlags(ggi_conf.vis) & GGIFLAG_ASYNC) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
262 ggi_conf.async = 1; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
263 |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
264 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] input: %dx%dx%d, output: %dx%dx%d\n", |
4830 | 265 ggi_conf.srcwidth, ggi_conf.srcheight, ggi_conf.srcdepth, |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
266 vo_dwidth, vo_dheight, vo_dbpp); |
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
267 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] async mode: %s\n", |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
268 ggi_conf.async ? "yes" : "no"); |
4841 | 269 |
5703 | 270 ggi_conf.srcbpp = (ggi_conf.srcdepth+7)/8; |
4830 | 271 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
272 ggi_conf.flushregion.x1 = ggi_conf.flushregion.y1 = 0; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
273 ggi_conf.flushregion.x2 = ggi_conf.dstwidth; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
274 ggi_conf.flushregion.y2 = ggi_conf.dstheight; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
275 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
276 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
277 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
278 |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
279 static uint32_t get_image(mp_image_t *mpi) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
280 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
281 /* GGI DirectRendering supports (yet) only BGR/RGB modes */ |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
282 if ( |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
283 #if 1 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
284 (IMGFMT_IS_RGB(mpi->imgfmt) && |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
285 (IMGFMT_RGB_DEPTH(mpi->imgfmt) != vo_dbpp)) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
286 (IMGFMT_IS_BGR(mpi->imgfmt) && |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
287 (IMGFMT_BGR_DEPTH(mpi->imgfmt) != vo_dbpp)) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
288 #else |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
289 (mpi->imgfmt != ggi_conf.srcformat) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
290 #endif |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
291 ((mpi->type != MP_IMGTYPE_STATIC) && (mpi->type != MP_IMGTYPE_TEMP)) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
292 (mpi->flags & MP_IMGFLAG_PLANAR) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
293 (mpi->flags & MP_IMGFLAG_YUV) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
294 (mpi->width != ggi_conf.srcwidth) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
295 (mpi->height != ggi_conf.srcheight) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
296 ) |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
297 { |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
298 return(VO_FALSE); |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
299 } |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
300 |
5703 | 301 mpi->planes[1] = mpi->planes[2] = NULL; |
302 mpi->stride[1] = mpi->stride[2] = 0; | |
303 | |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
304 mpi->planes[0] = NULL; |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
305 mpi->stride[0] = ggi_conf.srcwidth * ggi_conf.srcbpp; |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
306 mpi->flags |= MP_IMGFLAG_DIRECT; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
307 |
5703 | 308 #ifdef GGI_FLIP |
309 if (ggi_conf.voflags & VOFLAG_FLIPPING) | |
310 { | |
311 mpi->stride[0] = -mpi->stride[0]; | |
312 } | |
313 #endif | |
314 | |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
315 return(VO_TRUE); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
316 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
317 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
318 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
319 static int draw_frame(uint8_t *src[]) |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
320 { |
11110 | 321 ggiPutBox(ggi_conf.vis, 0, 0, ggi_conf.dstwidth, ggi_conf.dstheight, src[0]); |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
322 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
323 ggi_conf.flushregion.x1 = ggi_conf.flushregion.y1 = 0; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
324 ggi_conf.flushregion.x2 = ggi_conf.dstwidth; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
325 ggi_conf.flushregion.y2 = ggi_conf.dstheight; |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
326 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
327 return(0); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
328 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
329 |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
330 static void draw_osd(void) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
331 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
332 return; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
333 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
334 |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
335 static void flip_page(void) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
336 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
337 ggiFlushRegion(ggi_conf.vis, ggi_conf.flushregion.x1, ggi_conf.flushregion.y1, |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
338 ggi_conf.flushregion.x2 - ggi_conf.flushregion.x1, |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
339 ggi_conf.flushregion.y2 - ggi_conf.flushregion.y1); |
15406 | 340 |
341 ggi_conf.flushregion.x1 = ggi_conf.flushregion.x2 = -1; | |
342 ggi_conf.flushregion.y1 = ggi_conf.flushregion.y2 = -1; | |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
343 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
344 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
345 static int draw_slice(uint8_t *src[], int stride[], int w, int h, |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
346 int x, int y) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
347 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
348 ggiPutBox(ggi_conf.vis, x, y, w, h, src[0]); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
349 |
15406 | 350 if ((ggi_conf.flushregion.x1 == -1) || (x < ggi_conf.flushregion.x1)) |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
351 ggi_conf.flushregion.x1 = x; |
15406 | 352 if ((ggi_conf.flushregion.y1 == -1) || (y < ggi_conf.flushregion.y1)) |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
353 ggi_conf.flushregion.y1 = y; |
15406 | 354 if ((ggi_conf.flushregion.x2 == -1) || ((x + w) > ggi_conf.flushregion.x2)) |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
355 ggi_conf.flushregion.x2 = x + w; |
15406 | 356 if ((ggi_conf.flushregion.y2 == -1) || ((y + h) > ggi_conf.flushregion.y2)) |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
357 ggi_conf.flushregion.y2 = y + h; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
358 |
11110 | 359 return(1); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
360 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
361 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
362 static int query_format(uint32_t format) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
363 { |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
364 ggi_mode mode; |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
365 uint32_t vfcap; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
366 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
367 vfcap = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_ACCEPT_STRIDE; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
368 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
369 if ((!vo_depthonscreen || !vo_dbpp) && ggi_conf.parentvis) |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
370 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
371 if (ggiGetMode(ggi_conf.parentvis, &mode) == 0) |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
372 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
373 vo_depthonscreen = GT_DEPTH(mode.graphtype); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
374 vo_dbpp = GT_SIZE(mode.graphtype); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
375 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
376 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
377 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
378 if ((IMGFMT_IS_BGR(format) && (IMGFMT_BGR_DEPTH(format) == vo_dbpp)) || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
379 (IMGFMT_IS_RGB(format) && (IMGFMT_RGB_DEPTH(format) == vo_dbpp))) |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
380 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
381 return vfcap; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
382 } |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
383 |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
384 if (IMGFMT_IS_BGR(format) || IMGFMT_IS_RGB(format)) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
385 { |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
386 set_graphtype(format, &mode); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
387 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
388 if (ggiCheckMode(ggi_conf.parentvis, &mode) < 0) { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
389 return 0; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
390 } else { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
391 return vfcap; |
11110 | 392 } |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
393 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
394 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
395 return(0); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
396 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
397 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
398 static int preinit(const char *arg) |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
399 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
400 if (ggiInit() != 0) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
401 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
402 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to initialize GGI\n"); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
403 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
404 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
405 |
15406 | 406 #ifdef HAVE_GGIWMH |
407 if (ggiWmhInit() < 0) | |
408 { | |
409 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to initialize libggiwmh\n"); | |
410 return(-1); | |
411 } | |
412 #endif | |
413 | |
4841 | 414 if ((char *)arg) |
15272
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
415 { |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
416 int i = 0; |
4841 | 417 ggi_conf.driver = strdup(arg); |
15272
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
418 while (ggi_conf.driver[i]) { |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
419 if (ggi_conf.driver[i] == '.') |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
420 ggi_conf.driver[i] = ','; |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
421 i++; |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
422 } |
db06e2acdf3d
Make it possible to use a ggi device string that contains a ',' by writing
reimar
parents:
14175
diff
changeset
|
423 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
424 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
425 ggi_conf.driver = NULL; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
426 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
427 ggi_conf.parentvis = ggiOpen(ggi_conf.driver); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
428 if (ggi_conf.parentvis == NULL) |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
429 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
430 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to open '%s' output\n", |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
431 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
432 ggiExit(); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
433 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
434 } |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
435 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
436 ggi_conf.vis = ggiOpen("display-sub", ggi_conf.parentvis); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
437 if (ggi_conf.vis == NULL) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
438 { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
439 mp_msg(MSGT_VO, MSGL_FATAL, "[ggi] unable to open the video output\n"); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
440 ggiExit(); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
441 return(-1); |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
442 } |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
443 |
15406 | 444 #ifdef HAVE_GGIWMH |
445 ggiWmhAttach(ggi_conf.parentvis); | |
446 #endif | |
447 | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
448 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
449 mp_msg(MSGT_VO, MSGL_V, "[ggi] using '%s' output\n", |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
450 (ggi_conf.driver == NULL) ? "default" : ggi_conf.driver); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
451 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
452 return 0; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
453 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
454 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
455 static void uninit(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
456 { |
4841 | 457 if (ggi_conf.driver) |
458 free(ggi_conf.driver); | |
15406 | 459 |
460 #ifdef HAVE_GGIWMH | |
461 ggiWmhDetach(ggi_conf.parentvis); | |
462 ggiWmhExit(); | |
463 #endif | |
464 | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
465 ggiClose(ggi_conf.vis); |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
466 ggiClose(ggi_conf.parentvis); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
467 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
468 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
469 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15406
diff
changeset
|
470 static int control(uint32_t request, void *data, ...) |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
471 { |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
472 switch(request) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
473 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
474 case VOCTRL_QUERY_FORMAT: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
475 return query_format(*((uint32_t*)data)); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
476 case VOCTRL_GET_IMAGE: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
477 return get_image(data); |
15406 | 478 #ifdef HAVE_GGIWMH |
479 case VOCTRL_ONTOP: | |
480 vo_ontop = (!(vo_ontop)); | |
481 window_ontop(); | |
482 return VO_TRUE; | |
483 #endif | |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
484 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
485 return VO_NOTIMPL; |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
486 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
487 |
4841 | 488 /* EVENT handling */ |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12650
diff
changeset
|
489 #include "osdep/keycodes.h" |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
490 extern void mplayer_put_key(int code); |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
491 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
492 static void check_events(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
493 { |
1143 | 494 struct timeval tv = {0, 0}; |
495 ggi_event event; | |
496 ggi_event_mask mask; | |
497 | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
498 if ((mask = ggiEventPoll(ggi_conf.parentvis, emAll, &tv))) |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
499 if (ggiEventRead(ggi_conf.parentvis, &event, emAll) != 0) |
1143 | 500 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
501 mp_dbg(MSGT_VO, MSGL_DBG3, "type: %4x, origin: %4x, sym: %4x, label: %4x, button=%4x\n", |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
502 event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button); |
1143 | 503 |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
504 switch (event.any.type) { |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
505 case evKeyPress: |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
506 switch(event.key.sym) |
1143 | 507 { |
508 case GIIK_PAsterisk: /* PStar */ | |
509 case GIIUC_Asterisk: | |
510 mplayer_put_key('*'); | |
511 break; | |
512 case GIIK_PSlash: | |
513 case GIIUC_Slash: | |
514 mplayer_put_key('/'); | |
515 break; | |
516 case GIIK_PPlus: | |
517 case GIIUC_Plus: | |
518 mplayer_put_key('+'); | |
519 break; | |
520 case GIIK_PMinus: | |
521 case GIIUC_Minus: | |
522 mplayer_put_key('-'); | |
523 break; | |
524 case GIIUC_o: | |
525 case GIIUC_O: | |
526 mplayer_put_key('o'); | |
527 break; | |
528 case GIIUC_g: | |
529 case GIIUC_G: | |
530 mplayer_put_key('g'); | |
531 break; | |
532 case GIIUC_z: | |
533 case GIIUC_Z: | |
534 mplayer_put_key('z'); | |
535 break; | |
536 case GIIUC_x: | |
537 case GIIUC_X: | |
538 mplayer_put_key('x'); | |
539 break; | |
540 case GIIUC_m: | |
541 case GIIUC_M: | |
542 mplayer_put_key('m'); | |
543 break; | |
544 case GIIUC_d: | |
545 case GIIUC_D: | |
546 mplayer_put_key('d'); | |
547 break; | |
548 case GIIUC_q: | |
549 case GIIUC_Q: | |
550 mplayer_put_key('q'); | |
551 break; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
552 case GIIUC_h: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
553 case GIIUC_H: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
554 mplayer_put_key('h'); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
555 break; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
556 case GIIUC_l: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
557 case GIIUC_L: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
558 mplayer_put_key('l'); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
559 break; |
1143 | 560 case GIIUC_Space: |
561 case GIIUC_p: | |
562 case GIIUC_P: | |
563 mplayer_put_key('p'); | |
564 break; | |
565 case GIIK_Up: | |
566 mplayer_put_key(KEY_UP); | |
567 break; | |
568 case GIIK_Down: | |
569 mplayer_put_key(KEY_DOWN); | |
570 break; | |
571 case GIIK_Left: | |
572 mplayer_put_key(KEY_LEFT); | |
573 break; | |
574 case GIIK_Right: | |
575 mplayer_put_key(KEY_RIGHT); | |
576 break; | |
577 case GIIK_PageUp: | |
578 mplayer_put_key(KEY_PAGE_UP); | |
579 break; | |
580 case GIIK_PageDown: | |
581 mplayer_put_key(KEY_PAGE_DOWN); | |
582 break; | |
583 default: | |
584 break; | |
14175
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
585 } /* switch */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
586 |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
587 break; |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
588 } /* switch */ |
c4fe6bb22e2e
- Fixed mode setting, so any video can be played on all supported ggi targets.
diego
parents:
14021
diff
changeset
|
589 } /* if */ |
1143 | 590 return; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
591 } |