annotate libvo/vo_fsdga.c @ 5002:70751bbd6404

voctls for decoding ahead
author nick
date Sat, 09 Mar 2002 17:27:37 +0000
parents 32e1f5042f65
children 2001affedb75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
1 #define DISP
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
2
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
3 /*
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
4 * video_out_dga.c, X11 interface
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
5 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
6 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
7 * Copyright ( C ) 2001, Andreas Ackermann. All Rights Reserved.
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
8 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
9 * <acki@acki-netz.de>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
10 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
11 * note well:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
12 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
13 * o this is alpha
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
14 * o covers only common video card formats
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
15 * o works only on intel architectures
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
16 *
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
17 */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
18
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
19
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
20
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
21 #include <stdio.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
22 #include <stdlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
23 #include <string.h>
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
24 #include <errno.h>
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
25
354
7de9e48c83a5 memcpy() moved mmx.h -> fastmemcpy.h
arpi_esp
parents: 38
diff changeset
26 //#include "fastmemcpy.h"
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
27
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
28 #include "linux/keycodes.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
29 #include "config.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
30 #include "video_out.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
31 #include "video_out_internal.h"
2732
ae79207a3055 Move yuv2rgb to postprocess
nick
parents: 1501
diff changeset
32 #include "../postproc/rgb2rgb.h"
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
33
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
34 LIBVO_EXTERN( fsdga )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
35
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
36 #include <X11/Xlib.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
37 #include <X11/extensions/xf86dga.h>
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
39 #include "x11_common.h"
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
40
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
41 static vo_info_t vo_info =
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
42 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
43 "FullScreen DGA ( Direct Graphic Access )",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
44 "fsdga",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
45 "A'rpi/ESP-team & Andreas Ackermann <acki@acki-netz.de>",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
46 ""
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
47 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
48
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
49 static int vo_dga_width; // bytes per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
50 static int vo_dga_vp_width; // visible pixels per line in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
51 static int vo_dga_vp_height; // visible lines in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
52 static int vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
53 static int vo_dga_src_width; // width of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
54 static int vo_dga_src_height; // height of video in pixels
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
55 static int vo_dga_bpp; // bytes per pixel in framebuffer
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
56 static int vo_dga_src_offset=0; // offset in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
57 static int vo_dga_vp_offset=0; // offset in dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
58 static int vo_dga_bytes_per_line; // longwords per line to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
59 static int vo_dga_src_skip; // bytes to skip after copying one line
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
60 // (not supported yet) in src
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
61 static int vo_dga_vp_skip; // dto. for dest
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
62 static int vo_dga_lines; // num of lines to copy
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
63 static int vo_dga_src_format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
64
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
65 static unsigned char *vo_dga_base;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
66 static Display *vo_dga_dpy;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
67
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
68
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
69 #if defined (HAVE_SSE) || defined (HAVE_3DNOW)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
70 #define movntq "movntq" // use this for processors that have SSE or 3Dnow
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
71 #else
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
72 #define movntq "movq" // for MMX-only processors
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
73 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
74
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
75
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
76 #define rep_movsl(dest, src, numwords, d_add, count) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
77 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
78 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
79 xfer: \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
80 movl %%edx, %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
81 cld\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
82 rep\n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
83 movsl \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
84 add %%eax, %%edi \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
85 dec %%ebx \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
86 jnz xfer \n\t\
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
87 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
88 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
89 : "a" (d_add), "b" (count), "S" (src), "D" (dest), "d" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
90 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
91
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
92 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
93 : "S" (src), "D" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
94 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
95 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
96 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
97 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
98 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
99 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
100 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
101 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
102 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
103 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
104 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
105 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
106 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
107 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
108 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
109 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
110 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
111 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
112 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
113 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
114
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
115 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
116
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
117 #define mmx_movsl(dest, src, numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
118 __asm__ __volatile__( \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
119 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
120 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
121 xfer: \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
122 movq (%%eax), %%mm0 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
123 add $64, %%edx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
124 movq 8(%%eax), %%mm1 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
125 add $64, %%eax \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
126 movq -48(%%eax), %%mm2 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
127 movq %%mm0, -64(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
128 movq -40(%%eax), %%mm3 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
129 movq %%mm1, -56(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
130 movq -32(%%eax), %%mm4 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
131 movq %%mm2, -48(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
132 movq -24(%%eax), %%mm5 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
133 movq %%mm3, -40(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
134 movq -16(%%eax), %%mm6 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
135 movq %%mm4, -32(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
136 movq -8(%%eax), %%mm7 \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
137 movq %%mm5, -24(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
138 movq %%mm6, -16(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
139 dec %%ecx \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
140 movq %%mm7, -8(%%edx) \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
141 jnz xfer \n\t \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
142 \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
143 " \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
144 : \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
145 : "a" (src), "d" (dest), "c" (numwords) \
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
146 : "memory" )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
147
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
148 // src <= eax
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
149 // dst <= edx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
150 // num <= ecx
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
151
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
152 static uint32_t draw_frame( uint8_t *src[] ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
153
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
154 int vp_skip = vo_dga_vp_skip;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
155 int lpl = vo_dga_bytes_per_line >> 2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
156 int numlines = vo_dga_lines;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
157
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
158 char *s, *d;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
159
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
160 if( vo_dga_src_format==IMGFMT_YV12 ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
161 // We'll never reach this point, because YV12 codecs always calls draw_slice
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
162 printf("vo_dga: draw_frame() doesn't support IMGFMT_YV12 (yet?)\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
163 }else{
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
164 s = *src;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
165 d = (&((char *)vo_dga_base)[vo_dga_vp_offset]);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
166 rep_movsl(d, s, lpl, vo_dga_vp_skip, numlines );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
167 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
168
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
169 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
170 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
171
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
172 static void check_events(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
173 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
174 int e=vo_x11_check_events(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
175 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
176
1501
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
177 static void draw_osd(void)
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
178 {
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
179 }
d40f2b686846 changes according to -utf8 option, draw_osd() function added
atlka
parents: 612
diff changeset
180
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
181 static void flip_page( void ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
182 // printf("vo_dga: In flippage\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
183 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
184
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
185 static unsigned int pix_buf_y[4][2048];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
186 static unsigned int pix_buf_uv[2][2048*2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
187 static int dga_srcypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
188 static int dga_ypos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
189 static int dga_last_ypos=-1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
190 static unsigned int dga_xinc,dga_yinc,dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
191
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
192 static unsigned char clip_table[768];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
193
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
194 static int yuvtab_2568[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
195 static int yuvtab_3343[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
196 static int yuvtab_0c92[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
197 static int yuvtab_1a1e[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
198 static int yuvtab_40cf[256];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
199
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
200
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
201 static uint32_t draw_slice( uint8_t *srcptr[],int stride[],
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
202 int w,int h,int x,int y )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
203 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
204
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
205 if(y==0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
206 dga_srcypos=-2*dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
207 dga_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
208 dga_last_ypos=-2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
209 } // reset counters
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
210
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
211 while(1){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
212 unsigned char *dest=vo_dga_base+(vo_dga_width * dga_ypos)*vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
213 int y0=2+(dga_srcypos>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
214 int y1=1+(dga_srcypos>>17);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
215 int yalpha=(dga_srcypos&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
216 int yalpha1=yalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
217 int uvalpha=((dga_srcypos>>1)&0xFFFF)>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
218 int uvalpha1=uvalpha^255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
219 unsigned int *buf0=pix_buf_y[y0&3];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
220 unsigned int *buf1=pix_buf_y[((y0+1)&3)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
221 unsigned int *uvbuf0=pix_buf_uv[y1&1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
222 unsigned int *uvbuf1=pix_buf_uv[(y1&1)^1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
223 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
224
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
225 if(y0>=y+h) break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
226
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
227 dga_ypos++; dga_srcypos+=dga_yinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
228
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
229 if(dga_last_ypos!=y0){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
230 unsigned char *src=srcptr[0]+(y0-y)*stride[0];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
231 unsigned int xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
232 dga_last_ypos=y0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
233 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
234 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
235 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
236 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
237 buf1[i]=(src[xx]*(xalpha^255)+src[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
238 xpos+=dga_xinc;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
239 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
240 if(!(y0&1)){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
241 unsigned char *src1=srcptr[1]+(y1-y/2)*stride[1];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
242 unsigned char *src2=srcptr[2]+(y1-y/2)*stride[2];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
243 xpos=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
244 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
245 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
246 register unsigned int xx=xpos>>8;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
247 register unsigned int xalpha=xpos&0xFF;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
248 uvbuf1[i]=(src1[xx]*(xalpha^255)+src1[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
249 uvbuf1[i+2048]=(src2[xx]*(xalpha^255)+src2[xx+1]*xalpha);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
250 xpos+=dga_xinc2;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
251 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
252 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
253 if(!y0) continue;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
254 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
255
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
256 // this loop should be rewritten in MMX assembly!!!!
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
257 for(i=0;i<vo_dga_vp_width;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
258 // linear interpolation && yuv2rgb in a single step:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
259 int Y=yuvtab_2568[((buf0[i]*yalpha1+buf1[i]*yalpha)>>16)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
260 int U=((uvbuf0[i]*uvalpha1+uvbuf1[i]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
261 int V=((uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>16);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
262 dest[0]=clip_table[((Y + yuvtab_3343[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
263 dest[1]=clip_table[((Y + yuvtab_0c92[V] + yuvtab_1a1e[U]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
264 dest[2]=clip_table[((Y + yuvtab_40cf[V]) >>13)];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
265 dest+=vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
266 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
267
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
268 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
269
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
270
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
271 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
272 };
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
273
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
274 static const vo_info_t* get_info( void )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
275 { return &vo_info; }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
276
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
277 static uint32_t query_format( uint32_t format )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
278 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
279 printf("vo_dga: query_format\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
280
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
281 if( !vo_init() ) return 0; // Can't open X11
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
282 printf("Format: %lx\n", (unsigned long) format);
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
283
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
284 if( format==IMGFMT_YV12 ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
285 if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR &&
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
286 ( format&0xFF )==vo_depthonscreen ) return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
287 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
288 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
289
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
290
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
291 static void
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
292 uninit(void)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
293 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
294 vo_dga_is_running = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
295 XUngrabPointer (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
296 XUngrabKeyboard (vo_dga_dpy, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
297 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
298 XCloseDisplay(vo_dga_dpy);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
299 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
300
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
301
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
302
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
303
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
304 static uint32_t config( uint32_t width, uint32_t height,
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
305 uint32_t d_width,uint32_t d_height,
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
306 uint32_t fullscreen,char *title,uint32_t format,const vo_tune_info_t *info )
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
307 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
308
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
309 int bank, ram;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
310 int x_off, y_off;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
311
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
312 if( vo_dga_is_running )return -1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
313
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
314 if( !vo_init() ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
315 printf("vo_dga: vo_init() failed!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
316 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
317 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
318
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
319 if((vo_dga_dpy = XOpenDisplay(0))==NULL)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
320 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
321 printf ("vo_dga: Can't open display\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
322 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
323 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
324
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
325 XF86DGAGetVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
326 (char **)&vo_dga_base, &vo_dga_width, &bank, &ram);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
327 XF86DGAGetViewPortSize (vo_dga_dpy, XDefaultScreen (vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
328 &vo_dga_vp_width, &vo_dga_vp_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
329
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
330
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
331 // do some more checkings here ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
332 if( format==IMGFMT_YV12 )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
333 yuv2rgb_init( vo_depthonscreen, MODE_RGB );
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
334
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
335 vo_dga_src_format = format;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
336 vo_dga_src_width = width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
337 vo_dga_src_height = height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
338 vo_dga_bpp = (vo_depthonscreen+7) >> 3;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
339
612
77e0094f0cce some warnings killed
szabii
parents: 354
diff changeset
340 printf("vo_dga: bytes/line: %d, screen res: %dx%d, depth: %d, base: %p, bpp: %d\n",
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
341 vo_dga_width, vo_dga_vp_width,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
342 vo_dga_vp_height, vo_depthonscreen, vo_dga_base,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
343 vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
344 printf("vo_dga: video res: %dx%d\n", vo_dga_src_width, vo_dga_src_height);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
345
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
346 if(vo_dga_src_width > vo_dga_vp_width ||
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
347 vo_dga_src_height > vo_dga_vp_height){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
348 printf("vo_dga: Sorry, video larger than viewport is not yet supported!\n");
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
349 // ugly, do something nicer in the future ...
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
350 return 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
351 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
352
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
353 x_off = (vo_dga_vp_width - vo_dga_src_width)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
354 y_off = (vo_dga_vp_height - vo_dga_src_height)>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
355
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
356 vo_dga_bytes_per_line = vo_dga_src_width * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
357 vo_dga_lines = vo_dga_src_height; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
358
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
359
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
360 vo_dga_src_offset = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
361 vo_dga_vp_offset = (y_off * vo_dga_width + x_off ) * vo_dga_bpp;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
362
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
363 vo_dga_vp_skip = (vo_dga_width - vo_dga_src_width) * vo_dga_bpp; // todo
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
364
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
365 printf("vo_dga: vp_off=%d, vp_skip=%d, bpl=%d\n",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
366 vo_dga_vp_offset, vo_dga_vp_skip, vo_dga_bytes_per_line);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
367
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
368
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
369
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
370 XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 0, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
371 XF86DGADirectVideo (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
372 XF86DGADirectGraphics | XF86DGADirectMouse |
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
373 XF86DGADirectKeyb);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
374
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
375 XGrabKeyboard (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
376 GrabModeAsync,GrabModeAsync, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
377 XGrabPointer (vo_dga_dpy, DefaultRootWindow(vo_dga_dpy), True,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
378 ButtonPressMask,GrabModeAsync, GrabModeAsync,
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
379 None, None, CurrentTime);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
380
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
381 // now clear screen
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
382
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
383 memset(vo_dga_base, 0, vo_dga_width * vo_dga_vp_height * vo_dga_bpp);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
384
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
385 dga_yinc=(vo_dga_src_height<<16)/vo_dga_vp_height;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
386 dga_xinc=(vo_dga_src_width<<8)/vo_dga_vp_width;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
387 dga_xinc2=dga_xinc>>1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
388
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
389 { int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
390 for(i=0;i<256;i++){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
391 clip_table[i]=0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
392 clip_table[i+256]=i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
393 clip_table[i+512]=255;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
394 yuvtab_2568[i]=(0x2568*(i-16))+(256<<13);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
395 yuvtab_3343[i]=0x3343*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
396 yuvtab_0c92[i]=-0x0c92*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
397 yuvtab_1a1e[i]=-0x1a1e*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
398 yuvtab_40cf[i]=0x40cf*(i-128);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
399 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
400 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
401
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
402 vo_dga_is_running = 1;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
403 return 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
404 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
405
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
406 #if 0
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
407 int vo_dga_query_event(void){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
408
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
409 XEvent myevent;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
410 char text[10];
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
411 KeySym mykey;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
412 int retval = 0;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
413 int i;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
414
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
415 if( vo_dga_is_running ){
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
416 if(XPending(vo_dga_dpy)>0)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
417 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
418 XNextEvent(vo_dga_dpy, &myevent);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
419 switch (myevent.type)
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
420 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
421 case ButtonPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
422 /* Reaktion auf Knopfdruck ---> Textausgabe an der
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
423 Mauscursorposition */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
424
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
425 retval = 'q';
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
426 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
427 case KeyPress:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
428 /* Reaktion auf Tastendruck --> Testen ob Taste == "q",
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
429 falls ja: Programmende */
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
430 i=XLookupString(&myevent, text, 10, &mykey, 0);
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
431
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
432 if (mykey&0xff00 != 0) mykey=mykey&0x00ff + 256;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
433
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
434 switch ( mykey )
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
435 {
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
436 case wsLeft: retval=KEY_LEFT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
437 case wsRight: retval=KEY_RIGHT; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
438 case wsUp: retval=KEY_UP; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
439 case wsDown: retval=KEY_DOWN; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
440 case wsSpace: retval=' '; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
441 case wsEscape: retval=KEY_ESC; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
442 case wsEnter: retval=KEY_ENTER; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
443 case wsq:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
444 case wsQ: retval='q'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
445 case wsp:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
446 case wsP: retval='p'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
447 case wsMinus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
448 case wsGrayMinus: retval='-'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
449 case wsPlus:
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
450 case wsGrayPlus: retval='+'; break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
451 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
452 break;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
453 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
454 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
455 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
456 return retval;
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
457 }
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
458 #endif
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
459
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
460 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
461 {
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
462 if(arg)
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
463 {
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
464 printf("vo_fsdga: Unknown subdevice: %s\n",arg);
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
465 return ENOSYS;
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
466 }
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4596
diff changeset
467 return 0;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
468 }
38
46f3aa28aa83 added fsdga driver
arpi_esp
parents:
diff changeset
469
4596
c35d7ce151b3 10000hl to Holm... control MUST BE static...
arpi
parents: 4592
diff changeset
470 static uint32_t control(uint32_t request, void *data, ...)
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
471 {
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
472 switch (request) {
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
473 case VOCTRL_QUERY_FORMAT:
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
474 return query_format(*((uint32_t*)data));
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
475 }
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4439
diff changeset
476 return VO_NOTIMPL;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2732
diff changeset
477 }