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