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