Mercurial > mplayer.hg
annotate libvo/vo_wii.c @ 27955:4f791accee10
cosmetics: Lessen differences to vo_wii.c.
author | diego |
---|---|
date | Sun, 23 Nov 2008 13:02:10 +0000 |
parents | 31837cfbb63c |
children | bada57652ab2 |
rev | line source |
---|---|
27375 | 1 /* |
2 * Video driver for Nintendo Wii/GameCube Framebuffer device | |
3 * | |
4 * Copyright (C) 2008 Jing Liu <fatersh-1@yahoo.com> | |
5 * | |
6 * Maintainer: Benjamin Zores <ben@geexbox.org> | |
7 * | |
8 * This file is part of MPlayer. | |
9 * | |
10 * MPlayer is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * MPlayer is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License along | |
21 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
23 */ | |
24 | |
25 /* | |
26 * This driver handles dedicated ATI GPU, which can be found in: | |
27 * - Nintendo GameCube (ATI LSI Flipper @ 162 MHz) | |
28 * - Nintendo Wii (ATI Hollywood @ 243 MHz) | |
29 * | |
30 * Flipper and Hollywood chipsets are pretty similar, except from clock speed: | |
31 * - Embedded framebuffer is 2MB. | |
32 * - Texture cache is 1MB. | |
33 * - Vertex cache is 0.1 MB. | |
34 * - Framebuffer is YUY2, not RGB. | |
35 * - Best resolution is 480p (854x480) | |
36 */ | |
37 | |
38 #include <stdio.h> | |
39 #include <stdlib.h> | |
40 #include <string.h> | |
41 #include <fcntl.h> | |
42 #include <unistd.h> | |
43 #include <errno.h> | |
44 #include <ctype.h> | |
45 | |
46 #include <sys/mman.h> | |
47 #include <sys/ioctl.h> | |
48 #include <sys/kd.h> | |
49 #include <linux/fb.h> | |
50 | |
51 #include "config.h" | |
52 #include "video_out.h" | |
53 #include "video_out_internal.h" | |
54 #include "sub.h" | |
55 #include "mp_msg.h" | |
56 | |
57 #define WII_DEV_NAME "/dev/fb0" | |
58 #define TTY_DEV_NAME "/dev/tty" | |
59 #define FB_PIXEL_SIZE 2 | |
60 | |
61 static const vo_info_t info = { | |
62 "Nintendo Wii/GameCube Framebuffer Device", | |
63 "wii", | |
64 "Jing Liu <fartersh-1@yahoo.com>", | |
65 "" | |
66 }; | |
67 | |
68 LIBVO_EXTERN(wii) | |
69 | |
70 static signed int pre_init_err = -2; | |
71 | |
72 static FILE *vt_fp = NULL; | |
73 static int vt_doit = 1; | |
74 static int fb_dev_fd = -1; | |
75 static int fb_tty_fd = -1; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
76 static size_t fb_size; |
27375 | 77 static uint8_t *frame_buffer; |
78 static uint8_t *center; | |
79 | |
80 static struct fb_var_screeninfo fb_orig_vinfo; | |
81 static struct fb_var_screeninfo fb_vinfo; | |
82 static int fb_line_len; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
83 static int in_width; |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
84 static int in_height; |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
85 static int out_width; |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
86 static int out_height; |
27375 | 87 static int fs; |
88 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
89 static int fb_preinit (int reset) |
27375 | 90 { |
91 static int fb_preinit_done = 0; | |
92 static int fb_works = 0; | |
93 | |
94 if (reset) | |
95 { | |
96 fb_preinit_done = 0; | |
97 return 0; | |
98 } | |
99 | |
100 if (fb_preinit_done) | |
101 return fb_works; | |
102 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
103 if ((fb_dev_fd = open (WII_DEV_NAME, O_RDWR)) == -1) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
104 mp_msg(MSGT_VO, MSGL_ERR, "Can't open %s: %s\n", WII_DEV_NAME, strerror (errno)); |
27375 | 105 goto err_out; |
106 } | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
107 if (ioctl (fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
108 mp_msg(MSGT_VO, MSGL_ERR, "Can't get VSCREENINFO: %s\n", strerror (errno)); |
27375 | 109 goto err_out_fd; |
110 } | |
111 fb_orig_vinfo = fb_vinfo; | |
112 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
113 if ((fb_tty_fd = open (TTY_DEV_NAME, O_RDWR)) < 0) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
114 mp_msg(MSGT_VO, MSGL_ERR, "notice: Can't open %s: %s\n", TTY_DEV_NAME, strerror (errno)); |
27375 | 115 goto err_out_fd; |
116 } | |
117 | |
118 fb_preinit_done = 1; | |
119 fb_works = 1; | |
120 return 1; | |
121 | |
122 err_out_fd: | |
123 close (fb_dev_fd); | |
124 fb_dev_fd = -1; | |
125 err_out: | |
126 fb_preinit_done = 1; | |
127 fb_works = 0; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
128 |
27375 | 129 return 0; |
130 } | |
131 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
132 static void vt_set_textarea(int u, int l) |
27375 | 133 { |
134 /* how can I determine the font height? | |
135 * just use 16 for now | |
136 */ | |
137 int urow = ((u + 15) / 16) + 1; | |
138 int lrow = l / 16; | |
139 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
140 mp_msg(MSGT_VO, MSGL_DBG2, "vt_set_textarea (%d, %d): %d,%d\n", u, l, urow, lrow); |
27375 | 141 |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
142 if (vt_fp) { |
27375 | 143 fprintf (vt_fp, "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0); |
144 fflush (vt_fp); | |
145 } | |
146 } | |
147 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
148 static int config(uint32_t width, uint32_t height, uint32_t d_width, |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
149 uint32_t d_height, uint32_t flags, char *title, |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
150 uint32_t format) |
27375 | 151 { |
152 struct fb_fix_screeninfo fb_finfo; | |
153 uint32_t black = 0x00800080; | |
154 long temp; | |
155 int vt_fd; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
156 |
27375 | 157 fs = flags & VOFLAG_FULLSCREEN; |
158 | |
159 if (pre_init_err == -2) | |
160 { | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
161 mp_msg(MSGT_VO, MSGL_ERR, "Internal fatal error: config() was called before preinit()\n"); |
27375 | 162 return -1; |
163 } | |
164 | |
165 if (pre_init_err) | |
166 return 1; | |
167 | |
168 in_width = width; | |
169 in_height = height; | |
170 | |
171 out_width = (d_width && fs) ? d_width : width; | |
172 out_height = (d_width && fs) ? d_height : height; | |
173 | |
174 fb_vinfo.xres_virtual = fb_vinfo.xres; | |
175 fb_vinfo.yres_virtual = fb_vinfo.yres; | |
176 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
177 if (fb_tty_fd >= 0 && ioctl (fb_tty_fd, KDSETMODE, KD_GRAPHICS) < 0) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
178 mp_msg(MSGT_VO, MSGL_V, "Can't set graphics mode: %s\n", strerror (errno)); |
27375 | 179 close (fb_tty_fd); |
180 fb_tty_fd = -1; | |
181 } | |
182 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
183 if (ioctl (fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo)) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
184 mp_msg(MSGT_VO, MSGL_ERR, "Can't put VSCREENINFO: %s\n", strerror (errno)); |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
185 if (fb_tty_fd >= 0 && ioctl (fb_tty_fd, KDSETMODE, KD_TEXT) < 0) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
186 mp_msg(MSGT_VO, MSGL_ERR, "Can't restore text mode: %s\n", strerror (errno)); |
27375 | 187 } |
188 return 1; | |
189 } | |
190 | |
191 if (fs) | |
192 { | |
193 out_width = fb_vinfo.xres; | |
194 out_height = fb_vinfo.yres; | |
195 } | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
196 |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
197 if (out_width < in_width || out_height < in_height) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
198 mp_msg(MSGT_VO, MSGL_ERR, "screensize is smaller than video size\n"); |
27375 | 199 return 1; |
200 } | |
201 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
202 if (ioctl (fb_dev_fd, FBIOGET_FSCREENINFO, &fb_finfo)) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
203 mp_msg(MSGT_VO, MSGL_ERR, "Can't get FSCREENINFO: %s\n", strerror (errno)); |
27375 | 204 return 1; |
205 } | |
206 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
207 if (fb_finfo.type != FB_TYPE_PACKED_PIXELS) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
208 mp_msg(MSGT_VO, MSGL_ERR, "type %d not supported\n", fb_finfo.type); |
27375 | 209 return 1; |
210 } | |
211 | |
212 fb_line_len = fb_finfo.line_length; | |
213 fb_size = fb_finfo.smem_len; | |
214 frame_buffer = NULL; | |
215 | |
216 frame_buffer = (uint8_t *) mmap (0, fb_size, PROT_READ | PROT_WRITE, | |
217 MAP_SHARED, fb_dev_fd, 0); | |
218 if (frame_buffer == (uint8_t *) -1) | |
219 { | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
220 mp_msg(MSGT_VO, MSGL_ERR, "Can't mmap %s: %s\n", WII_DEV_NAME, strerror (errno)); |
27375 | 221 return 1; |
222 } | |
223 | |
224 center = frame_buffer + | |
225 ((out_width - in_width) / 2) * FB_PIXEL_SIZE + | |
226 ((out_height - in_height) / 2) * fb_line_len; | |
227 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
228 mp_msg(MSGT_VO, MSGL_DBG2, "frame_buffer @ %p\n", frame_buffer); |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
229 mp_msg(MSGT_VO, MSGL_DBG2, "center @ %p\n", center); |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
230 mp_msg(MSGT_VO, MSGL_V, "pixel per line: %d\n", fb_line_len / FB_PIXEL_SIZE); |
27375 | 231 |
232 /* blanking screen */ | |
233 for (temp = 0; temp < fb_size; temp += 4) | |
234 memcpy (frame_buffer + temp, (void *) &black, 4); | |
235 | |
236 vt_fd = open (TTY_DEV_NAME, O_WRONLY); | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
237 if (vt_doit && vt_fd == -1) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
238 mp_msg(MSGT_VO, MSGL_ERR, "Can't open %s: %s\n", TTY_DEV_NAME, strerror (errno)); |
27375 | 239 vt_doit = 0; |
240 } | |
241 | |
242 vt_fp = fdopen (vt_fd, "w"); | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
243 if (vt_doit && !vt_fp) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
244 mp_msg(MSGT_VO, MSGL_ERR, "Can't fdopen %s: %s\n", TTY_DEV_NAME, strerror (errno)); |
27375 | 245 vt_doit = 0; |
246 } | |
247 | |
248 if (vt_doit) | |
249 vt_set_textarea ((out_height + in_height) / 2, fb_vinfo.yres); | |
250 | |
251 return 0; | |
252 } | |
253 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
254 static int query_format(uint32_t format) |
27375 | 255 { |
256 if (!fb_preinit (0)) | |
257 return 0; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
258 |
27375 | 259 if (format != IMGFMT_YUY2) |
260 return 0; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
261 |
27375 | 262 return VFCAP_ACCEPT_STRIDE | VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; |
263 } | |
264 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
265 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
266 unsigned char *srca, int stride) |
27375 | 267 { |
268 unsigned char *dst; | |
269 | |
270 dst = center + fb_line_len * y0 + FB_PIXEL_SIZE * x0; | |
271 vo_draw_alpha_yuy2 (w, h, src, srca, stride, dst, fb_line_len); | |
272 } | |
273 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
274 static int draw_frame(uint8_t *src[]) |
27375 | 275 { |
276 return 1; | |
277 } | |
278 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
279 static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y) |
27375 | 280 { |
281 uint8_t *d, *s; | |
282 | |
283 d = center + fb_line_len * y + FB_PIXEL_SIZE * x; | |
284 s = src[0]; | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
285 while (h) { |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
286 memcpy (d, s, w * FB_PIXEL_SIZE); |
27375 | 287 d += fb_line_len; |
288 s += stride[0]; | |
289 h--; | |
290 } | |
291 | |
292 return 0; | |
293 } | |
294 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
295 static void check_events(void) |
27375 | 296 { |
297 } | |
298 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
299 static void flip_page(void) |
27375 | 300 { |
301 } | |
302 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
303 static void draw_osd(void) |
27375 | 304 { |
305 vo_draw_text (in_width, in_height, draw_alpha); | |
306 } | |
307 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
308 static void uninit(void) |
27375 | 309 { |
310 if (ioctl (fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo)) | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
311 mp_msg(MSGT_VO, MSGL_WARN, "ioctl FBIOGET_VSCREENINFO: %s\n", strerror (errno)); |
27375 | 312 fb_orig_vinfo.xoffset = fb_vinfo.xoffset; |
313 fb_orig_vinfo.yoffset = fb_vinfo.yoffset; | |
314 if (ioctl (fb_dev_fd, FBIOPUT_VSCREENINFO, &fb_orig_vinfo)) | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
315 mp_msg(MSGT_VO, MSGL_WARN, "Can't reset original fb_var_screeninfo: %s\n", strerror (errno)); |
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
316 if (fb_tty_fd >= 0) { |
27375 | 317 if (ioctl (fb_tty_fd, KDSETMODE, KD_TEXT) < 0) |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
318 mp_msg(MSGT_VO, MSGL_WARN, "Can't restore text mode: %s\n", strerror (errno)); |
27375 | 319 } |
320 if (vt_doit) | |
321 vt_set_textarea (0, fb_orig_vinfo.yres); | |
322 close (fb_tty_fd); | |
323 close (fb_dev_fd); | |
324 if (frame_buffer) | |
325 munmap (frame_buffer, fb_size); | |
326 frame_buffer = NULL; | |
327 fb_preinit (1); | |
328 } | |
329 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
330 static int preinit(const char *vo_subdevice) |
27375 | 331 { |
332 pre_init_err = 0; | |
333 | |
334 if (!pre_init_err) | |
335 return pre_init_err = (fb_preinit (0) ? 0 : -1); | |
336 return -1; | |
337 } | |
338 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
339 static uint32_t get_image(mp_image_t *mpi) |
27375 | 340 { |
341 if (((mpi->type != MP_IMGTYPE_STATIC) && (mpi->type != MP_IMGTYPE_TEMP)) || | |
342 (mpi->flags & MP_IMGFLAG_PLANAR) || | |
343 (mpi->flags & MP_IMGFLAG_YUV) || | |
344 (mpi->width != in_width) || | |
345 (mpi->height != in_height)) | |
346 return VO_FALSE; | |
347 | |
348 mpi->planes[0] = center; | |
349 mpi->stride[0] = fb_line_len; | |
350 mpi->flags |= MP_IMGFLAG_DIRECT; | |
351 | |
352 return VO_TRUE; | |
353 } | |
354 | |
27950
31837cfbb63c
cosmetics: Reformat some lines to lessen differences to vo_fbdev.c.
diego
parents:
27375
diff
changeset
|
355 static int control(uint32_t request, void *data, ...) |
27375 | 356 { |
357 if (request == VOCTRL_GET_IMAGE) | |
358 return get_image (data); | |
359 else if (request == VOCTRL_QUERY_FORMAT) | |
360 return query_format (*((uint32_t*) data)); | |
361 | |
362 return VO_NOTIMPL; | |
363 } |