annotate libvo/vo_ggi.c @ 16449:5362c60b3b37

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