Mercurial > mplayer.hg
annotate libvo/vo_ggi.c @ 7085:02aa64b49b70
some files has some shit before teh audio/video headers...
author | arpi |
---|---|
date | Sun, 25 Aug 2002 00:07:15 +0000 |
parents | 3e62e9cd1816 |
children | eca7dbad0166 |
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 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
4 (C) Alex Beregszaszi <alex@naxine.org> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
5 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
6 Uses libGGI - http://www.ggi-project.org/ |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
7 |
4841 | 8 TODO: |
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
|
9 * implement direct rendering support - NEEDS TESTING |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
10 * implement non-directbuffer support - NEEDS TESTING |
4841 | 11 * check on many devices |
5703 | 12 * implement gamma handling (VAA isn't obsoleted?) |
13 | |
14 BUGS: | |
15 * fbdev & DR produces two downscaled images | |
16 * fbdev & FLIP (& DR) produces no image | |
4841 | 17 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
18 Thanks to Andreas Beck for his patches. |
5703 | 19 |
4841 | 20 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
|
21 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
|
22 */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
23 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
24 #include <stdio.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
25 #include <stdlib.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
26 #include <string.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
27 #include <errno.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
28 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
29 #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
|
30 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
31 #include "../config.h" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
32 #include "video_out.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
33 #include "video_out_internal.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
34 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
35 #include "fastmemcpy.h" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
36 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
37 #include <ggi/ggi.h> |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
38 |
4831
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
39 /* maximum buffers */ |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
40 #define GGI_FRAMES 4 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
41 |
5703 | 42 #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
|
43 |
6890819bc0dc
added support 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 #include "../libmpcodecs/mp_image.h" |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
45 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
46 LIBVO_EXTERN (ggi) |
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 static vo_info_t vo_info = |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
49 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
50 "General Graphics Interface (GGI) output", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
51 "ggi", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
52 "Alex Beregszaszi <alex@naxine.org>", |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
53 "under developement" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
54 }; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
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; |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
58 |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
59 ggi_visual_t vis; |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
60 ggi_directbuffer *buffer[GGI_FRAMES]; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
61 ggi_mode gmode; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
62 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
63 int frames; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
64 int currframe; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
65 |
4830 | 66 /* source image format */ |
67 int srcwidth; | |
68 int srcheight; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
69 int srcformat; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
70 int srcdepth; |
5703 | 71 int srcbpp; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
72 |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
73 /* destination */ |
4830 | 74 int dstwidth; |
75 int dstheight; | |
4841 | 76 |
77 int async; | |
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
|
78 int directbuffer; |
5703 | 79 |
80 int voflags; | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
81 } ggi_conf; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
82 |
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
|
83 static uint32_t draw_frame_directbuffer(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
|
84 static void draw_osd_directbuffer(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
|
85 static void flip_page_directbuffer(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
|
86 |
4830 | 87 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, |
5703 | 88 uint32_t d_height, uint32_t flags, char *title, uint32_t format,const vo_tune_info_t *info) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
89 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
90 ggi_mode mode = |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
91 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
92 GGI_FRAMES, /* frames */ |
4830 | 93 { width, height }, /* visible */ |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
94 { GGI_AUTO, GGI_AUTO }, /* virt */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
95 { GGI_AUTO, GGI_AUTO }, /* size */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
96 GT_AUTO, /* graphtype */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
97 { 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
|
98 }; |
4830 | 99 int i; |
100 ggi_directbuffer *DB; | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
101 |
4830 | 102 switch(format) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
103 { |
4830 | 104 case IMGFMT_RGB|8: |
105 case IMGFMT_BGR|8: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
106 mode.graphtype = GT_8BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
107 break; |
4830 | 108 case IMGFMT_RGB|15: |
109 case IMGFMT_BGR|15: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
110 mode.graphtype = GT_15BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
111 break; |
4830 | 112 case IMGFMT_RGB|16: |
113 case IMGFMT_BGR|16: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
114 mode.graphtype = GT_16BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
115 break; |
4830 | 116 case IMGFMT_RGB|24: |
117 case IMGFMT_BGR|24: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
118 mode.graphtype = GT_24BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
119 break; |
4830 | 120 case IMGFMT_RGB|32: |
121 case IMGFMT_BGR|32: | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
122 mode.graphtype = GT_32BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
123 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
124 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
125 |
5703 | 126 #if 0 |
4830 | 127 printf("[ggi] mode: "); |
128 ggiPrintMode(&mode); | |
129 printf("\n"); | |
130 #endif | |
131 | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
132 ggiCheckMode(ggi_conf.vis, &mode); |
4830 | 133 |
134 if (ggiSetMode(ggi_conf.vis, &mode)) | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
135 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
136 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to set mode\n"); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
137 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
138 } |
4830 | 139 |
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
|
140 if (ggiGetMode(ggi_conf.vis, &mode)) |
1147 | 141 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
142 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] unable to get mode\n"); |
1147 | 143 return(-1); |
144 } | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
145 |
4841 | 146 if ((mode.graphtype == GT_INVALID) || (mode.graphtype == GT_AUTO)) |
147 { | |
148 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] not supported depth/bpp\n"); | |
149 return(-1); | |
150 } | |
151 | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
152 ggi_conf.gmode = mode; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
153 |
5703 | 154 #if 0 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
155 printf("[ggi] mode: "); |
4830 | 156 ggiPrintMode(&mode); |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
157 printf("\n"); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
158 #endif |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
159 |
4830 | 160 vo_depthonscreen = GT_DEPTH(mode.graphtype); |
161 vo_screenwidth = mode.visible.x; | |
162 vo_screenheight = mode.visible.y; | |
163 | |
164 vo_dx = vo_dy = 0; | |
165 vo_dwidth = mode.virt.x; | |
166 vo_dheight = mode.virt.y; | |
4841 | 167 vo_dbpp = GT_SIZE(mode.graphtype); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
168 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
169 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
|
170 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
|
171 ggi_conf.srcformat = format; |
5703 | 172 |
173 ggi_conf.voflags = flags; | |
4830 | 174 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
175 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
|
176 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
177 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
|
178 } |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
179 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
180 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
|
181 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
182 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
|
183 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
184 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
185 { |
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
|
186 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
|
187 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
|
188 return(-1); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
189 } |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
190 |
4830 | 191 vo_dwidth = ggi_conf.dstwidth = ggi_conf.gmode.virt.x; |
192 vo_dheight = ggi_conf.dstheight = ggi_conf.gmode.virt.y; | |
193 | |
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
|
194 ggi_conf.directbuffer = 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
|
195 |
4831
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
196 ggi_conf.frames = ggiDBGetNumBuffers(ggi_conf.vis); |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
197 if (ggi_conf.frames > GGI_FRAMES) |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
198 ggi_conf.frames = GGI_FRAMES; |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
199 |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
200 ggi_conf.currframe = 0; |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
201 if (!ggi_conf.frames) |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
202 { |
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
|
203 goto db_err; |
4831
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
204 } |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
205 |
9153d1275b6d
do not fault if no directbuffer available (for example: ggi display-multi)
alex
parents:
4830
diff
changeset
|
206 for (i = 0; i < ggi_conf.frames; i++) |
4830 | 207 ggi_conf.buffer[i] = NULL; |
208 | |
209 /* get available number of buffers */ | |
4841 | 210 for (i = 0; DB = (ggi_directbuffer *)ggiDBGetBuffer(ggi_conf.vis, i), |
211 i < ggi_conf.frames; i++) | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
212 { |
4830 | 213 if (!(DB->type & GGI_DB_SIMPLE_PLB) || |
214 (DB->page_size != 0) || | |
215 (DB->write == NULL) || | |
216 (DB->noaccess != 0) || | |
217 (DB->align != 0) || | |
218 (DB->layout != blPixelLinearBuffer)) | |
219 continue; | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
220 |
4830 | 221 ggi_conf.buffer[DB->frame] = DB; |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
222 } |
1147 | 223 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
224 if (ggi_conf.buffer[0] == NULL) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
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 goto db_err; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
227 } |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
228 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
229 for (i = 0; i < ggi_conf.frames; i++) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
230 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
231 if (ggi_conf.buffer[i] == NULL) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
232 { |
4830 | 233 ggi_conf.frames = i-1; |
234 break; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
235 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
236 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
237 ggiSetDisplayFrame(ggi_conf.vis, ggi_conf.currframe); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
238 ggiSetWriteFrame(ggi_conf.vis, ggi_conf.currframe); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
239 |
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 goto db_ok; |
6890819bc0dc
added support 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 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
242 db_err: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
243 mp_msg(MSGT_VO, MSGL_ERR, "[ggi] direct buffer unavailable, using async mode\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
|
244 ggi_conf.directbuffer = 0; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
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 db_ok: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
248 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
|
249 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
|
250 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
251 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
|
252 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
|
253 |
4830 | 254 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] input: %dx%dx%d, output: %dx%dx%d, frames: %d\n", |
255 ggi_conf.srcwidth, ggi_conf.srcheight, ggi_conf.srcdepth, | |
4841 | 256 vo_dwidth, vo_dheight, vo_dbpp, ggi_conf.frames); |
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 mp_msg(MSGT_VO, MSGL_INFO, "[ggi] directbuffer: %s, async mode: %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
|
258 ggi_conf.directbuffer ? "yes" : "no", |
6890819bc0dc
added support 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_conf.async ? "yes" : "no"); |
4841 | 260 |
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 (ggi_conf.directbuffer) |
4841 | 262 { |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
263 video_out_ggi.draw_frame = draw_frame_directbuffer; |
6890819bc0dc
added support 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 video_out_ggi.draw_osd = draw_osd_directbuffer; |
6890819bc0dc
added support 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 video_out_ggi.flip_page = flip_page_directbuffer; |
4841 | 266 } |
5703 | 267 |
268 ggi_conf.srcbpp = (ggi_conf.srcdepth+7)/8; | |
4830 | 269 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
270 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
271 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
272 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
273 static const vo_info_t *get_info(void) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
274 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
275 return &vo_info; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
276 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
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 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
|
279 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
280 /* GGI DirectRendering supports (yet) only BGR/RGB modes */ |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
281 if (!ggi_conf.directbuffer || |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
282 #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
|
283 (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
|
284 (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
|
285 (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
|
286 (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
|
287 #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
|
288 (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
|
289 #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
|
290 ((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
|
291 (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
|
292 (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
|
293 (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
|
294 (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
|
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 return(VO_FALSE); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
297 |
6890819bc0dc
added support 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 if (ggi_conf.frames > 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
|
299 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
300 mp_msg(MSGT_VO, MSGL_WARN, "[ggi] doublebuffering disabled due to directrendering\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
|
301 ggi_conf.currframe = 0; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
302 ggi_conf.frames = 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
|
303 } |
5703 | 304 |
305 mpi->planes[1] = mpi->planes[2] = NULL; | |
306 mpi->stride[1] = mpi->stride[2] = 0; | |
307 | |
308 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
|
309 mpi->planes[0] = ggi_conf.buffer[ggi_conf.currframe]->write; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
310 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
|
311 |
5703 | 312 #ifdef GGI_FLIP |
313 if (ggi_conf.voflags & VOFLAG_FLIPPING) | |
314 { | |
315 mpi->stride[0] = -mpi->stride[0]; | |
316 mpi->planes[0] -= mpi->stride[0]*(ggi_conf.srcheight-1); | |
317 } | |
318 #endif | |
319 | |
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 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
|
321 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
322 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
323 static uint32_t draw_frame_directbuffer(uint8_t *src[]) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
324 { |
5703 | 325 unsigned char *dst_ptr; |
326 int dst_stride, dst_bpp; | |
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
|
327 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
328 ggiResourceAcquire(ggi_conf.buffer[ggi_conf.currframe]->resource, |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
329 GGI_ACTYPE_WRITE); |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
330 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
331 ggiSetWriteFrame(ggi_conf.vis, ggi_conf.currframe); |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
332 |
5703 | 333 dst_ptr = ggi_conf.buffer[ggi_conf.currframe]->write; |
334 dst_stride = ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.stride; | |
335 dst_bpp = (ggi_conf.buffer[ggi_conf.currframe]->buffer.plb.pixelformat->size+7)/8; | |
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
|
336 |
5703 | 337 #ifdef GGI_FLIP |
338 if (ggi_conf.voflags & VOFLAG_FLIPPING) | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
339 { |
5703 | 340 dst_stride = -dst_stride; |
341 dst_ptr -= dst_stride*(ggi_conf.srcheight-1); | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
342 } |
5637
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
343 #endif |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
344 |
5703 | 345 /* memcpy_pic(dst, src, bytes per line, height, dst_stride, src_stride) */ |
346 | |
347 memcpy_pic(dst_ptr, src[0], ggi_conf.srcwidth*dst_bpp, ggi_conf.srcheight, | |
348 dst_stride, | |
349 ggi_conf.srcwidth*ggi_conf.srcbpp); | |
350 | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
351 ggiResourceRelease(ggi_conf.buffer[ggi_conf.currframe]->resource); |
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
|
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 return(0); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
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 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
356 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
357 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
|
358 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
359 int x, y; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
360 unsigned char *spt; |
6890819bc0dc
added support 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 ggi_color col; |
6890819bc0dc
added support 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 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
363 spt = src[0]; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
364 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
365 for (y = 0; y < ggi_conf.srcheight; y++) |
6890819bc0dc
added support 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 for (x = 0; x < ggi_conf.srcwidth; x++) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
368 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
369 /* add support for RGB */ |
6890819bc0dc
added support 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 switch(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
|
371 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
372 case IMGFMT_BGR24: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
373 case IMGFMT_BGR32: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
374 col.r = *spt++ << 8; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
375 col.g = *spt++ << 8; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
376 col.b = *spt++ << 8; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
377 if (ggi_conf.srcformat == IMGFMT_BGR32) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
378 spt++; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
379 break; |
6890819bc0dc
added support 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 default: |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
381 mp_msg(MSGT_VO, MSGL_V, "[ggi] unsupported input format\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
|
382 return(0); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
383 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
384 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
385 // printf("pixel: x:%d, y:%d, r:%d, g:%d, b:%d\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
|
386 // x, y, col.r, col.b, col.g); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
387 ggiPutPixel(ggi_conf.vis, x, y, ggiMapColor(ggi_conf.vis, &col)); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
388 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
389 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
390 ggiFlush(ggi_conf.vis); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
391 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
392 return(0); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
393 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
394 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
395 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
396 unsigned char *srca, int stride) |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
397 { |
4841 | 398 switch(vo_dbpp) |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
399 { |
4830 | 400 case 32: |
401 vo_draw_alpha_rgb32(w, h, src, srca, stride, | |
402 ggi_conf.buffer[ggi_conf.currframe]->write+4*(ggi_conf.dstwidth*y0+x0), 4*ggi_conf.dstwidth); | |
403 break; | |
404 case 24: | |
405 vo_draw_alpha_rgb24(w, h, src, srca, stride, | |
406 ggi_conf.buffer[ggi_conf.currframe]->write+3*(ggi_conf.dstwidth*y0+x0), 3*ggi_conf.dstwidth); | |
407 break; | |
408 case 16: | |
409 vo_draw_alpha_rgb16(w, h, src, srca, stride, | |
410 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.dstwidth*y0+x0), 2*ggi_conf.dstwidth); | |
411 break; | |
412 case 15: | |
413 vo_draw_alpha_rgb15(w, h, src, srca, stride, | |
414 ggi_conf.buffer[ggi_conf.currframe]->write+2*(ggi_conf.dstwidth*y0+x0), 2*ggi_conf.dstwidth); | |
415 break; | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
416 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
417 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
418 |
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
|
419 static void draw_osd_directbuffer(void) |
1132
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 vo_draw_text(ggi_conf.srcwidth, ggi_conf.srcheight, draw_alpha); |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1198
diff
changeset
|
422 } |
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1198
diff
changeset
|
423 |
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
|
424 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
|
425 { |
6890819bc0dc
added support 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 } |
6890819bc0dc
added support 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 |
6890819bc0dc
added support 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 static void flip_page_directbuffer(void) |
1501
d40f2b686846
changes according to -utf8 option, draw_osd() function added
atlka
parents:
1198
diff
changeset
|
429 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
430 ggiSetDisplayFrame(ggi_conf.vis, ggi_conf.currframe); |
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
|
431 mp_dbg(MSGT_VO, MSGL_DBG2, "[ggi] flipping, current write frame: %d, display frame: %d\n", |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
432 ggiGetWriteFrame(ggi_conf.vis), ggiGetDisplayFrame(ggi_conf.vis)); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
433 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
434 ggi_conf.currframe = (ggi_conf.currframe+1) % ggi_conf.frames; |
4841 | 435 |
436 if (ggi_conf.async) | |
437 ggiFlush(ggi_conf.vis); | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
438 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
439 |
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
|
440 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
|
441 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
442 ggiFlush(ggi_conf.vis); |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
443 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
444 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
445 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
|
446 int x, int y) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
447 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
448 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
449 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
450 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
451 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
|
452 { |
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
|
453 ggi_mode mode; |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
454 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
455 if ((!vo_depthonscreen || !vo_dbpp) && ggi_conf.vis) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
456 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
457 if (ggiGetMode(ggi_conf.vis, &mode) == 0) |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
458 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
459 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
|
460 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
|
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 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
463 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
464 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
|
465 (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
|
466 { |
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
|
467 if (ggi_conf.directbuffer) |
5703 | 468 #ifdef GGI_FLIP |
6211 | 469 return(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW| |
470 VFCAP_OSD|VFCAP_FLIP); | |
5703 | 471 #else |
6211 | 472 return(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD); |
5703 | 473 #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
|
474 else |
6211 | 475 return(VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
476 } |
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
|
477 |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
478 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
|
479 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
480 if (ggi_conf.directbuffer) |
5703 | 481 #ifdef GGI_FLIP |
6211 | 482 return(VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_FLIP); |
5703 | 483 #else |
6211 | 484 return(VFCAP_CSP_SUPPORTED|VFCAP_OSD); |
5703 | 485 #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
|
486 else |
6211 | 487 return(VFCAP_CSP_SUPPORTED); |
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
|
488 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
489 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
490 return(0); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
491 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
492 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
493 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
|
494 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
495 if (ggiInit() != 0) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
496 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
497 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
|
498 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
499 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
500 |
4841 | 501 if ((char *)arg) |
502 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
|
503 else |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
504 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
|
505 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
506 if ((ggi_conf.vis = ggiOpen(ggi_conf.driver)) == NULL) |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
507 { |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
508 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
|
509 (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
|
510 ggiExit(); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
511 return(-1); |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
512 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
513 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
514 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
|
515 (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
|
516 |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
517 return 0; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
518 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
519 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
520 static void uninit(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
521 { |
4841 | 522 if (ggi_conf.driver) |
523 free(ggi_conf.driver); | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
524 ggiClose(ggi_conf.vis); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
525 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
526 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
527 |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
528 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
|
529 { |
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
|
530 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
|
531 { |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
532 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
|
533 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
|
534 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
|
535 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
|
536 } |
6890819bc0dc
added support for directrendering, updated to VFCAP_ flags in query_format, added support for non-directbuffer devices, and using mem2agpcpy_pic
alex
parents:
4841
diff
changeset
|
537 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
|
538 } |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
539 |
4841 | 540 /* EVENT handling */ |
1143 | 541 #include "../linux/keycodes.h" |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
542 extern void mplayer_put_key(int code); |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
543 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
544 static void check_events(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
545 { |
1143 | 546 struct timeval tv = {0, 0}; |
547 ggi_event event; | |
548 ggi_event_mask mask; | |
549 | |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
550 if ((mask = ggiEventPoll(ggi_conf.vis, emAll, &tv))) |
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
551 if (ggiEventRead(ggi_conf.vis, &event, emAll) != 0) |
1143 | 552 { |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
553 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
|
554 event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button); |
1143 | 555 |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
556 if (event.key.type == evKeyPress) |
1143 | 557 { |
1172
290353337b44
hardly modified, keyboard handling is ok. aspect implemented, but bugging :)
al3x
parents:
1148
diff
changeset
|
558 switch(event.key.sym) |
1143 | 559 { |
560 case GIIK_PAsterisk: /* PStar */ | |
561 case GIIUC_Asterisk: | |
562 mplayer_put_key('*'); | |
563 break; | |
564 case GIIK_PSlash: | |
565 case GIIUC_Slash: | |
566 mplayer_put_key('/'); | |
567 break; | |
568 case GIIK_PPlus: | |
569 case GIIUC_Plus: | |
570 mplayer_put_key('+'); | |
571 break; | |
572 case GIIK_PMinus: | |
573 case GIIUC_Minus: | |
574 mplayer_put_key('-'); | |
575 break; | |
576 case GIIUC_o: | |
577 case GIIUC_O: | |
578 mplayer_put_key('o'); | |
579 break; | |
580 case GIIUC_g: | |
581 case GIIUC_G: | |
582 mplayer_put_key('g'); | |
583 break; | |
584 case GIIUC_z: | |
585 case GIIUC_Z: | |
586 mplayer_put_key('z'); | |
587 break; | |
588 case GIIUC_x: | |
589 case GIIUC_X: | |
590 mplayer_put_key('x'); | |
591 break; | |
592 case GIIUC_m: | |
593 case GIIUC_M: | |
594 mplayer_put_key('m'); | |
595 break; | |
596 case GIIUC_d: | |
597 case GIIUC_D: | |
598 mplayer_put_key('d'); | |
599 break; | |
600 case GIIUC_q: | |
601 case GIIUC_Q: | |
602 mplayer_put_key('q'); | |
603 break; | |
4828
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
604 case GIIUC_h: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
605 case GIIUC_H: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
606 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
|
607 break; |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
608 case GIIUC_l: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
609 case GIIUC_L: |
0ae597cc28e6
totally reworked, working fine on fbdev too, applied Andres Beck's patches, quad-buffering support
alex
parents:
4737
diff
changeset
|
610 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
|
611 break; |
1143 | 612 case GIIUC_Space: |
613 case GIIUC_p: | |
614 case GIIUC_P: | |
615 mplayer_put_key('p'); | |
616 break; | |
617 case GIIK_Up: | |
618 mplayer_put_key(KEY_UP); | |
619 break; | |
620 case GIIK_Down: | |
621 mplayer_put_key(KEY_DOWN); | |
622 break; | |
623 case GIIK_Left: | |
624 mplayer_put_key(KEY_LEFT); | |
625 break; | |
626 case GIIK_Right: | |
627 mplayer_put_key(KEY_RIGHT); | |
628 break; | |
629 case GIIK_PageUp: | |
630 mplayer_put_key(KEY_PAGE_UP); | |
631 break; | |
632 case GIIK_PageDown: | |
633 mplayer_put_key(KEY_PAGE_DOWN); | |
634 break; | |
635 default: | |
636 break; | |
637 } | |
638 } | |
639 } | |
640 return; | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
641 } |