comparison libvo/vo_vesa.c @ 2304:0769b2fb3ce2

Fixed zooming bug
author nick
date Sat, 20 Oct 2001 11:58:45 +0000
parents 674acdf0aa43
children 82c17b134946
comparison
equal deleted inserted replaced
2303:456e22bfb147 2304:0769b2fb3ce2
383 case IMGFMT_BGR32: 383 case IMGFMT_BGR32:
384 case IMGFMT_RGB32: bpp = 32; break; 384 case IMGFMT_RGB32: bpp = 32; break;
385 } 385 }
386 if(verbose) 386 if(verbose)
387 { 387 {
388 printf("vo_vesa: Requested mode: %ux%u@%x bpp=%u\n",width,height,format,bpp); 388 printf("vo_vesa: Requested mode: %ux%u@%u (%s)\n",width,height,bpp,vo_format_name(format));
389 printf("vo_vesa: Total modes found: %u\n",num_modes); 389 printf("vo_vesa: Total modes found: %u\n",num_modes);
390 mode_ptr = vib.VideoModePtr; 390 mode_ptr = vib.VideoModePtr;
391 printf("vo_vesa: Mode list:"); 391 printf("vo_vesa: Mode list:");
392 for(i = 0;i < num_modes;i++) 392 for(i = 0;i < num_modes;i++)
393 { 393 {
452 if(!(yuv_buffer = malloc(video_mode_info.XResolution*video_mode_info.YResolution*4))) 452 if(!(yuv_buffer = malloc(video_mode_info.XResolution*video_mode_info.YResolution*4)))
453 { 453 {
454 printf("vo_vesa: Can't allocate temporary buffer\n"); 454 printf("vo_vesa: Can't allocate temporary buffer\n");
455 return -1; 455 return -1;
456 } 456 }
457 if( vesa_zoom && format==IMGFMT_YV12 ) 457 if( vesa_zoom )
458 { 458 {
459 /* software scale */ 459 if( format==IMGFMT_YV12 )
460 image_width = video_mode_info.XResolution; 460 {
461 image_height = video_mode_info.YResolution; 461 /* software scale */
462 scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */ 462 image_width = video_mode_info.XResolution;
463 scale_yinc=(height << 16) / image_height + 2; 463 image_height = video_mode_info.YResolution;
464 SwScale_Init(); 464 scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */
465 if(verbose) printf("vo_vesa: Using SCALE\n"); 465 scale_yinc=(height << 16) / image_height + 2;
466 } 466 SwScale_Init();
467 else 467 if(verbose) printf("vo_vesa: Using SCALE\n");
468 { 468 }
469 printf("vo_vesa: Can't apply zooming to non YV12 formats\n"); 469 else
470 return -1; 470 {
471 printf("vo_vesa: Can't apply zooming to non YV12 formats\n");
472 return -1;
473 }
471 } 474 }
472 if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE) 475 if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE)
473 win.idx = 0; /* frame A */ 476 win.idx = 0; /* frame A */
474 else 477 else
475 if((video_mode_info.WinBAttributes & FRAME_MODE) == FRAME_MODE) 478 if((video_mode_info.WinBAttributes & FRAME_MODE) == FRAME_MODE)