annotate libvo/vo_ggi.c @ 14841:a7cc851f72ad

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