annotate libvo/vo_syncfb.c @ 40:2fed43f60181

New data on mailing lists
author gabucino
date Mon, 05 Mar 2001 15:33:10 +0000
parents 1fc618eba830
children 601822cc8c52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 // How many MegaBytes of RAM is on your G200/G400 card?
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 #define RAM_SIZE 16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 * video_out_syncfb.c
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 * Copyright (C) Aaron Holtzman - Aug 1999
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 * mpeg2dec is free software; you can redistribute it and/or modify
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 * the Free Software Foundation; either version 2, or (at your option)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 * any later version.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 * mpeg2dec is distributed in the hope that it will be useful,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 * GNU General Public License for more details.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 * along with GNU Make; see the file COPYING. If not, write to
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25 *
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 #include <stdlib.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 #include <string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32 #include "config.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 #include "video_out.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #include "video_out_internal.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 LIBVO_EXTERN(syncfb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 #include <sys/ioctl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #include <unistd.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 #include <fcntl.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 #include <sys/mman.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 #include <linux/videodev.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 #include "drivers/syncfb/syncfb.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 static vo_info_t vo_info =
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 "Matrox G200/G400 Synchronous framebuffer (/dev/syncfb)",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 "syncfb",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 "Matthias Oelmann <mao@well.com>",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 ""
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 };
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 /* deinterlacing on? looks only good in 50 Hz(PAL) or 60 Hz(NTSC) modes */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 static int vo_conf_deinterlace = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 /* 72/75 Hz Monitor frequency for progressive output */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 static int vo_conf_cinemode = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 static syncfb_config_t config;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 static syncfb_capability_t sfb_caps;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 static syncfb_buffer_info_t bufinfo;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 static uint_8 *vid_data;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 static uint_8 *frame_mem;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 static int debug_skip_first = 250;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 static int dbg_singleframe = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 static int conf_palette;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 static int f;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 it seems that mpeg2dec never calls
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 draw_frame, so i could not test it....
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 write_frame_YUV422(uint_8 *y,uint_8 *cr, uint_8 *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 uint_8 *crp, *cbp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 uint_32 *dest32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 uint_32 bespitch,h,w;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 bespitch = config.src_pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 dest32 = (uint_32 *)vid_data;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 for(h=0; h < config.src_height/2; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 cbp = cb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 crp = cr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 *dest32++ = (*y) + ((*cr)<<8) + ((*(y+1))<<16) + ((*cb)<<24);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 y++; y++; cb++; cr++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 dest32 += (bespitch - config.src_width) / 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 *dest32++ = (*y) + ((*crp)<<8) + ((*(y+1))<<16) + ((*cbp)<<24);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 y++; y++; cbp++; crp++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 dest32 += (bespitch - config.src_width) / 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 write_frame_YUV420P2(uint_8 *y,uint_8 *cr, uint_8 *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 uint_8 *dest, *tmp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 uint_32 bespitch,h,w;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 bespitch = config.src_pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 dest = frame_mem + bufinfo.offset;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 for(h=0; h < config.src_height; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 memcpy(dest, y, config.src_width);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 y += config.src_width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 dest += bespitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 dest = frame_mem + bufinfo.offset_p2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 for(h=0; h < config.src_height/2; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 tmp = dest;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 *tmp++ = *cr++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 *tmp++ = *cb++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 dest += bespitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 write_frame_YUV420P3(uint_8 *y,uint_8 *cr, uint_8 *cb)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 write_slice_YUV420P2(uint_8 *y,uint_8 *cr, uint_8 *cb,uint_32 slice_num)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 uint_8 *dest, *tmp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 uint_32 bespitch,h,w;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 bespitch = config.src_pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 dest = frame_mem + bufinfo.offset + (bespitch * 16 * slice_num);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 for(h=0; h < 16; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 memcpy(dest, y, config.src_width);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 y += config.src_width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 dest += bespitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 dest = frame_mem + bufinfo.offset_p2 + (bespitch * 16 * slice_num) /2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 for(h=0; h < 8; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 tmp = dest;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 *tmp++ = *cr++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 *tmp++ = *cb++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 dest += bespitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 write_slice_YUV420P3(uint_8 *y,uint_8 *cr, uint_8 *cb,int stride[],uint_32 ypos,uint_32 xsize,uint_32 ysize)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 uint_8 *dest;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 uint_32 bespitch,h;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 bespitch = config.src_pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 dest = frame_mem + bufinfo.offset + (bespitch * ypos);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 for(h=0; h < ysize; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 memcpy(dest, y, xsize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 y += stride[0];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 dest += bespitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 xsize/=2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 ysize/=2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 dest = frame_mem + bufinfo.offset_p2 + (bespitch * ypos)/4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 for(h=0; h < ysize; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200 memcpy(dest, cr, xsize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 cr += stride[1];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 dest += bespitch/2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 dest = frame_mem + bufinfo.offset_p3 + (bespitch * ypos)/4;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 for(h=0; h < ysize; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 memcpy(dest, cb, xsize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 cb += stride[2];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 dest += bespitch/2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 write_slice_YUV422(uint_8 *y,uint_8 *cr, uint_8 *cb,uint_32 slice_num)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 uint_8 *crp, *cbp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 uint_32 *dest32;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 uint_32 bespitch,h,w;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 bespitch = config.src_pitch;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 dest32 = (uint_32 *)(vid_data + (bespitch * 16 * slice_num) * 2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 for(h=0; h < 8; h++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 cbp = cb;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 crp = cr;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 *dest32++ = (*y) + ((*cr)<<8) + ((*(y+1))<<16) + ((*cb)<<24);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235 y++; y++; cb++; cr++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 dest32 += (bespitch - config.src_width) / 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 for(w=0; w < config.src_width/2; w++)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 *dest32++ = (*y) + ((*crp)<<8) + ((*(y+1))<<16) + ((*cbp)<<24);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 y++; y++; cbp++; crp++;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 dest32 += (bespitch - config.src_width) / 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 //static uint32_t draw_slice(uint8_t *src[], uint32_t slice_num)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 static uint32_t
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 draw_slice(uint8_t *src[], int stride[], int w,int h,int x,int y)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 if ( vid_data == NULL ) return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 write_slice_YUV420P3(src[0],src[1], src[2],stride,y,w,h);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 //printf("sorry, not syncfb/draw_slice() implemented yet...\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 #if 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 if ( conf_palette == VIDEO_PALETTE_YUV422 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 write_slice_YUV422(src[0],src[1], src[2],slice_num);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 } else if ( conf_palette == VIDEO_PALETTE_YUV420P2 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264 write_slice_YUV420P2(src[0],src[1], src[2],slice_num);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 } else if ( conf_palette == VIDEO_PALETTE_YUV420P3 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 write_slice_YUV420P3(src[0],src[1], src[2],slice_num);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 flip_page(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 // memset(frame_mem + bufinfo.offset_p2, 0x80, config.src_width*config.src_height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 ioctl(f,SYNCFB_COMMIT_BUFFER,&bufinfo);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 if ( dbg_singleframe ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284 if ( debug_skip_first == 0 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 printf( "Press 'anykey' for field 1\n" );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 getchar();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 ioctl(f,SYNCFB_VBI,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 if ( debug_skip_first > 0 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291 debug_skip_first--;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 // debug_skip_first = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 if ( debug_skip_first == 0 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 ioctl(f,SYNCFB_VBI,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 ioctl(f,SYNCFB_VBI,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296 ioctl(f,SYNCFB_VBI,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 if ( debug_skip_first == 0 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 printf( "Press 'anykey' for field 2\n" );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302 getchar();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 ioctl(f,SYNCFB_VBI,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307 ioctl(f,SYNCFB_REQUEST_BUFFER,&bufinfo);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 if ( bufinfo.id == -1 ) printf( "Got buffer #%d\n", bufinfo.id );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 vid_data = (uint_8 *)(frame_mem + bufinfo.offset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 if ( bufinfo.id == -1 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312 //vid_data = frame_mem;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313 vid_data = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 // printf("Flip %d\n", bufinfo.offset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 static uint32_t draw_frame(uint8_t *src[])
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321 printf("DRAW FRAME!!!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 if ( conf_palette == VIDEO_PALETTE_YUV422 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 write_frame_YUV422(src[0],src[1], src[2]);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324 } else if ( conf_palette == VIDEO_PALETTE_YUV420P2 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 write_frame_YUV420P2(src[0],src[1], src[2]);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326 } else if ( conf_palette == VIDEO_PALETTE_YUV420P3 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 write_frame_YUV420P3(src[0],src[1], src[2]);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
328 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330 flip_page();
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334 static uint32_t
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335 query_format(uint32_t format)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
336 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 switch(format){
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 case IMGFMT_YV12:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 // case IMGFMT_RGB|24:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340 // case IMGFMT_BGR|24:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 return 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
345
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 uint_32 frame_size;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 f = open("/dev/syncfb",O_RDWR);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 if(f == -1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 f = open("/dev/mga_vid",O_RDWR);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 if(f == -1)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 fprintf(stderr,"Couldn't open /dev/syncfb or /dev/mga_vid\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 return(-1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 if (ioctl(f,SYNCFB_GET_CAPS,&sfb_caps)) perror("Error in mga_vid_config ioctl");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363 if (ioctl(f,SYNCFB_GET_CONFIG,&config)) perror("Error in mga_vid_config ioctl");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 if (sfb_caps.palettes & (1<<VIDEO_PALETTE_YUV420P3) ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 config.src_palette= VIDEO_PALETTE_YUV420P3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367 printf("using palette yuv420p3\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 }else if ( sfb_caps.palettes & (1<<VIDEO_PALETTE_YUV420P2) ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369 config.src_palette= VIDEO_PALETTE_YUV420P2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 printf("using palette yuv420p2\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 } else if ( sfb_caps.palettes & (1<<VIDEO_PALETTE_YUV422) ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 config.src_palette= VIDEO_PALETTE_YUV422;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 printf("using palette yuv422\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 printf("no supported palette found\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 exit(1);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 // config.src_palette= VIDEO_PALETTE_YUV422;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 if ( vo_conf_cinemode ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 config.default_repeat = 3;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 config.default_repeat = 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 conf_palette = config.src_palette;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 if ( vo_conf_deinterlace ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 config.syncfb_mode = SYNCFB_FEATURE_SCALE | SYNCFB_FEATURE_BLOCK_REQUEST | SYNCFB_FEATURE_DEINTERLACE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 config.default_repeat = 1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392 config.syncfb_mode = SYNCFB_FEATURE_SCALE | SYNCFB_FEATURE_BLOCK_REQUEST;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 config.fb_screen_size = (RAM_SIZE-4)*0x100000; //(1280 * 1024 * 32) / 8;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 config.src_width = width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
397 config.src_height= height;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
398
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
399 config.image_width = d_width;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
400 config.image_height= d_height;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
401 //config.image_width = 1024;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
402 //config.image_height= 576;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
403
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404 config.image_xorg= 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
405 config.image_yorg= 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
406
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
407
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
408 printf ("BES Sourcer size: %d x %d\n", width, height);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 ioctl(f,SYNCFB_ON,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
411 if (ioctl(f,SYNCFB_SET_CONFIG,&config)) perror("Error in mga_vid_config ioctl");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 printf ("Framebuffer memory: %ld in %ld buffers\n", sfb_caps.memory_size, config.buffers);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
416 frame_mem = (uint_8*)mmap(0,sfb_caps.memory_size,PROT_WRITE,MAP_SHARED,f,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
418 printf( "Requesting first buffer #%d\n", bufinfo.id );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
419 ioctl(f,SYNCFB_REQUEST_BUFFER,&bufinfo);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
420 printf( "Got first buffer #%d\n", bufinfo.id );
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
422
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423 vid_data = (uint_8 *)(frame_mem + bufinfo.offset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
424
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
425 //clear the buffer
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
426 // memset(frame_mem,0x80,frame_size*2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
428 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
430 static const vo_info_t*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
431 get_info(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
432 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
433 return &vo_info;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
434 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
435
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
436
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437 static void
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
438 uninit(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 if (ioctl(f,SYNCFB_OFF,0)) perror("Error in OFF ioctl");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443
31
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
444 static void check_events(void)
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
445 {
1fc618eba830 added check_events() interface
arpi_esp
parents: 1
diff changeset
446 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447