Mercurial > mplayer.hg
annotate libvo/vo_vesa.c @ 24541:173d35b7aca3
- make dhahelperwin compile with mingw
- add dhahelper.rc
based on code by Kevin Kofler and
Romain Li¸«±vin <roms at lievin.net> from the tilp project
http://svn.tilp.info/cgi-bin/viewcvs.cgi/libticables/trunk/src/win32/dha/
author | faust3 |
---|---|
date | Mon, 17 Sep 2007 21:12:29 +0000 |
parents | 973e53dc7df5 |
children | f224379e8cb3 |
rev | line source |
---|---|
2519 | 1 /* |
2244 | 2 * video_out_vesa.c |
3 * | |
4 * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - Oct 2001 | |
5 * | |
6 * You can redistribute this file under terms and conditions | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
7 * of GNU General Public licence v2. |
2244 | 8 * This file is partly based on vbetest.c from lrmi distributive. |
9 */ | |
10 | |
11 /* | |
12 TODO: | |
13 - hw YUV support (need volunteers who have corresponding hardware) | |
2649 | 14 - triple buffering (if it will really speedup playback). |
2692 | 15 note: triple buffering requires VBE 3.0 - need volunteers. |
2244 | 16 */ |
2775 | 17 #include "config.h" |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
18 #include "mp_msg.h" |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
19 #include "help_mp.h" |
7069 | 20 #include "gtf.h" |
2244 | 21 #include <stdio.h> |
2775 | 22 #ifdef HAVE_MALLOC_H |
23 #include <malloc.h> | |
24 #endif | |
2446 | 25 #include <stdlib.h> |
2244 | 26 #include <string.h> |
27 #include <stddef.h> | |
28 #include <limits.h> | |
4739 | 29 #include <unistd.h> |
30 #include <pwd.h> | |
31 #include <sys/types.h> | |
32 #include <sys/stat.h> | |
8791
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
33 #include <fcntl.h> |
4739 | 34 |
16256 | 35 #include <vbe.h> |
2244 | 36 |
37 #include "video_out.h" | |
38 #include "video_out_internal.h" | |
39 | |
40 #include "fastmemcpy.h" | |
2337 | 41 #include "sub.h" |
21392
d0bbb003112d
Correct include path for bswap.h, patch by Carl Eugen Hoyos, cehoyos ag.or.at.
diego
parents:
19531
diff
changeset
|
42 #include "libavutil/common.h" |
21507
fa99b3d31d13
Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents:
21392
diff
changeset
|
43 #include "mpbswap.h" |
2689 | 44 #include "aspect.h" |
3202 | 45 #include "vesa_lvo.h" |
4089 | 46 #ifdef CONFIG_VIDIX |
4030 | 47 #include "vosub_vidix.h" |
4089 | 48 #endif |
17932 | 49 #include "mp_msg.h" |
2244 | 50 |
18861 | 51 #include "libswscale/swscale.h" |
16841
55b59021b953
Make include paths consistent among files in libvo. Since -I.. is added
diego
parents:
16256
diff
changeset
|
52 #include "libmpcodecs/vf_scale.h" |
2298 | 53 |
4739 | 54 |
55 #ifdef HAVE_PNG | |
56 extern vo_functions_t video_out_png; | |
57 #endif | |
58 | |
7069 | 59 extern char *monitor_hfreq_str; |
60 extern char *monitor_vfreq_str; | |
61 extern char *monitor_dotclock_str; | |
62 | |
2649 | 63 #define MAX_BUFFERS 3 |
64 | |
2244 | 65 #ifndef max |
66 #define max(a,b) ((a)>(b)?(a):(b)) | |
67 #endif | |
68 #ifndef min | |
69 #define min(a,b) ((a)<(b)?(a):(b)) | |
70 #endif | |
71 | |
2688 | 72 #define UNUSED(x) ((void)(x)) /**< Removes warning about unused arguments */ |
2244 | 73 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7690
diff
changeset
|
74 static vo_info_t info = |
2244 | 75 { |
76 "VESA VBE 2.0 video output", | |
77 "vesa", | |
78 "Nick Kurshev <nickols_k@mail.ru>", | |
79 "Requires ROOT privileges" | |
80 }; | |
81 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7690
diff
changeset
|
82 LIBVO_EXTERN(vesa) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7690
diff
changeset
|
83 |
2244 | 84 /* driver data */ |
85 | |
86 struct win_frame | |
87 { | |
88 uint8_t *ptr; /* pointer to window's frame memory */ | |
89 uint32_t low; /* lowest boundary of frame */ | |
90 uint32_t high; /* highest boundary of frame */ | |
2610 | 91 char idx; /* indicates index of relocatable frame (A=0 or B=1) |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
92 special case for DGA: idx=-1 |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
93 idx=-2 indicates invalid frame, exists only in init() */ |
2244 | 94 }; |
95 | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
96 static void (*cpy_blk_fnc)(unsigned long,uint8_t *,unsigned long) = NULL; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
97 |
4537 | 98 static uint32_t srcW=0,srcH=0,srcBpp,srcFourcc; /* source image description */ |
99 static uint32_t dstBpp,dstW, dstH,dstFourcc; /* destinition image description */ | |
2298 | 100 |
9494
543ab3909b78
sws_ prefix, more seperation between internal & external swscaler API
michael
parents:
9380
diff
changeset
|
101 static struct SwsContext * sws = NULL; |
4537 | 102 |
2329 | 103 static int32_t x_offset,y_offset; /* to center image on screen */ |
9170 | 104 static unsigned init_mode=0; /* mode before run of mplayer */ |
2244 | 105 static void *init_state = NULL; /* state before run of mplayer */ |
106 static struct win_frame win; /* real-mode window to video memory */ | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
107 static uint8_t *dga_buffer = NULL; /* for yuv2rgb and sw_scaling */ |
2244 | 108 static unsigned video_mode; /* selected video mode for playback */ |
109 static struct VesaModeInfoBlock video_mode_info; | |
2331 | 110 static int flip_trigger = 0; |
2337 | 111 static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride); |
2244 | 112 |
2649 | 113 /* multibuffering */ |
114 uint8_t* video_base; /* should be never changed */ | |
115 uint32_t multi_buff[MAX_BUFFERS]; /* contains offsets of buffers */ | |
116 uint8_t multi_size=0; /* total number of buffers */ | |
117 uint8_t multi_idx=0; /* active buffer */ | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
118 |
2869 | 119 /* Linux Video Overlay */ |
120 static const char *lvo_name = NULL; | |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
121 static int lvo_opened = 0; |
4089 | 122 #ifdef CONFIG_VIDIX |
4030 | 123 static const char *vidix_name = NULL; |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
124 static int vidix_opened = 0; |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
125 static vidix_grkey_t gr_key; |
4089 | 126 #endif |
2869 | 127 |
12660
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
128 /* Neomagic TV out */ |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
129 static int neomagic_tvout = 0; |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
130 static int neomagic_tvnorm = NEO_PAL; |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
131 |
2649 | 132 #define HAS_DGA() (win.idx == -1) |
2244 | 133 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS) |
2649 | 134 #define FRAME_MODE (MODE_WIN_RELOCATABLE | MODE_WIN_WRITEABLE) |
135 | |
2244 | 136 static char * vbeErrToStr(int err) |
137 { | |
138 char *retval; | |
139 static char sbuff[80]; | |
140 if((err & VBE_VESA_ERROR_MASK) == VBE_VESA_ERROR_MASK) | |
141 { | |
4667 | 142 sprintf(sbuff,"VESA failed = 0x4f%02x",(err & VBE_VESA_ERRCODE_MASK)>>8); |
2244 | 143 retval = sbuff; |
144 } | |
145 else | |
146 switch(err) | |
147 { | |
148 case VBE_OK: retval = "No error"; break; | |
149 case VBE_VM86_FAIL: retval = "vm86() syscall failed"; break; | |
150 case VBE_OUT_OF_DOS_MEM: retval = "Out of DOS memory"; break; | |
151 case VBE_OUT_OF_MEM: retval = "Out of memory"; break; | |
2360 | 152 case VBE_BROKEN_BIOS: retval = "Broken BIOS or DOS TSR"; break; |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
153 default: sprintf(sbuff,"Unknown or internal error: %i",err); retval=sbuff; break; |
2244 | 154 } |
155 return retval; | |
156 } | |
157 | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
158 #define PRINT_VBE_ERR(name,err) { mp_msg(MSGT_VO,MSGL_WARN, "vo_vesa: %s returns: %s\n",name,vbeErrToStr(err)); fflush(stdout); } |
2244 | 159 |
160 static void vesa_term( void ) | |
161 { | |
162 int err; | |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
163 if(lvo_opened) { vlvo_term(); lvo_opened = 0; } |
4089 | 164 #ifdef CONFIG_VIDIX |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
165 else if(vidix_opened) { vidix_term(); vidix_opened = 0; } |
4089 | 166 #endif |
9170 | 167 if(init_state) if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err); |
168 init_state=NULL; | |
169 if(init_mode) if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err); | |
170 init_mode=0; | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
171 if(HAS_DGA()) vbeUnmapVideoBuffer((unsigned long)win.ptr,win.high); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
172 if(dga_buffer && !HAS_DGA()) free(dga_buffer); |
2244 | 173 vbeDestroy(); |
9494
543ab3909b78
sws_ prefix, more seperation between internal & external swscaler API
michael
parents:
9380
diff
changeset
|
174 if(sws) sws_freeContext(sws); |
9170 | 175 sws=NULL; |
2244 | 176 } |
177 | |
178 #define VALID_WIN_FRAME(offset) (offset >= win.low && offset < win.high) | |
179 #define VIDEO_PTR(offset) (win.ptr + offset - win.low) | |
180 | |
181 static inline void __vbeSwitchBank(unsigned long offset) | |
182 { | |
183 unsigned long gran; | |
184 unsigned new_offset; | |
185 int err; | |
186 gran = video_mode_info.WinGranularity*1024; | |
187 new_offset = offset / gran; | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
188 if(HAS_DGA()) { err = -1; goto show_err; } |
2244 | 189 if((err=vbeSetWindow(win.idx,new_offset)) != VBE_OK) |
190 { | |
2610 | 191 show_err: |
2686 | 192 vesa_term(); |
2244 | 193 PRINT_VBE_ERR("vbeSetWindow",err); |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
194 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_FatalErrorOccurred); |
10734 | 195 abort(); |
2244 | 196 } |
197 win.low = new_offset * gran; | |
198 win.high = win.low + video_mode_info.WinSize*1024; | |
199 } | |
200 | |
201 static void __vbeSetPixel(int x, int y, int r, int g, int b) | |
202 { | |
203 int x_res = video_mode_info.XResolution; | |
204 int y_res = video_mode_info.YResolution; | |
205 int shift_r = video_mode_info.RedFieldPosition; | |
206 int shift_g = video_mode_info.GreenFieldPosition; | |
207 int shift_b = video_mode_info.BlueFieldPosition; | |
4537 | 208 int pixel_size = (dstBpp+7)/8; |
2244 | 209 int bpl = video_mode_info.BytesPerScanLine; |
2676 | 210 int color; |
211 unsigned offset; | |
2244 | 212 |
213 if (x < 0 || x >= x_res || y < 0 || y >= y_res) return; | |
214 r >>= 8 - video_mode_info.RedMaskSize; | |
215 g >>= 8 - video_mode_info.GreenMaskSize; | |
216 b >>= 8 - video_mode_info.BlueMaskSize; | |
217 color = (r << shift_r) | (g << shift_g) | (b << shift_b); | |
218 offset = y * bpl + (x * pixel_size); | |
219 if(!VALID_WIN_FRAME(offset)) __vbeSwitchBank(offset); | |
23458
973e53dc7df5
Do not use fast_memcpy for small size copy, esp. when the size is constant
reimar
parents:
23457
diff
changeset
|
220 memcpy(VIDEO_PTR(offset), &color, pixel_size); |
2244 | 221 } |
222 | |
223 /* | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
224 Copies part of frame to video memory. Data should be in the same format |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
225 as video memory. |
2244 | 226 */ |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
227 static void __vbeCopyBlockFast(unsigned long offset,uint8_t *image,unsigned long size) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
228 { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22767
diff
changeset
|
229 fast_memcpy(&win.ptr[offset],image,size); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
230 } |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
231 |
2244 | 232 static void __vbeCopyBlock(unsigned long offset,uint8_t *image,unsigned long size) |
233 { | |
234 unsigned long delta,src_idx = 0; | |
235 while(size) | |
236 { | |
4537 | 237 if(!VALID_WIN_FRAME(offset)) __vbeSwitchBank(offset); |
238 delta = min(size,win.high - offset); | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
22767
diff
changeset
|
239 fast_memcpy(VIDEO_PTR(offset),&image[src_idx],delta); |
4537 | 240 src_idx += delta; |
241 offset += delta; | |
242 size -= delta; | |
2244 | 243 } |
244 } | |
245 | |
246 /* | |
247 Copies frame to video memory. Data should be in the same format as video | |
248 memory. | |
249 */ | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
250 |
4537 | 251 #define PIXEL_SIZE() ((dstBpp+7)/8) |
2676 | 252 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) ) |
4537 | 253 #define IMAGE_LINE_SIZE(pixel_size) (dstW*(pixel_size)) |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
254 |
2244 | 255 static void __vbeCopyData(uint8_t *image) |
256 { | |
2308 | 257 unsigned long i,j,image_offset,offset; |
2244 | 258 unsigned pixel_size,image_line_size,screen_line_size,x_shift; |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
259 pixel_size = PIXEL_SIZE(); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
260 screen_line_size = SCREEN_LINE_SIZE(pixel_size); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
261 image_line_size = IMAGE_LINE_SIZE(pixel_size); |
4537 | 262 if(dstW == video_mode_info.XResolution) |
2306 | 263 { |
264 /* Special case for zooming */ | |
4537 | 265 (*cpy_blk_fnc)(y_offset*screen_line_size,image,image_line_size*dstH); |
2306 | 266 } |
267 else | |
2244 | 268 { |
2306 | 269 x_shift = x_offset*pixel_size; |
4537 | 270 for(j=0,i=y_offset;j<dstH;i++,j++) |
2306 | 271 { |
272 offset = i*screen_line_size+x_shift; | |
273 image_offset = j*image_line_size; | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
274 (*cpy_blk_fnc)(offset,&image[image_offset],image_line_size); |
2306 | 275 } |
2244 | 276 } |
277 } | |
2328 | 278 |
2244 | 279 /* is called for yuv only */ |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
280 static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) |
2244 | 281 { |
14796 | 282 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4537 | 283 uint8_t *dst[3]= {dga_buffer, NULL, NULL}; |
284 int dstStride[3]; | |
17932 | 285 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
286 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y); |
4537 | 287 dstStride[0]=dstride*((dstBpp+7)/8); |
288 dstStride[1]= | |
289 dstStride[2]=dstStride[0]>>1; | |
290 if(HAS_DGA()) dst[0] += y_offset*SCREEN_LINE_SIZE(PIXEL_SIZE())+x_offset*PIXEL_SIZE(); | |
10404 | 291 sws_scale_ordered(sws,image,stride,y,h,dst,dstStride); |
2331 | 292 flip_trigger = 1; |
2298 | 293 return 0; |
2244 | 294 } |
295 | |
4572 | 296 /* Please comment it out if you want have OSD within movie */ |
6825
2cbf7d447bb2
Disable OSD outside movie, because it's not redrawn currently, user can use -vop expand to get osd outisde movie.
atmos4
parents:
6203
diff
changeset
|
297 /*#define OSD_OUTSIDE_MOVIE 1*/ |
4572 | 298 |
2649 | 299 static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) |
300 { | |
14796 | 301 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4572 | 302 #ifndef OSD_OUTSIDE_MOVIE |
303 if(HAS_DGA()) | |
304 { | |
305 x0 += x_offset; | |
306 y0 += y_offset; | |
307 } | |
308 #endif | |
2649 | 309 vo_draw_alpha_rgb32(w,h,src,srca,stride,dga_buffer+4*(y0*dstride+x0),4*dstride); |
2337 | 310 } |
311 | |
2649 | 312 static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) |
313 { | |
14796 | 314 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4572 | 315 #ifndef OSD_OUTSIDE_MOVIE |
316 if(HAS_DGA()) | |
317 { | |
318 x0 += x_offset; | |
319 y0 += y_offset; | |
320 } | |
321 #endif | |
2649 | 322 vo_draw_alpha_rgb24(w,h,src,srca,stride,dga_buffer+3*(y0*dstride+x0),3*dstride); |
2337 | 323 } |
324 | |
2649 | 325 static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) |
326 { | |
14796 | 327 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4572 | 328 #ifndef OSD_OUTSIDE_MOVIE |
329 if(HAS_DGA()) | |
330 { | |
331 x0 += x_offset; | |
332 y0 += y_offset; | |
333 } | |
334 #endif | |
2649 | 335 vo_draw_alpha_rgb16(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); |
2337 | 336 } |
337 | |
2649 | 338 static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) |
339 { | |
14796 | 340 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4572 | 341 #ifndef OSD_OUTSIDE_MOVIE |
342 if(HAS_DGA()) | |
343 { | |
344 x0 += x_offset; | |
345 y0 += y_offset; | |
346 } | |
347 #endif | |
2649 | 348 vo_draw_alpha_rgb15(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride); |
2337 | 349 } |
350 | |
2649 | 351 static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) |
352 { | |
2688 | 353 UNUSED(x0); |
354 UNUSED(y0); | |
355 UNUSED(w); | |
356 UNUSED(h); | |
357 UNUSED(src); | |
358 UNUSED(srca); | |
359 UNUSED(stride); | |
2337 | 360 } |
361 | |
362 | |
2244 | 363 static void draw_osd(void) |
364 { | |
2649 | 365 uint32_t w,h; |
17932 | 366 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
367 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_osd was called\n"); |
2869 | 368 { |
4572 | 369 #ifdef OSD_OUTSIDE_MOVIE |
4537 | 370 w = HAS_DGA()?video_mode_info.XResolution:dstW; |
371 h = HAS_DGA()?video_mode_info.YResolution:dstH; | |
4572 | 372 #else |
373 w = dstW; | |
374 h = dstH; | |
375 #endif | |
2869 | 376 if(dga_buffer) vo_draw_text(w,h,draw_alpha_fnc); |
377 } | |
2244 | 378 } |
379 | |
380 static void flip_page(void) | |
381 { | |
17932 | 382 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
383 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: flip_page was called\n"); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
384 if(flip_trigger) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
385 { |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
386 if(!HAS_DGA()) __vbeCopyData(dga_buffer); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
387 flip_trigger = 0; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
388 } |
4493 | 389 if(vo_doublebuffering && multi_size > 1) |
2649 | 390 { |
2686 | 391 int err; |
4667 | 392 if((err=vbeSetDisplayStart(multi_buff[multi_idx],vo_vsync)) != VBE_OK) |
2686 | 393 { |
394 vesa_term(); | |
2692 | 395 PRINT_VBE_ERR("vbeSetDisplayStart",err); |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
396 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_FatalErrorOccurred); |
10734 | 397 abort(); |
2686 | 398 } |
399 multi_idx = multi_idx ? 0 : 1; | |
400 win.ptr = dga_buffer = video_base + multi_buff[multi_idx]; | |
2649 | 401 } |
402 /* | |
403 else | |
404 if(tripple_buffering) | |
405 { | |
4667 | 406 vbeSetScheduledDisplayStart(multi_buff[multi_idx],vo_vsync); |
2649 | 407 multi_idx++; |
408 if(multi_idx > 2) multi_idx = 0; | |
4667 | 409 win.ptr = dga_buffer = video_base + multi_buff[multi_idx]; |
2649 | 410 } |
411 */ | |
2244 | 412 } |
413 | |
414 /* is called for rgb only */ | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
415 static int draw_frame(uint8_t *src[]) |
2244 | 416 { |
17932 | 417 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
418 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: draw_frame was called\n"); |
4537 | 419 if(sws) |
2504 | 420 { |
14796 | 421 int dstride=HAS_DGA()?video_mode_info.XResolution:dstW; |
4537 | 422 int srcStride[1]; |
423 uint8_t *dst[3]= {dga_buffer, NULL, NULL}; | |
424 int dstStride[3]; | |
425 dstStride[0]=dstride*((dstBpp+7)/8); | |
426 dstStride[1]= | |
427 dstStride[2]=dstStride[0]>>1; | |
428 if(srcFourcc == IMGFMT_RGB32 || srcFourcc == IMGFMT_BGR32) | |
429 srcStride[0] = srcW*4; | |
430 else | |
431 if(srcFourcc == IMGFMT_RGB24 || srcFourcc == IMGFMT_BGR24) | |
432 srcStride[0] = srcW*3; | |
433 else | |
434 srcStride[0] = srcW*2; | |
435 if(HAS_DGA()) dst[0] += y_offset*SCREEN_LINE_SIZE(PIXEL_SIZE())+x_offset*PIXEL_SIZE(); | |
10404 | 436 sws_scale_ordered(sws,src,srcStride,0,srcH,dst,dstStride); |
4537 | 437 flip_trigger=1; |
438 } | |
2504 | 439 return 0; |
2244 | 440 } |
441 | |
2953
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
442 #define SUBDEV_NODGA 0x00000001UL |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
443 #define SUBDEV_FORCEDGA 0x00000002UL |
4362 | 444 static uint32_t subdev_flags = 0xFFFFFFFEUL; |
2953
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
445 static uint32_t parseSubDevice(const char *sd) |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
446 { |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
447 uint32_t flags; |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
448 flags = 0; |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
449 if(strcmp(sd,"nodga") == 0) { flags |= SUBDEV_NODGA; flags &= ~(SUBDEV_FORCEDGA); } |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
450 else |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
451 if(strcmp(sd,"dga") == 0) { flags &= ~(SUBDEV_NODGA); flags |= SUBDEV_FORCEDGA; } |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
452 else |
12660
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
453 if(strcmp(sd,"neotv_pal") == 0) { neomagic_tvout = 1; neomagic_tvnorm = NEO_PAL; } |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
454 else |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
455 if(strcmp(sd,"neotv_ntsc") == 0) { neomagic_tvout = 1; neomagic_tvnorm = NEO_NTSC; } |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
456 else |
2953
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
457 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */ |
4089 | 458 #ifdef CONFIG_VIDIX |
4030 | 459 else |
460 if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */ | |
4089 | 461 #endif |
22465 | 462 else { mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_UnknownSubdevice, sd); return 0xFFFFFFFFUL; } |
2953
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
463 return flags; |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
464 } |
b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents:
2918
diff
changeset
|
465 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
466 static int query_format(uint32_t format) |
2244 | 467 { |
17932 | 468 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
469 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format)); |
12926
6eb8d78e2d47
10l query format at least when used with vidix, disable colorkeying with vidix, should fix #38 and #33
faust3
parents:
12660
diff
changeset
|
470 #ifdef CONFIG_VIDIX |
6eb8d78e2d47
10l query format at least when used with vidix, disable colorkeying with vidix, should fix #38 and #33
faust3
parents:
12660
diff
changeset
|
471 if(vidix_name)return(vidix_query_fourcc(format)); |
6eb8d78e2d47
10l query format at least when used with vidix, disable colorkeying with vidix, should fix #38 and #33
faust3
parents:
12660
diff
changeset
|
472 #endif |
16196 | 473 if (format == IMGFMT_MPEGPES) |
474 return 0; | |
475 // FIXME: this is just broken... | |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14796
diff
changeset
|
476 return VFCAP_CSP_SUPPORTED | VFCAP_OSD | VFCAP_SWSCALE | VFCAP_ACCEPT_STRIDE; /* due new SwScale code */ |
2244 | 477 } |
478 | |
2686 | 479 static void paintBkGnd( void ) |
480 { | |
481 int x_res = video_mode_info.XResolution; | |
482 int y_res = video_mode_info.YResolution; | |
483 int x, y; | |
484 | |
485 for (y = 0; y < y_res; ++y) | |
486 { | |
487 for (x = 0; x < x_res; ++x) | |
488 { | |
489 int r, g, b; | |
490 if ((x & 16) ^ (y & 16)) | |
491 { | |
492 r = x * 255 / x_res; | |
493 g = y * 255 / y_res; | |
494 b = 255 - x * 255 / x_res; | |
495 } | |
496 else | |
497 { | |
498 r = 255 - x * 255 / x_res; | |
499 g = y * 255 / y_res; | |
500 b = 255 - y * 255 / y_res; | |
501 } | |
502 __vbeSetPixel(x, y, r, g, b); | |
503 } | |
504 } | |
505 } | |
506 | |
2914 | 507 static void clear_screen( void ) |
508 { | |
509 int x_res = video_mode_info.XResolution; | |
510 int y_res = video_mode_info.YResolution; | |
511 int x, y; | |
512 | |
513 for (y = 0; y < y_res; ++y) | |
514 for (x = 0; x < x_res; ++x) | |
515 __vbeSetPixel(x, y, 0, 0, 0); | |
516 } | |
517 | |
2293 | 518 static char *model2str(unsigned char type) |
519 { | |
520 char *retval; | |
521 switch(type) | |
522 { | |
523 case memText: retval = "Text"; break; | |
524 case memCGA: retval="CGA"; break; | |
525 case memHercules: retval="Hercules"; break; | |
526 case memPL: retval="Planar"; break; | |
527 case memPK: retval="Packed pixel"; break; | |
528 case mem256: retval="256"; break; | |
529 case memRGB: retval="Direct color RGB"; break; | |
530 case memYUV: retval="Direct color YUV"; break; | |
531 default: retval="Unknown"; break; | |
532 } | |
533 return retval; | |
534 } | |
535 | |
2649 | 536 unsigned fillMultiBuffer( unsigned long vsize, unsigned nbuffs ) |
537 { | |
538 unsigned long screen_size, offset; | |
539 unsigned total,i; | |
4537 | 540 screen_size = video_mode_info.XResolution*video_mode_info.YResolution*((dstBpp+7)/8); |
2649 | 541 if(screen_size%64) screen_size=((screen_size/64)*64)+64; |
542 total = vsize / screen_size; | |
17932 | 543 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
544 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Can use up to %u video buffers\n",total); |
2649 | 545 i = 0; |
546 offset = 0; | |
547 total = min(total,nbuffs); | |
548 while(i < total) { multi_buff[i++] = offset; offset += screen_size; } | |
549 if(!i) | |
18335 | 550 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory, screen_size, vsize); |
2649 | 551 return i; |
552 } | |
553 | |
7360 | 554 |
7069 | 555 static int set_refresh(unsigned x, unsigned y, unsigned mode,struct VesaCRTCInfoBlock *crtc_pass) |
556 { | |
557 unsigned pixclk; | |
558 float H_freq; | |
559 | |
560 range_t *monitor_hfreq = NULL; | |
561 range_t *monitor_vfreq = NULL; | |
562 range_t *monitor_dotclock = NULL; | |
2649 | 563 |
7069 | 564 monitor_hfreq = str2range(monitor_hfreq_str); |
565 monitor_vfreq = str2range(monitor_vfreq_str); | |
566 monitor_dotclock = str2range(monitor_dotclock_str); | |
567 | |
568 if (!monitor_hfreq || !monitor_vfreq || !monitor_dotclock) { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
569 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor); |
7069 | 570 return 0; |
571 } | |
572 | |
573 H_freq = range_max(monitor_hfreq)/1000; | |
574 | |
575 // printf("H_freq MAX %f\n",H_freq); | |
576 | |
577 do | |
578 { | |
7360 | 579 H_freq -= 0.01; |
7069 | 580 GTF_calcTimings(x,y,H_freq,GTF_HF,0, 0,crtc_pass); |
581 // printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock); | |
582 } | |
7360 | 583 while ( (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)|| |
584 !in_range(monitor_hfreq,H_freq*1000))&&(H_freq>0)); | |
7069 | 585 |
586 pixclk = crtc_pass->PixelClock; | |
587 // printf("PIXclk before %d\n",pixclk); | |
588 vbeGetPixelClock(&mode,&pixclk); | |
589 // printf("PIXclk after %d\n",pixclk); | |
590 GTF_calcTimings(x,y,pixclk/1000000,GTF_PF,0,0,crtc_pass); | |
591 // printf("Flags: %x\n",(unsigned) crtc_pass->Flags); | |
592 /* | |
593 printf("hTotal %d\n",crtc_pass->hTotal); | |
594 printf("hSyncStart %d\n",crtc_pass->hSyncStart); | |
595 printf("hSyncEnd %d\n",crtc_pass->hSyncEnd); | |
596 | |
597 printf("vTotal %d\n",crtc_pass->vTotal); | |
598 printf("vSyncStart %d\n",crtc_pass->vSyncStart); | |
599 printf("vSyncEnd %d\n",crtc_pass->vSyncEnd); | |
600 | |
601 printf("RR %d\n",crtc_pass->RefreshRate); | |
602 printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock);*/ | |
7360 | 603 |
604 if (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)|| | |
605 !in_range(monitor_hfreq,H_freq*1000)) { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
606 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_UnableToFitTheMode); |
7360 | 607 return 0; |
608 } | |
609 | |
7069 | 610 return 1; |
611 } | |
7360 | 612 |
2244 | 613 /* fullscreen: |
614 * bit 0 (0x01) means fullscreen (-fs) | |
615 * bit 1 (0x02) means mode switching (-vm) | |
616 * bit 2 (0x04) enables software scaling (-zoom) | |
2335 | 617 * bit 3 (0x08) enables flipping (-flip) (NK: and for what?) |
2244 | 618 */ |
7069 | 619 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
620 static int |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
7069
diff
changeset
|
621 config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
2244 | 622 { |
22767 | 623 static struct VbeInfoBlock vib; |
624 static int vib_set; | |
2244 | 625 struct VesaModeInfoBlock vmib; |
7069 | 626 struct VesaCRTCInfoBlock crtc_pass; |
2244 | 627 size_t i,num_modes; |
4362 | 628 uint32_t w,h; |
2244 | 629 unsigned short *mode_ptr,win_seg; |
630 unsigned bpp,best_x = UINT_MAX,best_y=UINT_MAX,best_mode_idx = UINT_MAX; | |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
631 int err,fs_mode,use_scaler=0; |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
632 srcW = dstW = width; |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
633 srcH = dstH = height; |
2336 | 634 fs_mode = 0; |
4362 | 635 if(subdev_flags == 0xFFFFFFFEUL) |
2971 | 636 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
637 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_DetectedInternalFatalError); |
2971 | 638 return -1; |
4362 | 639 } |
4537 | 640 if(subdev_flags == 0xFFFFFFFFUL) return -1; |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14796
diff
changeset
|
641 if(flags & VOFLAG_FLIPPING) |
2244 | 642 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
643 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported); |
2244 | 644 } |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14796
diff
changeset
|
645 if(flags & VOFLAG_SWSCALE) use_scaler = 1; |
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14796
diff
changeset
|
646 if(flags & VOFLAG_FULLSCREEN) |
2336 | 647 { |
4537 | 648 if(use_scaler) use_scaler = 2; |
2336 | 649 else fs_mode = 1; |
650 } | |
2244 | 651 if((err=vbeInit()) != VBE_OK) { PRINT_VBE_ERR("vbeInit",err); return -1; } |
23458
973e53dc7df5
Do not use fast_memcpy for small size copy, esp. when the size is constant
reimar
parents:
23457
diff
changeset
|
652 memcpy(vib.VESASignature,"VBE2",4); |
22767 | 653 if(!vib_set && (err=vbeGetControllerInfo(&vib)) != VBE_OK) |
2244 | 654 { |
655 PRINT_VBE_ERR("vbeGetControllerInfo",err); | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
656 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_PossibleReasonNoVbe2BiosFound); |
2244 | 657 return -1; |
658 } | |
22767 | 659 vib_set = 1; |
2244 | 660 /* Print general info here */ |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
661 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_FoundVesaVbeBiosVersion, |
2244 | 662 (int)(vib.VESAVersion >> 8) & 0xff, |
663 (int)(vib.VESAVersion & 0xff), | |
664 (int)(vib.OemSoftwareRev & 0xffff)); | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
665 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_VideoMemory,vib.TotalMemory*64); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
666 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_Capabilites |
2255 | 667 ,vib.Capabilities & VBE_DAC_8BIT ? "8-bit DAC," : "6-bit DAC," |
668 ,vib.Capabilities & VBE_NONVGA_CRTC ? "non-VGA CRTC,":"VGA CRTC," | |
669 ,vib.Capabilities & VBE_SNOWED_RAMDAC ? "snowed RAMDAC,":"normal RAMDAC," | |
670 ,vib.Capabilities & VBE_STEREOSCOPIC ? "stereoscopic,":"no stereoscopic," | |
671 ,vib.Capabilities & VBE_STEREO_EVC ? "Stereo EVC":"no stereo"); | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
672 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_BelowWillBePrintedOemInfo); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
673 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_YouShouldSee5OemRelatedLines); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
674 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OemInfo,vib.OemStringPtr); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
675 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OemRevision,vib.OemSoftwareRev); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
676 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OemVendor,vib.OemVendorNamePtr); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
677 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OemProductName,vib.OemProductNamePtr); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
678 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OemProductRev,vib.OemProductRevPtr); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
679 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_Hint); |
2244 | 680 /* Find best mode here */ |
681 num_modes = 0; | |
682 mode_ptr = vib.VideoModePtr; | |
683 while(*mode_ptr++ != 0xffff) num_modes++; | |
684 switch(format) | |
685 { | |
686 case IMGFMT_BGR8: | |
687 case IMGFMT_RGB8: bpp = 8; break; | |
688 case IMGFMT_BGR15: | |
689 case IMGFMT_RGB15: bpp = 15; break; | |
690 case IMGFMT_BGR16: | |
691 case IMGFMT_RGB16: bpp = 16; break; | |
692 case IMGFMT_BGR24: | |
693 case IMGFMT_RGB24: bpp = 24; break; | |
694 case IMGFMT_BGR32: | |
695 case IMGFMT_RGB32: bpp = 32; break; | |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
696 default: bpp = 16; break; |
2244 | 697 } |
4537 | 698 srcBpp = bpp; |
699 srcFourcc = format; | |
2504 | 700 if(vo_dbpp) bpp = vo_dbpp; |
2337 | 701 switch(bpp) |
702 { | |
4537 | 703 case 15: draw_alpha_fnc = draw_alpha_15; |
704 dstFourcc = IMGFMT_BGR15; | |
705 break; | |
706 case 16: draw_alpha_fnc = draw_alpha_16; | |
707 dstFourcc = IMGFMT_BGR16; | |
708 break; | |
709 case 24: draw_alpha_fnc = draw_alpha_24; | |
710 dstFourcc = IMGFMT_BGR24; | |
711 break; | |
712 case 32: draw_alpha_fnc = draw_alpha_32; | |
713 dstFourcc = IMGFMT_BGR32; | |
714 break; | |
715 default: draw_alpha_fnc = draw_alpha_null; | |
716 dstFourcc = IMGFMT_BGR16; | |
717 break; | |
2337 | 718 } |
17932 | 719 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
2244 | 720 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
721 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Requested mode: %ux%u@%u (%s)\n",width,height,bpp,vo_format_name(format)); |
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
722 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Total modes found: %u\n",num_modes); |
2244 | 723 mode_ptr = vib.VideoModePtr; |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
724 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Mode list:"); |
2244 | 725 for(i = 0;i < num_modes;i++) |
726 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
727 mp_msg(MSGT_VO,MSGL_V, " %04X",mode_ptr[i]); |
2244 | 728 } |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
729 mp_msg(MSGT_VO,MSGL_V, "\nvo_vesa: Modes in detail:\n"); |
2244 | 730 } |
731 mode_ptr = vib.VideoModePtr; | |
4537 | 732 if(use_scaler) |
2335 | 733 { |
4537 | 734 dstW = d_width; |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
735 dstH = d_height; |
2335 | 736 } |
737 if(vo_screenwidth) w = vo_screenwidth; | |
4537 | 738 else w = max(dstW,width); |
2335 | 739 if(vo_screenheight) h = vo_screenheight; |
4537 | 740 else h = max(dstH,height); |
2244 | 741 for(i=0;i < num_modes;i++) |
742 { | |
743 if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK) | |
744 { | |
745 PRINT_VBE_ERR("vbeGetModeInfo",err); | |
13568
1cb0e1833515
Currently vbeGetProtModeInfo call the 0x4f0a function of int 10h the get
faust3
parents:
13480
diff
changeset
|
746 continue; |
2244 | 747 } |
2329 | 748 if(vmib.XResolution >= w && |
749 vmib.YResolution >= h && | |
2244 | 750 (vmib.ModeAttributes & MOVIE_MODE) == MOVIE_MODE && |
751 vmib.BitsPerPixel == bpp && | |
752 vmib.MemoryModel == memRGB) | |
753 { | |
2293 | 754 if(vmib.XResolution <= best_x && |
755 vmib.YResolution <= best_y) | |
2244 | 756 { |
757 best_x = vmib.XResolution; | |
758 best_y = vmib.YResolution; | |
759 best_mode_idx = i; | |
760 } | |
761 } | |
17932 | 762 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
2244 | 763 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
764 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Mode (%03u): mode=%04X %ux%u@%u attr=%04X\n" |
2293 | 765 "vo_vesa: #planes=%u model=%u(%s) #pages=%u\n" |
766 "vo_vesa: winA=%X(attr=%u) winB=%X(attr=%u) winSize=%u winGran=%u\n" | |
2446 | 767 "vo_vesa: direct_color=%u DGA_phys_addr=%08lX\n" |
2244 | 768 ,i,mode_ptr[i],vmib.XResolution,vmib.YResolution,vmib.BitsPerPixel,vmib.ModeAttributes |
2293 | 769 ,vmib.NumberOfPlanes,vmib.MemoryModel,model2str(vmib.MemoryModel),vmib.NumberOfImagePages |
2244 | 770 ,vmib.WinASegment,vmib.WinAAttributes,vmib.WinBSegment,vmib.WinBAttributes,vmib.WinSize,vmib.WinGranularity |
771 ,vmib.DirectColorModeInfo,vmib.PhysBasePtr); | |
772 if(vmib.MemoryModel == 6 || vmib.MemoryModel == 7) | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
773 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: direct_color_info = %u:%u:%u:%u\n" |
2244 | 774 ,vmib.RedMaskSize,vmib.GreenMaskSize,vmib.BlueMaskSize,vmib.RsvdMaskSize); |
775 fflush(stdout); | |
776 } | |
777 } | |
778 if(best_mode_idx != UINT_MAX) | |
779 { | |
780 video_mode = vib.VideoModePtr[best_mode_idx]; | |
781 fflush(stdout); | |
782 if((err=vbeGetMode(&init_mode)) != VBE_OK) | |
783 { | |
784 PRINT_VBE_ERR("vbeGetMode",err); | |
785 return -1; | |
786 } | |
17932 | 787 if( mp_msg_test(MSGT_VO,MSGL_V) ) { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
788 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Initial video mode: %x\n",init_mode); } |
2244 | 789 if((err=vbeGetModeInfo(video_mode,&video_mode_info)) != VBE_OK) |
790 { | |
791 PRINT_VBE_ERR("vbeGetModeInfo",err); | |
792 return -1; | |
793 } | |
7025
3bc8ff93d64e
10l bug - noticed by Emiel Neggers <emiel@neggers.net>
arpi
parents:
6825
diff
changeset
|
794 dstBpp = video_mode_info.BitsPerPixel; |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
795 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_UsingVesaMode |
2329 | 796 ,best_mode_idx,video_mode,video_mode_info.XResolution |
4537 | 797 ,video_mode_info.YResolution,dstBpp); |
4362 | 798 if(subdev_flags & SUBDEV_NODGA) video_mode_info.PhysBasePtr = 0; |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
799 if(use_scaler || fs_mode) |
2298 | 800 { |
2304 | 801 /* software scale */ |
13480 | 802 if(use_scaler > 1 |
803 #ifdef CONFIG_VIDIX | |
804 || vidix_name | |
805 #endif | |
806 ) | |
2689 | 807 { |
808 aspect_save_orig(width,height); | |
809 aspect_save_prescale(d_width,d_height); | |
810 aspect_save_screenres(video_mode_info.XResolution,video_mode_info.YResolution); | |
4537 | 811 aspect(&dstW,&dstH,A_ZOOM); |
2689 | 812 } |
2336 | 813 else |
814 if(fs_mode) | |
815 { | |
4537 | 816 dstW = video_mode_info.XResolution; |
817 dstH = video_mode_info.YResolution; | |
2336 | 818 } |
4537 | 819 use_scaler = 1; |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
820 } |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
821 if(!lvo_name |
4089 | 822 #ifdef CONFIG_VIDIX |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
823 && !vidix_name |
4089 | 824 #endif |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
825 ) |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
826 { |
9494
543ab3909b78
sws_ prefix, more seperation between internal & external swscaler API
michael
parents:
9380
diff
changeset
|
827 sws = sws_getContextFromCmdLine(srcW,srcH,srcFourcc,dstW,dstH,dstFourcc); |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
828 if(!sws) |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
829 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
830 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_CantInitializeSwscaler); |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
831 return -1; |
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
832 } |
17932 | 833 else if( mp_msg_test(MSGT_VO,MSGL_V) ) { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
834 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Using SW BES emulator\n"); } |
2298 | 835 } |
2244 | 836 if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE) |
837 win.idx = 0; /* frame A */ | |
838 else | |
839 if((video_mode_info.WinBAttributes & FRAME_MODE) == FRAME_MODE) | |
840 win.idx = 1; /* frame B */ | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
841 else win.idx = -2; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
842 /* Try use DGA instead */ |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
843 if(video_mode_info.PhysBasePtr && vib.TotalMemory && (video_mode_info.ModeAttributes & MODE_ATTR_LINEAR)) |
2244 | 844 { |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
845 void *lfb; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
846 unsigned long vsize; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
847 vsize = vib.TotalMemory*64*1024; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
848 lfb = vbeMapVideoBuffer(video_mode_info.PhysBasePtr,vsize); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
849 if(lfb == NULL) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
850 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_CantUseDga); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
851 else |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
852 { |
2649 | 853 video_base = win.ptr = lfb; |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
854 win.low = 0UL; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
855 win.high = vsize; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
856 win.idx = -1; /* HAS_DGA() is on */ |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
857 video_mode |= VESA_MODE_USE_LINEAR; |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
858 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_UsingDga |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
859 ,video_mode_info.PhysBasePtr |
2649 | 860 ,vsize); |
17932 | 861 if( mp_msg_test(MSGT_VO,MSGL_V) ) { |
862 printf(" at %08lXh",(unsigned long)lfb); } | |
2649 | 863 printf("\n"); |
864 if(!(multi_size = fillMultiBuffer(vsize,2))) return -1; | |
865 if(vo_doublebuffering && multi_size < 2) | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
866 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_CantUseDoubleBuffering); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
867 } |
2244 | 868 } |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
869 if(win.idx == -2) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
870 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
871 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantFindNeitherDga); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
872 return -1; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
873 } |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
874 if(!HAS_DGA()) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
875 { |
4362 | 876 if(subdev_flags & SUBDEV_FORCEDGA) |
2649 | 877 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
878 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_YouveForcedDga); |
2649 | 879 return -1; |
880 } | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
881 if(!(win_seg = win.idx == 0 ? video_mode_info.WinASegment:video_mode_info.WinBSegment)) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
882 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
883 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantFindValidWindowAddress); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
884 return -1; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
885 } |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
886 win.ptr = PhysToVirtSO(win_seg,0); |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
887 win.low = 0L; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
888 win.high= video_mode_info.WinSize*1024; |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
889 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_UsingBankSwitchingMode |
2649 | 890 ,(unsigned long)win.ptr,(unsigned long)win.high); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
891 } |
4537 | 892 if(video_mode_info.XResolution > dstW) |
893 x_offset = (video_mode_info.XResolution - dstW) / 2; | |
2329 | 894 else x_offset = 0; |
4537 | 895 if(video_mode_info.YResolution > dstH) |
896 y_offset = (video_mode_info.YResolution - dstH) / 2; | |
2329 | 897 else y_offset = 0; |
17932 | 898 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
899 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n" |
4537 | 900 ,dstW,dstH |
2305
82c17b134946
Fixed half-image bug and added computing of correct aspect during zooming
nick
parents:
2304
diff
changeset
|
901 ,video_mode_info.XResolution,video_mode_info.YResolution |
82c17b134946
Fixed half-image bug and added computing of correct aspect during zooming
nick
parents:
2304
diff
changeset
|
902 ,x_offset,y_offset); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
903 if(HAS_DGA()) |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
904 { |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
905 dga_buffer = win.ptr; /* Trickly ;) */ |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
906 cpy_blk_fnc = __vbeCopyBlockFast; |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
907 } |
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
908 else |
2610 | 909 { |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
910 cpy_blk_fnc = __vbeCopyBlock; |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
911 if(!lvo_name |
4089 | 912 #ifdef CONFIG_VIDIX |
913 && !vidix_name | |
914 #endif | |
4601
8cda24d7f074
Make code simple. Use swScaler even for fastmemcpy purposes :)
nick
parents:
4596
diff
changeset
|
915 ) |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
916 { |
4537 | 917 if(!(dga_buffer = memalign(64,video_mode_info.XResolution*video_mode_info.YResolution*dstBpp))) |
2610 | 918 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
919 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantAllocateTemporaryBuffer); |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
920 return -1; |
2610 | 921 } |
17932 | 922 if( mp_msg_test(MSGT_VO,MSGL_V) ) { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
923 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: dga emulator was allocated = %p\n",dga_buffer); } |
2337 | 924 } |
2504 | 925 } |
2244 | 926 if((err=vbeSaveState(&init_state)) != VBE_OK) |
927 { | |
928 PRINT_VBE_ERR("vbeSaveState",err); | |
929 } | |
7360 | 930 |
931 /* TODO: | |
932 user might pass refresh value, | |
7069 | 933 GTF constants might be read from monitor |
7360 | 934 for best results, I don't have a spec (RM) |
7069 | 935 */ |
7360 | 936 |
7069 | 937 if (((int)(vib.VESAVersion >> 8) & 0xff) > 2) { |
938 | |
7650
7e8193475ddf
a small fix for vo_vesa, when calling set_refresh, when -nofs used.
arpi
parents:
7360
diff
changeset
|
939 if (set_refresh(video_mode_info.XResolution,video_mode_info.YResolution,video_mode,&crtc_pass)) |
7069 | 940 video_mode = video_mode | 0x800; |
941 | |
942 } | |
943 | |
944 ; | |
945 | |
946 if ((err=vbeSetMode(video_mode,&crtc_pass)) != VBE_OK) | |
2244 | 947 { |
948 PRINT_VBE_ERR("vbeSetMode",err); | |
949 return -1; | |
950 } | |
7069 | 951 |
12660
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
952 if (neomagic_tvout) { |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
953 err = vbeSetTV(video_mode,neomagic_tvnorm); |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
954 if (err!=0x4f) { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
955 mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_VESA_SorryUnsupportedMode); |
12660
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
956 } |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
957 else { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
958 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_OhYouReallyHavePictureOnTv); |
12660
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
959 } |
430a71a762b4
neomagic tv out support throught vesa vbe, patch by Rudolf Marek
alex
parents:
11678
diff
changeset
|
960 } |
2244 | 961 /* Now we are in video mode!!!*/ |
2337 | 962 /* Below 'return -1' is impossible */ |
17932 | 963 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
2244 | 964 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
965 mp_msg(MSGT_VO,MSGL_V, "vo_vesa: Graphics mode was activated\n"); |
2244 | 966 fflush(stdout); |
967 } | |
2869 | 968 if(lvo_name) |
969 { | |
4537 | 970 if(vlvo_init(width,height,x_offset,y_offset,dstW,dstH,format,dstBpp) != 0) |
2869 | 971 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
972 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantInitialozeLinuxVideoOverlay); |
2869 | 973 vesa_term(); |
974 return -1; | |
975 } | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
976 else mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_UsingVideoOverlay,lvo_name); |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
977 lvo_opened = 1; |
2869 | 978 } |
4089 | 979 #ifdef CONFIG_VIDIX |
4030 | 980 else |
981 if(vidix_name) | |
982 { | |
4537 | 983 if(vidix_init(width,height,x_offset,y_offset,dstW, |
984 dstH,format,dstBpp, | |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
7069
diff
changeset
|
985 video_mode_info.XResolution,video_mode_info.YResolution) != 0) |
4030 | 986 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
987 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantInitializeVidixDriver); |
4548 | 988 vesa_term(); |
4030 | 989 return -1; |
990 } | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
991 else mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_UsingVidix); |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4089
diff
changeset
|
992 vidix_start(); |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
993 |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
994 /* set colorkey */ |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
995 if (vidix_grkey_support()) |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
996 { |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
997 vidix_grkey_get(&gr_key); |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
998 gr_key.key_op = KEYS_PUT; |
12926
6eb8d78e2d47
10l query format at least when used with vidix, disable colorkeying with vidix, should fix #38 and #33
faust3
parents:
12660
diff
changeset
|
999 #if 0 |
11216 | 1000 if (!(vo_colorkey & 0xFF000000)) |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1001 { |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1002 gr_key.ckey.op = CKEY_TRUE; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1003 gr_key.ckey.red = (vo_colorkey & 0x00FF0000) >> 16; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1004 gr_key.ckey.green = (vo_colorkey & 0x0000FF00) >> 8; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1005 gr_key.ckey.blue = vo_colorkey & 0x000000FF; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1006 } else |
12926
6eb8d78e2d47
10l query format at least when used with vidix, disable colorkeying with vidix, should fix #38 and #33
faust3
parents:
12660
diff
changeset
|
1007 #endif |
11158
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1008 gr_key.ckey.op = CKEY_FALSE; |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1009 vidix_grkey_set(&gr_key); |
85f4534d1edb
Colorkeying can be disabled. Fbdev, svga and vesa vidix colorkeying support
alex
parents:
10734
diff
changeset
|
1010 } |
9883
3a407acefec5
multiple init fix by Aurelien JACOBS <aurel@gnuage.org>
alex
parents:
9714
diff
changeset
|
1011 vidix_opened = 1; |
4030 | 1012 } |
4089 | 1013 #endif |
2244 | 1014 } |
1015 else | |
1016 { | |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1017 mp_msg(MSGT_VO,MSGL_ERR, MSGTR_LIBVO_VESA_CantFindModeFor,width,height,bpp); |
2244 | 1018 return -1; |
1019 } | |
17932 | 1020 if( mp_msg_test(MSGT_VO,MSGL_V) ) |
2244 | 1021 { |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1022 mp_msg(MSGT_VO,MSGL_INFO, MSGTR_LIBVO_VESA_InitializationComplete); |
2244 | 1023 fflush(stdout); |
1024 } | |
2688 | 1025 if(HAS_DGA() && vo_doublebuffering) |
2244 | 1026 { |
19531
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1027 if (VBE_OK != vbeSetDisplayStart(0, vo_vsync)) |
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1028 { |
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1029 mp_msg(MSGT_VO,MSGL_WARN, "[VO_VESA] Can't use double buffering: changing displays failed.\n"); |
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1030 multi_size = 1; |
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1031 } |
2effceebd29c
if double buffering is enabled, but vbeSetDisplayStart() fails, turn double buffering off (also adds support for VESA output under VMware).
ben
parents:
18861
diff
changeset
|
1032 for(i=0;i<multi_size;i++) |
2686 | 1033 { |
1034 win.ptr = dga_buffer = video_base + multi_buff[i]; | |
8652
edfe94b9d578
Juste a trivial patch for vesa output. The screen were cleaned at init
arpi
parents:
8148
diff
changeset
|
1035 clear_screen(); /* Clear screen for stupid BIOSes */ |
17932 | 1036 if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) paintBkGnd(); |
2686 | 1037 } |
2244 | 1038 } |
2686 | 1039 else |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
1040 { |
8652
edfe94b9d578
Juste a trivial patch for vesa output. The screen were cleaned at init
arpi
parents:
8148
diff
changeset
|
1041 clear_screen(); /* Clear screen for stupid BIOSes */ |
17932 | 1042 if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) |
2686 | 1043 { |
1044 int x; | |
1045 x = (video_mode_info.XResolution/video_mode_info.XCharSize)/2-strlen(title)/2; | |
1046 if(x < 0) x = 0; | |
9714 | 1047 paintBkGnd(); |
2686 | 1048 vbeWriteString(x,0,7,title); |
1049 } | |
2633
fe5ab8c660de
Qualitative speedup decoding when video card supports DGA!
nick
parents:
2610
diff
changeset
|
1050 } |
2244 | 1051 return 0; |
1052 } | |
1053 | |
1054 static void | |
1055 uninit(void) | |
1056 { | |
8786
605c85c27e68
Not checking it caused SIGSEV when uninitning after vesa init failed.
filon
parents:
8652
diff
changeset
|
1057 // not inited |
2686 | 1058 vesa_term(); |
17932 | 1059 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1060 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: uninit was called\n"); |
2244 | 1061 } |
1062 | |
1063 | |
1064 static void check_events(void) | |
1065 { | |
17932 | 1066 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1067 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: check_events was called\n"); |
2244 | 1068 /* Nothing to do */ |
1069 } | |
4352 | 1070 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
1071 static int preinit(const char *arg) |
4352 | 1072 { |
4362 | 1073 int pre_init_err = 0; |
8791
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1074 int fd; |
17932 | 1075 if( mp_msg_test(MSGT_VO,MSGL_DBG2) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1076 mp_msg(MSGT_VO,MSGL_DBG2, "vo_vesa: preinit(%s) was called\n",arg); |
17932 | 1077 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1078 mp_msg(MSGT_VO,MSGL_DBG3, "vo_vesa: subdevice %s is being initialized\n",arg); |
4362 | 1079 subdev_flags = 0; |
9958 | 1080 lvo_name = NULL; |
1081 #ifdef CONFIG_VIDIX | |
1082 vidix_name = NULL; | |
1083 #endif | |
4362 | 1084 if(arg) subdev_flags = parseSubDevice(arg); |
1085 if(lvo_name) pre_init_err = vlvo_preinit(lvo_name); | |
1086 #ifdef CONFIG_VIDIX | |
1087 else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa); | |
1088 #endif | |
8791
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1089 // check if we can open /dev/mem (it will be opened later in config(), but if we |
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1090 // detect now that we can't we can exit cleanly) |
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1091 fd = open("/dev/mem", O_RDWR); |
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1092 if (fd < 0) |
668b30187d48
Check if we can open /dev/mem in preinit(), so we can exit cleanly.
filon
parents:
8786
diff
changeset
|
1093 return -1; |
8792 | 1094 else |
1095 close(fd); | |
17932 | 1096 if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) |
18234
a107276371a8
Part 5 and final of otvos attila's oattila AT chello-hu mp_msg changes, with lots of corrections
reynaldo
parents:
17932
diff
changeset
|
1097 mp_msg(MSGT_VO,MSGL_DBG3, "vo_subdevice: initialization returns: %i\n",pre_init_err); |
4362 | 1098 return pre_init_err; |
4352 | 1099 } |
1100 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
1101 static int control(uint32_t request, void *data, ...) |
4352 | 1102 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4572
diff
changeset
|
1103 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4572
diff
changeset
|
1104 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4572
diff
changeset
|
1105 return query_format(*((uint32_t*)data)); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4572
diff
changeset
|
1106 } |
11565
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1107 |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1108 #ifdef CONFIG_VIDIX |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1109 if (vidix_name) { |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1110 switch (request) { |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1111 case VOCTRL_SET_EQUALIZER: |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1112 { |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1113 va_list ap; |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1114 int value; |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1115 |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1116 va_start(ap, data); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1117 value = va_arg(ap, int); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1118 va_end(ap); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1119 |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1120 return vidix_control(request, data, (int *)value); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1121 } |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1122 case VOCTRL_GET_EQUALIZER: |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1123 { |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1124 va_list ap; |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1125 int *value; |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1126 |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1127 va_start(ap, data); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1128 value = va_arg(ap, int*); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1129 va_end(ap); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1130 |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1131 return vidix_control(request, data, value); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1132 } |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1133 } |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1134 return vidix_control(request, data); |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1135 } |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1136 #endif |
0d24c99199e2
Some more vidix crap - vidix equalizer passthrough. Patch by Oleg I. Vdovikin <vdovikin@jscc.ru>
alex
parents:
11216
diff
changeset
|
1137 |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4572
diff
changeset
|
1138 return VO_NOTIMPL; |
4352 | 1139 } |