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