Mercurial > mplayer.hg
annotate libvo/vo_ggi.c @ 1144:7bf91ff0ec28
hacked osd and input control handling
author | al3x |
---|---|
date | Sun, 17 Jun 2001 16:12:47 +0000 |
parents | a9d985d6aa91 |
children | 065583b867fd |
rev | line source |
---|---|
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
1 /* |
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 |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
8 Many thanks to Atmosfear, he hacked this driver to working with Planar |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
9 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
|
10 */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
11 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
12 #include <stdio.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
13 #include <stdlib.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
14 #include <string.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
15 #include <errno.h> |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
16 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
17 #include "config.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
18 #include "video_out.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
19 #include "video_out_internal.h" |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
20 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
21 #include "yuv2rgb.h" |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
22 #include "fastmemcpy.h" |
1132
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 <ggi/ggi.h> |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
25 |
1143 | 26 #undef GGI_OST |
27 #define GII_BUGGY_KEYCODES | |
1144 | 28 #define GGI_OSD |
29 | |
30 #ifdef GGI_OSD | |
31 #warning "GGI_OSD is bugging!" | |
32 #endif | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
33 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
34 LIBVO_EXTERN (ggi) |
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 static vo_info_t vo_info = |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
37 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
38 "General Graphics Interface (GGI) output", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
39 "ggi", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
40 "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
|
41 "under developement" |
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 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
44 extern int verbose; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
45 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
46 static char *ggi_output_name = NULL; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
47 static ggi_visual_t ggi_vis; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
48 static ggi_directbuffer *ggi_buffer; |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
49 static int ggi_format = 0; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
50 static int ggi_bpp = 0; |
1144 | 51 static int ggi_bppmul = 0; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
52 static uint32_t virt_width; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
53 static uint32_t virt_height; |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
54 #ifdef GGI_OST |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
55 static ggi_pixel white; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
56 static ggi_pixel black; |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
57 #endif |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
58 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
59 static int ggi_setmode(uint32_t d_width, uint32_t d_height, int d_depth, int format) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
60 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
61 ggi_mode mode = |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
62 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
63 1, /* frames */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
64 { GGI_AUTO, GGI_AUTO }, /* visible */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
65 { GGI_AUTO, GGI_AUTO }, /* virt */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
66 { GGI_AUTO, GGI_AUTO }, /* size */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
67 GT_AUTO, /* graphtype */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
68 { 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
|
69 }; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
70 ggi_color pal[256]; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
71 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
72 mode.visible.x = mode.virt.x = d_width; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
73 mode.visible.y = mode.virt.y = d_height; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
74 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
75 switch(d_depth) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
76 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
77 case 1: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
78 mode.graphtype = GT_1BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
79 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
80 case 2: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
81 mode.graphtype = GT_2BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
82 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
83 case 4: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
84 mode.graphtype = GT_4BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
85 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
86 case 8: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
87 mode.graphtype = GT_8BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
88 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
89 case 15: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
90 mode.graphtype = GT_15BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
91 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
92 case 16: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
93 mode.graphtype = GT_16BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
94 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
95 case 24: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
96 mode.graphtype = GT_24BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
97 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
98 case 32: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
99 mode.graphtype = GT_32BIT; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
100 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
101 default: |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
102 printf("ggi-setmode: unknown bit depth - using auto\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
103 mode.graphtype = GT_AUTO; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
104 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
105 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
106 ggiCheckMode(ggi_vis, &mode); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
107 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
108 if (ggiSetMode(ggi_vis, &mode) != 0) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
109 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
110 printf("ggi-setmode: unable to set mode\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
111 ggiClose(ggi_vis); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
112 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
113 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
114 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
115 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
116 virt_width = mode.virt.x; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
117 virt_height = mode.virt.y; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
118 vo_screenwidth = mode.visible.x; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
119 vo_screenheight = mode.visible.y; |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
120 vo_depthonscreen = d_depth; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
121 ggi_bpp = d_depth; /* why ? */ |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
122 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
123 #ifdef get_db_info |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
124 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
125 const ggi_directbuffer *db = ggiDBGetBuffer(ggi_vis, 0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
126 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
127 if (db) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
128 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
129 vo_depthonscreen = db->buffer.plb.pixelformat->depth; |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
130 ggi_bpp = db->buffer.plb.pixelformat->size / 8; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
131 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
132 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
133 #endif |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
134 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
135 if (GT_SCHEME(mode.graphtype) == GT_PALETTE) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
136 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
137 ggiSetColorfulPalette(ggi_vis); |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
138 ggiGetPalette(ggi_vis, 0, 1 << ggi_bpp, pal); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
139 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
140 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
141 if (verbose) |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
142 printf("ggi-setmode: %dx%d (virt: %dx%d) screen depth: %d, bpp: %d, format: %s\n", |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
143 vo_screenwidth, vo_screenheight, virt_width, virt_height, |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
144 vo_depthonscreen, ggi_bpp, vo_format_name(ggi_format)); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
145 |
1144 | 146 ggi_bppmul = ggi_bpp/8; |
147 | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
148 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
149 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
150 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
151 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
152 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
153 uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
154 { |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
155 vo_depthonscreen = 32; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
156 |
1144 | 157 printf("ggi-init: This driver has got bugs, if you can, fix them.\n"); |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
158 |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
159 if (ggiInit() != 0) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
160 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
161 printf("ggi-init: unable to initialize GGI\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
162 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
163 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
164 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
165 if ((ggi_vis = ggiOpen(ggi_output_name)) == NULL) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
166 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
167 printf("ggi-init: unable to open GGI for %s output\n", |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
168 (ggi_output_name == NULL) ? "default" : ggi_output_name); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
169 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
170 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
171 } |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
172 |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
173 printf("ggi-init: using %s GGI output\n", |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
174 (ggi_output_name == NULL) ? "default" : ggi_output_name); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
175 |
1144 | 176 switch(format) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
177 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
178 case IMGFMT_RGB8: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
179 ggi_bpp = 8; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
180 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
181 case IMGFMT_RGB15: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
182 ggi_bpp = 15; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
183 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
184 case IMGFMT_RGB16: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
185 ggi_bpp = 16; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
186 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
187 case IMGFMT_RGB24: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
188 ggi_bpp = 24; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
189 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
190 case IMGFMT_RGB32: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
191 ggi_bpp = 32; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
192 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
193 case IMGFMT_BGR8: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
194 ggi_bpp = 8; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
195 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
196 case IMGFMT_BGR15: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
197 ggi_bpp = 15; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
198 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
199 case IMGFMT_BGR16: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
200 ggi_bpp = 16; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
201 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
202 case IMGFMT_BGR24: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
203 ggi_bpp = 24; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
204 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
205 case IMGFMT_BGR32: |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
206 ggi_bpp = 32; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
207 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
208 case IMGFMT_YV12: /* rgb, 24bit */ |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
209 ggi_bpp = 16; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
210 yuv2rgb_init(vo_depthonscreen, MODE_RGB); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
211 break; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
212 default: |
1144 | 213 printf("ggi-init: no suitable image format found (requested: %s)\n", |
214 vo_format_name(format)); | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
215 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
216 } |
1144 | 217 ggi_format = format; |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
218 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
219 ggiSetFlags(ggi_vis, GGIFLAG_ASYNC); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
220 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
221 if (ggi_setmode(d_width, d_height, vo_depthonscreen, ggi_format) != 0) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
222 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
223 printf("ggi-init: setmode returned with error\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
224 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
225 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
226 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
227 ggi_buffer = (ggi_directbuffer *)ggiDBGetBuffer(ggi_vis, 0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
228 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
229 if (ggi_buffer == NULL) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
230 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
231 printf("ggi-init: double buffering is not available\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
232 ggiClose(ggi_vis); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
233 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
234 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
235 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
236 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
237 if (!(ggi_buffer->type & GGI_DB_SIMPLE_PLB) || |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
238 (ggi_buffer->page_size != 0) || |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
239 (ggi_buffer->write == NULL) || |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
240 (ggi_buffer->noaccess != 0) || |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
241 (ggi_buffer->align != 0) || |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
242 (ggi_buffer->layout != blPixelLinearBuffer)) |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
243 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
244 printf("ggi-init: incorrect video memory type\n"); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
245 ggiClose(ggi_vis); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
246 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
247 return(-1); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
248 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
249 |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
250 #ifdef GGI_OST |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
251 /* just for fun */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
252 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
253 ggi_color col; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
254 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
255 /* set black */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
256 col.r = col.g = col.b = 0x0000; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
257 black = ggiMapColor(ggi_vis, &col); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
258 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
259 /* set white */ |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
260 col.r = col.g = col.b = 0xffff; |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
261 white = ggiMapColor(ggi_vis, &col); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
262 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
263 ggiSetGCForeground(ggi_vis, white); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
264 ggiSetGCBackground(ggi_vis, black); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
265 } |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
266 #endif |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
267 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
268 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
269 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
270 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
271 static const vo_info_t* get_info(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
272 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
273 return &vo_info; |
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 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
276 static uint32_t draw_frame(uint8_t *src[]) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
277 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
278 ggiResourceAcquire(ggi_buffer->resource, GGI_ACTYPE_WRITE); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
279 ggiSetDisplayFrame(ggi_vis, ggi_buffer->frame); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
280 ggiSetWriteFrame(ggi_vis, ggi_buffer->frame); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
281 |
1144 | 282 memcpy(ggi_buffer->write, src[0], virt_width*virt_height*ggi_bppmul); |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
283 |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
284 #ifdef GGI_OST |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
285 ggiPuts(ggi_vis, virt_width/2, virt_height-10, "MPlayer GGI"); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
286 #endif |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
287 |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
288 ggiResourceRelease(ggi_buffer->resource); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
289 return(0); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
290 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
291 |
1144 | 292 #ifdef GGI_OSD |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
293 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
|
294 unsigned char *srca, int stride) |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
295 { |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
296 #warning "draw_alpha needs to be fixed!" |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
297 switch(ggi_format) |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
298 { |
1144 | 299 case IMGFMT_YV12: |
300 case IMGFMT_I420: | |
301 case IMGFMT_IYUV: | |
302 vo_draw_alpha_yv12(w, h, src, srca, stride, | |
303 ((uint8_t *) ggi_buffer->write)+(virt_width*y0+x0)*ggi_bppmul, | |
304 virt_width*ggi_bppmul); | |
305 break; | |
306 case IMGFMT_YUY2: | |
307 case IMGFMT_YVYU: | |
308 vo_draw_alpha_yuy2(w, h, src, srca, stride, | |
309 ((uint8_t *) ggi_buffer->write)+2*(virt_width*y0+x0)*ggi_bppmul, | |
310 2*virt_width*ggi_bppmul); | |
311 break; | |
312 case IMGFMT_UYVY: | |
313 vo_draw_alpha_yuy2(w, h, src, srca, stride, | |
314 ((uint8_t *) ggi_buffer->write)+2*(virt_width*y0+x0)*ggi_bppmul+1, | |
315 2*virt_width*ggi_bppmul); | |
316 break; | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
317 case IMGFMT_RGB15: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
318 case IMGFMT_BGR15: |
1144 | 319 vo_draw_alpha_rgb15(w, h, src, srca, stride, |
320 ((uint8_t *) ggi_buffer->write)+2*(virt_width*y0+x0)*ggi_bppmul, | |
321 2*virt_width*ggi_bppmul); | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
322 break; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
323 case IMGFMT_RGB16: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
324 case IMGFMT_BGR16: |
1144 | 325 vo_draw_alpha_rgb16(w, h, src, srca, stride, |
326 ((uint8_t *) ggi_buffer->write)+2*(virt_width*y0+x0)*ggi_bppmul, | |
327 2*virt_width*ggi_bppmul); | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
328 break; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
329 case IMGFMT_RGB24: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
330 case IMGFMT_BGR24: |
1144 | 331 vo_draw_alpha_rgb24(w, h, src, srca, stride, |
332 ((uint8_t *) ggi_buffer->write)+3*(virt_width*y0+x0)*ggi_bppmul, | |
333 3*virt_width*ggi_bppmul); | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
334 break; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
335 case IMGFMT_RGB32: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
336 case IMGFMT_BGR32: |
1144 | 337 vo_draw_alpha_rgb32(w, h, src, srca, stride, |
338 ((uint8_t *) ggi_buffer->write)+4*(virt_width*y0+x0)*ggi_bppmul, | |
339 4*virt_width*ggi_bppmul); | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
340 break; |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
341 } |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
342 } |
1144 | 343 #endif |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
344 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
345 static void flip_page(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
346 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
347 check_events(); |
1144 | 348 #ifdef GGI_OSD |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
349 vo_draw_text(virt_width, virt_height, draw_alpha); |
1144 | 350 #endif |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
351 ggiFlush(ggi_vis); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
352 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
353 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
354 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
|
355 int x, int y) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
356 { |
1144 | 357 yuv2rgb(((uint8_t *) ggi_buffer->write)+(virt_width*y+x)*ggi_bppmul, |
358 src[0], src[1], src[2], w, h, virt_width*ggi_bppmul, stride[0], | |
359 stride[1]); | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
360 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
361 return(0); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
362 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
363 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
364 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
|
365 { |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
366 switch(format) |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
367 { |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
368 case IMGFMT_YV12: |
1144 | 369 /* case IMGFMT_I420: |
370 case IMGFMT_IYUV: | |
371 case IMGFMT_YUY2: | |
372 case IMGFMT_YVYU: | |
373 case IMGFMT_UYVY:*/ | |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
374 return(1); |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
375 case IMGFMT_RGB8: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
376 case IMGFMT_RGB15: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
377 case IMGFMT_RGB16: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
378 case IMGFMT_RGB24: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
379 case IMGFMT_RGB32: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
380 case IMGFMT_BGR8: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
381 case IMGFMT_BGR15: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
382 case IMGFMT_BGR16: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
383 case IMGFMT_BGR24: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
384 case IMGFMT_BGR32: |
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
385 return(1); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
386 } |
1141
c33f8b7488d1
cleaned up, and merged with my version, also code will be faster too
al3x
parents:
1132
diff
changeset
|
387 return(0); |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
388 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
389 |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
390 static void uninit(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
391 { |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
392 ggiResourceRelease(ggi_buffer->resource); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
393 ggiClose(ggi_vis); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
394 ggiExit(); |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
395 } |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
396 |
1143 | 397 #include "../linux/keycodes.h" |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
398 static void check_events(void) |
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
399 { |
1143 | 400 struct timeval tv = {0, 0}; |
401 ggi_event event; | |
402 ggi_event_mask mask; | |
403 | |
404 if ((mask = ggiEventPoll(ggi_vis, emAll, &tv))) | |
405 if (ggiEventRead(ggi_vis, &event, emAll) != 0) | |
406 { | |
407 // printf("type: %4x, origin: %4x, sym: %4x, label: %4x, button=%4x\n", | |
408 // event.any.origin, event.any.type, event.key.sym, event.key.label, event.key.button); | |
409 | |
410 if ((event.any.type == evKeyPress) || | |
411 (event.any.type == evKeyRepeat) || | |
412 (event.any.type == evKeyRelease)) | |
413 { | |
414 #ifdef GII_BUGGY_KEYCODES | |
415 switch(event.key.button) | |
416 { | |
417 case 0x37: | |
418 mplayer_put_key('*'); | |
419 break; | |
420 case 0x68: | |
421 mplayer_put_key('/'); | |
422 break; | |
423 case 0x4e: | |
424 mplayer_put_key('+'); | |
425 break; | |
426 case 0x4a: | |
427 mplayer_put_key('-'); | |
428 break; | |
429 case 0x18: | |
430 mplayer_put_key('o'); | |
431 break; | |
432 case 0x22: | |
433 mplayer_put_key('g'); | |
434 break; | |
435 case 0x15: | |
436 mplayer_put_key('z'); | |
437 break; | |
438 case 0x2d: | |
439 mplayer_put_key('x'); | |
440 break; | |
441 case 0x32: | |
442 mplayer_put_key('m'); | |
443 break; | |
444 case 0x20: | |
445 mplayer_put_key('d'); | |
446 break; | |
447 case 0x10: | |
448 mplayer_put_key('q'); | |
449 break; | |
450 case 0x39: | |
451 mplayer_put_key('p'); | |
452 break; | |
453 case 0x5a: | |
454 mplayer_put_key(KEY_UP); | |
455 break; | |
456 case 0x60: | |
457 mplayer_put_key(KEY_DOWN); | |
458 break; | |
459 case 0x5c: | |
460 mplayer_put_key(KEY_LEFT); | |
461 break; | |
462 case 0x5e: | |
463 mplayer_put_key(KEY_RIGHT); | |
464 break; | |
465 case 0x5b: | |
466 mplayer_put_key(KEY_PAGE_UP); | |
467 break; | |
468 case 0x61: | |
469 mplayer_put_key(KEY_PAGE_DOWN); | |
470 break; | |
471 default: | |
472 break; | |
473 } | |
474 #else | |
475 switch(event.key.button) | |
476 { | |
477 case GIIK_PAsterisk: /* PStar */ | |
478 case GIIUC_Asterisk: | |
479 mplayer_put_key('*'); | |
480 break; | |
481 case GIIK_PSlash: | |
482 case GIIUC_Slash: | |
483 mplayer_put_key('/'); | |
484 break; | |
485 case GIIK_PPlus: | |
486 case GIIUC_Plus: | |
487 mplayer_put_key('+'); | |
488 break; | |
489 case GIIK_PMinus: | |
490 case GIIUC_Minus: | |
491 mplayer_put_key('-'); | |
492 break; | |
493 case GIIUC_o: | |
494 case GIIUC_O: | |
495 mplayer_put_key('o'); | |
496 break; | |
497 case GIIUC_g: | |
498 case GIIUC_G: | |
499 mplayer_put_key('g'); | |
500 break; | |
501 case GIIUC_z: | |
502 case GIIUC_Z: | |
503 mplayer_put_key('z'); | |
504 break; | |
505 case GIIUC_x: | |
506 case GIIUC_X: | |
507 mplayer_put_key('x'); | |
508 break; | |
509 case GIIUC_m: | |
510 case GIIUC_M: | |
511 mplayer_put_key('m'); | |
512 break; | |
513 case GIIUC_d: | |
514 case GIIUC_D: | |
515 mplayer_put_key('d'); | |
516 break; | |
517 case GIIUC_q: | |
518 case GIIUC_Q: | |
519 mplayer_put_key('q'); | |
520 break; | |
521 case GIIUC_Space: | |
522 case GIIUC_p: | |
523 case GIIUC_P: | |
524 mplayer_put_key('p'); | |
525 break; | |
526 case GIIK_Up: | |
527 mplayer_put_key(KEY_UP); | |
528 break; | |
529 case GIIK_Down: | |
530 mplayer_put_key(KEY_DOWN); | |
531 break; | |
532 case GIIK_Left: | |
533 mplayer_put_key(KEY_LEFT); | |
534 break; | |
535 case GIIK_Right: | |
536 mplayer_put_key(KEY_RIGHT); | |
537 break; | |
538 case GIIK_PageUp: | |
539 mplayer_put_key(KEY_PAGE_UP); | |
540 break; | |
541 case GIIK_PageDown: | |
542 mplayer_put_key(KEY_PAGE_DOWN); | |
543 break; | |
544 default: | |
545 break; | |
546 } | |
547 #endif | |
548 } | |
549 } | |
550 return; | |
1132
80a0f8aa2360
Added for development only this is in pre-alpha state, do not use!
atmosfear
parents:
diff
changeset
|
551 } |