comparison libvo/vo_svga.c @ 9658:0e6d7f48309e

fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
author iive
date Sat, 22 Mar 2003 23:54:26 +0000
parents 3ef467aac4a1
children 7abbd3ee1057
comparison
equal deleted inserted replaced
9657:4916d09a52a7 9658:0e6d7f48309e
13 and i don't have any of them. If it works for you then let me know. 13 and i don't have any of them. If it works for you then let me know.
14 I will remove this warning after confirm its status. 14 I will remove this warning after confirm its status.
15 - retrace sync works only in doublebuffer mode. 15 - retrace sync works only in doublebuffer mode.
16 - the retrace sync may slow down decoding a lot - mplayer is blocked while 16 - the retrace sync may slow down decoding a lot - mplayer is blocked while
17 waiting for retrace 17 waiting for retrace
18 - denoice3d fails to find common colorspace, vf_scale doesn't help - I work on it. 18 - denoise3d fails to find common colorspace, vf_scale doesn't help - It is
19 mplayer bug.
19 20
20 TODO: 21 TODO:
21 - OSD without flicker (w/h & w/o double buffer)
22 - let choose_best_mode take aspect into account 22 - let choose_best_mode take aspect into account
23 - set palette from mpi->palette or mpi->plane[1] 23 - set palette from mpi->palette or mpi->plane[1]
24 - let OSD draw in black bars - need some OSD changes 24 - let OSD draw in black bars - need some OSD changes
25 - Make nicer CONFIG parsing 25 - Make nicer CONFIG parsing
26 - change video mode logical width to match img->stride[0] - for HW only 26 - change video mode logical width to match img->stride[0] - for HW only
359 int bestmode,lastmode; 359 int bestmode,lastmode;
360 int i; 360 int i;
361 vga_modeinfo *vminfo; 361 vga_modeinfo *vminfo;
362 //int best aspect mode // best linear mode // best normal mode (no modeX) 362 //int best aspect mode // best linear mode // best normal mode (no modeX)
363 363
364 prev_badness = req_w * req_h; 364 prev_badness = 0;//take care of special case below
365 bestmode = 0; //0 is the TEXT mode 365 bestmode = 0; //0 is the TEXT mode
366 lastmode = vga_lastmodenumber(); 366 lastmode = vga_lastmodenumber();
367 for(i=1;i<lastmode;i++){ 367 for(i=1;i<lastmode;i++){
368 vminfo = vga_getmodeinfo(i); 368 vminfo = vga_getmodeinfo(i);
369 if( vminfo == NULL ) continue; 369 if( vminfo == NULL ) continue;
373 badness=(vminfo->width * vminfo->height) - (req_h * req_w); 373 badness=(vminfo->width * vminfo->height) - (req_h * req_w);
374 //put here aspect calculations 374 //put here aspect calculations
375 if(squarepix) 375 if(squarepix)
376 if( vminfo->width*3 != vminfo->height*4 ) continue; 376 if( vminfo->width*3 != vminfo->height*4 ) continue;
377 377
378 if( prev_badness >= badness ){//modeX etc... 378 if( bestmode==0 || prev_badness >= badness ){//modeX etc...
379 prev_badness=badness; 379 prev_badness=badness;
380 bestmode=i; 380 bestmode=i;
381 if(verbose>3) 381 if(verbose>3)
382 printf("vo_svga: found good mode %d with badness %d\n",i,badness); 382 printf("vo_svga: found good mode %d with badness %d\n",i,badness);
383 } 383 }
495 mode_capabilities|=CAP_LINEAR; 495 mode_capabilities|=CAP_LINEAR;
496 } 496 }
497 } 497 }
498 } 498 }
499 }//fi force native 499 }//fi force native
500 if(mode_capabilities&CAP_LINEAR){
501 printf("vo_svga: video mode is linear and memcpy could be used for image transfer\n");
502 }
503 if(mode_capabilities&CAP_ACCEL_PUTIMAGE){
504 printf("vo_svga: video mode have hardware acceleration and put_image could be used\n");
505 printf("vo_svga: If it works for you i would like to know \nvo_svga: (send log with `mplayer test.avi -v -v -v -v &> svga.log`). Thx\n");
506 }
500 507
501 //here is the place to handle strides for accel_ modes; 508 //here is the place to handle strides for accel_ modes;
502 mode_stride=modeinfo->linewidth; 509 mode_stride=modeinfo->linewidth;
503 //we may try to set a bigger stride for video mode that will match the mpi->stride, 510 //we may try to set a bigger stride for video mode that will match the mpi->stride,
504 //this way we will transfer more data, but HW put_image can do it in backgraund! 511 //this way we will transfer more data, but HW put_image can do it in backgraund!
659 x0+=x_pos;// in case of drawing over image 666 x0+=x_pos;// in case of drawing over image
660 y0+=y_pos; 667 y0+=y_pos;
661 668
662 //only modes with bytesperpixel>0 can draw OSD 669 //only modes with bytesperpixel>0 can draw OSD
663 if(modeinfo->bytesperpixel==0) return; 670 if(modeinfo->bytesperpixel==0) return;
664 // if(!(mode_capabilities&CAP_LINEAR)) return;//force_native will remove OSD 671 if(!(mode_capabilities&CAP_LINEAR)) return;//force_native will remove OSD
665 672 if(verbose>3)
673 printf("vo_svga: OSD draw in page %d",cpage);
666 base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel; 674 base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel;
667 bytelen = modeinfo->width * modeinfo->bytesperpixel; 675 bytelen = modeinfo->width * modeinfo->bytesperpixel;
668 switch (mode_bpp) { 676 switch (mode_bpp) {
669 case 32: 677 case 32:
670 vo_draw_alpha_rgb32(w, h, src, srca, stride, base, bytelen); 678 vo_draw_alpha_rgb32(w, h, src, srca, stride, base, bytelen);