Mercurial > mplayer.hg
annotate libvo/vo_ggi.c @ 14053:9f89feb07542
rescale the fonts with hidden OSD too
author | henry |
---|---|
date | Fri, 26 Nov 2004 10:32:53 +0000 |
parents | f0236d5ba7a7 |
children | c4fe6bb22e2e |
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 |
4831
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
38 /* maximum buffers */ |
5703 | 39 #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
|
40 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
41 static vo_info_t info = |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
42 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
43 "General Graphics Interface (GGI) output", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
44 "ggi", |
10368 | 45 "Alex Beregszaszi", |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
46 "major" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
47 }; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
48 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
49 LIBVO_EXTERN (ggi) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7124
diff
changeset
|
50 |
1172
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; |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
55 ggi_mode gmode; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
56 |
4830 | 57 /* source image format */ |
58 int srcwidth; | |
59 int srcheight; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
60 int srcformat; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
61 int srcdepth; |
5703 | 62 int srcbpp; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
63 |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
64 /* destination */ |
4830 | 65 int dstwidth; |
66 int dstheight; | |
4841 | 67 |
68 int async; | |
5703 | 69 |
70 int voflags; | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
71 } ggi_conf; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
72 |
4830 | 73 static uint32_t 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
|
74 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
|
75 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
76 ggi_mode mode = |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
77 { |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
78 1, /* frames */ |
4830 | 79 { width, height }, /* visible */ |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
80 { GGI_AUTO, GGI_AUTO }, /* virt */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
81 { GGI_AUTO, GGI_AUTO }, /* size */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
82 GT_AUTO, /* graphtype */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
83 { 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
|
84 }; |
4830 | 85 int i; |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
86 |
4830 | 87 switch(format) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
88 { |
4830 | 89 case IMGFMT_RGB|8: |
90 case IMGFMT_BGR|8: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
91 mode.graphtype = GT_8BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
92 break; |
4830 | 93 case IMGFMT_RGB|15: |
94 case IMGFMT_BGR|15: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
95 mode.graphtype = GT_15BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
96 break; |
4830 | 97 case IMGFMT_RGB|16: |
98 case IMGFMT_BGR|16: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
99 mode.graphtype = GT_16BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
100 break; |
4830 | 101 case IMGFMT_RGB|24: |
102 case IMGFMT_BGR|24: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
103 mode.graphtype = GT_24BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
104 break; |
4830 | 105 case IMGFMT_RGB|32: |
106 case IMGFMT_BGR|32: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
107 mode.graphtype = GT_32BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
108 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
109 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
110 |
5703 | 111 #if 0 |
4830 | 112 printf("[ggi] mode: "); |
113 ggiPrintMode(&mode); | |
114 printf("\n"); | |
115 #endif | |
116 | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
117 ggiCheckMode(ggi_conf.vis, &mode); |
4830 | 118 |
119 if (ggiSetMode(ggi_conf.vis, &mode)) | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
120 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
121 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set mode\n"); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
122 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
123 } |
4830 | 124 |
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
|
125 if (ggiGetMode(ggi_conf.vis, &mode)) |
1147 | 126 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
127 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get mode\n"); |
1147 | 128 return(-1); |
129 } | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
130 |
4841 | 131 if ((mode.graphtype == GT_INVALID) || (mode.graphtype == GT_AUTO)) |
132 { | |
133 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] not supported depth/bpp\n"); | |
134 return(-1); | |
135 } | |
136 | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
137 ggi_conf.gmode = mode; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
138 |
5703 | 139 #if 0 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
140 printf("[ggi] mode: "); |
4830 | 141 ggiPrintMode(&mode); |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
142 printf("\n"); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
143 #endif |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
144 |
4830 | 145 vo_depthonscreen = GT_DEPTH(mode.graphtype); |
146 vo_screenwidth = mode.visible.x; | |
147 vo_screenheight = mode.visible.y; | |
148 | |
149 vo_dx = vo_dy = 0; | |
150 vo_dwidth = mode.virt.x; | |
151 vo_dheight = mode.virt.y; | |
4841 | 152 vo_dbpp = GT_SIZE(mode.graphtype); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
153 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
154 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
|
155 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
|
156 ggi_conf.srcformat = format; |
5703 | 157 |
158 ggi_conf.voflags = flags; | |
4830 | 159 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
160 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
|
161 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
162 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
|
163 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
164 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
165 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
|
166 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
167 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
|
168 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
169 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
170 { |
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
|
171 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
|
172 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
|
173 return(-1); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
174 } |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
175 |
4830 | 176 vo_dwidth = ggi_conf.dstwidth = ggi_conf.gmode.virt.x; |
177 vo_dheight = ggi_conf.dstheight = ggi_conf.gmode.virt.y; | |
178 | |
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
|
179 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
|
180 |
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
|
181 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
|
182 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
|
183 |
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
|
184 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
|
185 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
|
186 |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
187 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] input: %dx%dx%d, output: %dx%dx%d\n", |
4830 | 188 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
|
189 vo_dwidth, vo_dheight, vo_dbpp); |
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
190 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
|
191 ggi_conf.async ? "yes" : "no"); |
4841 | 192 |
5703 | 193 ggi_conf.srcbpp = (ggi_conf.srcdepth+7)/8; |
4830 | 194 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
195 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
196 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
197 |
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
|
198 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
|
199 { |
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
|
200 /* 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
|
201 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
|
202 #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
|
203 (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
|
204 (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
|
205 (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
|
206 (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
|
207 #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
|
208 (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
|
209 #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
|
210 ((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
|
211 (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
|
212 (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
|
213 (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
|
214 (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
|
215 ) |
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
|
216 return(VO_FALSE); |
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
|
217 |
5703 | 218 mpi->planes[1] = mpi->planes[2] = NULL; |
219 mpi->stride[1] = mpi->stride[2] = 0; | |
220 | |
221 mpi->stride[0] = ggi_conf.srcwidth*ggi_conf.srcbpp; | |
14021
f0236d5ba7a7
Remove broken support for directbuffer and including frame-handling use.
iive
parents:
13787
diff
changeset
|
222 mpi->planes[0] = NULL; |
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
|
223 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
|
224 |
5703 | 225 #ifdef GGI_FLIP |
226 if (ggi_conf.voflags & VOFLAG_FLIPPING) | |
227 { | |
228 mpi->stride[0] = -mpi->stride[0]; | |
229 } | |
230 #endif | |
231 | |
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
|
232 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
|
233 } |
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
|
234 |
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
|
235 |
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
|
236 static uint32_t draw_frame(uint8_t *src[]) |
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
|
237 { |
11110 | 238 ggiPutBox(ggi_conf.vis, 0, 0, ggi_conf.dstwidth, ggi_conf.dstheight, src[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
|
239 ggiFlush(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
|
240 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
241 return(0); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
242 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
243 |
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
|
244 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
|
245 { |
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
|
246 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
247 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
248 |
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
|
249 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
|
250 { |
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 ggiFlush(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
|
252 } |
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 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
254 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
|
255 int x, int y) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
256 { |
11110 | 257 ggiPutHLine(ggi_conf.vis, x, y, w, src[0]); |
258 return(1); | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
259 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
260 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
261 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
|
262 { |
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
|
263 ggi_mode mode; |
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
|
264 |
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
|
265 if ((!vo_depthonscreen || !vo_dbpp) && 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
|
266 { |
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
|
267 if (ggiGetMode(ggi_conf.vis, &mode) == 0) |
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 { |
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
|
269 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
|
270 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
|
271 } |
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
|
272 } |
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
|
273 |
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
|
274 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
|
275 (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
|
276 { |
6211 | 277 return(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW); |
1132
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 |
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 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
|
281 { |
11110 | 282 switch(format) |
283 { | |
284 case IMGFMT_RGB|8: | |
285 case IMGFMT_BGR|8: | |
286 mode.graphtype = GT_8BIT; | |
287 break; | |
288 case IMGFMT_RGB|15: | |
289 case IMGFMT_BGR|15: | |
290 mode.graphtype = GT_15BIT; | |
291 break; | |
292 case IMGFMT_RGB|16: | |
293 case IMGFMT_BGR|16: | |
294 mode.graphtype = GT_16BIT; | |
295 break; | |
296 case IMGFMT_RGB|24: | |
297 case IMGFMT_BGR|24: | |
298 mode.graphtype = GT_24BIT; | |
299 break; | |
300 case IMGFMT_RGB|32: | |
301 case IMGFMT_BGR|32: | |
302 mode.graphtype = GT_32BIT; | |
303 break; | |
304 } | |
305 if (ggiCheckMode(ggi_conf.vis, &mode)) | |
306 { | |
307 return 0; | |
308 } | |
309 else | |
310 { | |
6211 | 311 return(VFCAP_CSP_SUPPORTED); |
11110 | 312 } |
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
|
313 } |
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
|
314 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
315 return(0); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
316 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
317 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
318 static uint32_t preinit(const char *arg) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
319 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
320 if (ggiInit() != 0) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
321 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
322 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
|
323 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
324 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
325 |
4841 | 326 if ((char *)arg) |
327 ggi_conf.driver = strdup(arg); | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
328 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
329 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
|
330 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
331 if ((ggi_conf.vis = ggiOpen(ggi_conf.driver)) == NULL) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
332 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
333 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
|
334 (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
|
335 ggiExit(); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
336 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
337 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
338 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
339 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
|
340 (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
|
341 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
342 return 0; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
343 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
344 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
345 static void uninit(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
346 { |
4841 | 347 if (ggi_conf.driver) |
348 free(ggi_conf.driver); | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
349 ggiClose(ggi_conf.vis); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
350 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
351 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
352 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
353 static uint32_t control(uint32_t request, void *data, ...) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
354 { |
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
|
355 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
|
356 { |
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
|
357 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
|
358 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
|
359 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
|
360 return get_image(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
|
361 } |
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
|
362 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
|
363 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
364 |
4841 | 365 /* EVENT handling */ |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12650
diff
changeset
|
366 #include "osdep/keycodes.h" |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
367 extern void mplayer_put_key(int code); |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
368 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
369 static void check_events(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
370 { |
1143 | 371 struct timeval tv = {0, 0}; |
372 ggi_event event; | |
373 ggi_event_mask mask; | |
374 | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
375 if ((mask = ggiEventPoll(ggi_conf.vis, emAll, &tv))) |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
376 if (ggiEventRead(ggi_conf.vis, &event, emAll) != 0) |
1143 | 377 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
378 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
|
379 event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button); |
1143 | 380 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
381 if (event.key.type == evKeyPress) |
1143 | 382 { |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
383 switch(event.key.sym) |
1143 | 384 { |
385 case GIIK_PAsterisk: /* PStar */ | |
386 case GIIUC_Asterisk: | |
387 mplayer_put_key('*'); | |
388 break; | |
389 case GIIK_PSlash: | |
390 case GIIUC_Slash: | |
391 mplayer_put_key('/'); | |
392 break; | |
393 case GIIK_PPlus: | |
394 case GIIUC_Plus: | |
395 mplayer_put_key('+'); | |
396 break; | |
397 case GIIK_PMinus: | |
398 case GIIUC_Minus: | |
399 mplayer_put_key('-'); | |
400 break; | |
401 case GIIUC_o: | |
402 case GIIUC_O: | |
403 mplayer_put_key('o'); | |
404 break; | |
405 case GIIUC_g: | |
406 case GIIUC_G: | |
407 mplayer_put_key('g'); | |
408 break; | |
409 case GIIUC_z: | |
410 case GIIUC_Z: | |
411 mplayer_put_key('z'); | |
412 break; | |
413 case GIIUC_x: | |
414 case GIIUC_X: | |
415 mplayer_put_key('x'); | |
416 break; | |
417 case GIIUC_m: | |
418 case GIIUC_M: | |
419 mplayer_put_key('m'); | |
420 break; | |
421 case GIIUC_d: | |
422 case GIIUC_D: | |
423 mplayer_put_key('d'); | |
424 break; | |
425 case GIIUC_q: | |
426 case GIIUC_Q: | |
427 mplayer_put_key('q'); | |
428 break; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
429 case GIIUC_h: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
430 case GIIUC_H: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
431 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
|
432 break; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
433 case GIIUC_l: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
434 case GIIUC_L: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
435 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
|
436 break; |
1143 | 437 case GIIUC_Space: |
438 case GIIUC_p: | |
439 case GIIUC_P: | |
440 mplayer_put_key('p'); | |
441 break; | |
442 case GIIK_Up: | |
443 mplayer_put_key(KEY_UP); | |
444 break; | |
445 case GIIK_Down: | |
446 mplayer_put_key(KEY_DOWN); | |
447 break; | |
448 case GIIK_Left: | |
449 mplayer_put_key(KEY_LEFT); | |
450 break; | |
451 case GIIK_Right: | |
452 mplayer_put_key(KEY_RIGHT); | |
453 break; | |
454 case GIIK_PageUp: | |
455 mplayer_put_key(KEY_PAGE_UP); | |
456 break; | |
457 case GIIK_PageDown: | |
458 mplayer_put_key(KEY_PAGE_DOWN); | |
459 break; | |
460 default: | |
461 break; | |
462 } | |
463 } | |
464 } | |
465 return; | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
466 } |