Mercurial > mplayer.hg
comparison libvo/vo_vesa.c @ 2335:26fdd1a317ad
Again changed logic:
-screenw, -screenh - force user video mode
-x, -y - force userdefined prescaling
-zoom - activates prescaling
-fs - scales prescaling to fullscreen
(meaningless with -zoom)
So full command line should be:
mplayer -vo vesa -screenw WWW -screenh HHH -bpp BPP -x XXX -y YYY -zoom -fs filename
And you will be able to watch movies in 16:9 format with bold black
border at top and bottom of screen.
author | nick |
---|---|
date | Sun, 21 Oct 2001 14:02:09 +0000 |
parents | d9ba4de305cf |
children | b2e0b131c1a7 |
comparison
equal
deleted
inserted
replaced
2334:a70571f46bd2 | 2335:26fdd1a317ad |
---|---|
341 | 341 |
342 /* fullscreen: | 342 /* fullscreen: |
343 * bit 0 (0x01) means fullscreen (-fs) | 343 * bit 0 (0x01) means fullscreen (-fs) |
344 * bit 1 (0x02) means mode switching (-vm) | 344 * bit 1 (0x02) means mode switching (-vm) |
345 * bit 2 (0x04) enables software scaling (-zoom) | 345 * bit 2 (0x04) enables software scaling (-zoom) |
346 * bit 3 (0x08) enables flipping (-flip) | 346 * bit 3 (0x08) enables flipping (-flip) (NK: and for what?) |
347 */ | 347 */ |
348 static uint32_t | 348 static uint32_t |
349 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) | 349 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
350 { | 350 { |
351 struct VbeInfoBlock vib; | 351 struct VbeInfoBlock vib; |
360 if(flags & 0x8) | 360 if(flags & 0x8) |
361 { | 361 { |
362 printf("vo_vesa: switch -flip is not supported\n"); | 362 printf("vo_vesa: switch -flip is not supported\n"); |
363 } | 363 } |
364 if(flags & 0x04) vesa_zoom = 1; | 364 if(flags & 0x04) vesa_zoom = 1; |
365 if(flags & 0x01) vesa_zoom = 2; | 365 if(flags & 0x01 && vesa_zoom) vesa_zoom = 2; |
366 if((err=vbeInit()) != VBE_OK) { PRINT_VBE_ERR("vbeInit",err); return -1; } | 366 if((err=vbeInit()) != VBE_OK) { PRINT_VBE_ERR("vbeInit",err); return -1; } |
367 memcpy(vib.VESASignature,"VBE2",4); | 367 memcpy(vib.VESASignature,"VBE2",4); |
368 if((err=vbeGetControllerInfo(&vib)) != VBE_OK) | 368 if((err=vbeGetControllerInfo(&vib)) != VBE_OK) |
369 { | 369 { |
370 PRINT_VBE_ERR("vbeGetControllerInfo",err); | 370 PRINT_VBE_ERR("vbeGetControllerInfo",err); |
432 printf(" %04X",mode_ptr[i]); | 432 printf(" %04X",mode_ptr[i]); |
433 } | 433 } |
434 printf("\nvo_vesa: Modes in detail:\n"); | 434 printf("\nvo_vesa: Modes in detail:\n"); |
435 } | 435 } |
436 mode_ptr = vib.VideoModePtr; | 436 mode_ptr = vib.VideoModePtr; |
437 w = vo_screenwidth ? vo_screenwidth : width; | 437 if(vesa_zoom) |
438 h = vo_screenheight ? vo_screenheight : height; | 438 { |
439 image_width = d_width; | |
440 image_height= d_height; | |
441 } | |
442 if(vo_screenwidth) w = vo_screenwidth; | |
443 else w = max(image_width,width); | |
444 if(vo_screenheight) h = vo_screenheight; | |
445 else h = max(image_height,height); | |
439 for(i=0;i < num_modes;i++) | 446 for(i=0;i < num_modes;i++) |
440 { | 447 { |
441 if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK) | 448 if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK) |
442 { | 449 { |
443 PRINT_VBE_ERR("vbeGetModeInfo",err); | 450 PRINT_VBE_ERR("vbeGetModeInfo",err); |
495 { | 502 { |
496 if( format==IMGFMT_YV12 ) | 503 if( format==IMGFMT_YV12 ) |
497 { | 504 { |
498 /* software scale */ | 505 /* software scale */ |
499 if(vesa_zoom > 1) | 506 if(vesa_zoom > 1) |
500 { | 507 vesa_aspect(image_width,image_height, |
501 image_width = video_mode_info.XResolution; | |
502 image_height = video_mode_info.YResolution; | |
503 } | |
504 else | |
505 vesa_aspect(width,height, | |
506 video_mode_info.XResolution,video_mode_info.YResolution, | 508 video_mode_info.XResolution,video_mode_info.YResolution, |
507 &image_width,&image_height); | 509 &image_width,&image_height); |
510 /* image_width = video_mode_info.XResolution; | |
511 image_height = video_mode_info.YResolution;*/ | |
508 scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */ | 512 scale_xinc=(width << 16) / image_width - 2; /* needed for proper rounding */ |
509 scale_yinc=(height << 16) / image_height + 2; | 513 scale_yinc=(height << 16) / image_height + 2; |
510 SwScale_Init(); | 514 SwScale_Init(); |
511 if(verbose) printf("vo_vesa: Using SCALE\n"); | 515 if(verbose) printf("vo_vesa: Using SCALE\n"); |
512 } | 516 } |
551 if((err=vbeSaveState(&init_state)) != VBE_OK) | 555 if((err=vbeSaveState(&init_state)) != VBE_OK) |
552 { | 556 { |
553 PRINT_VBE_ERR("vbeSaveState",err); | 557 PRINT_VBE_ERR("vbeSaveState",err); |
554 return -1; | 558 return -1; |
555 } | 559 } |
560 /* Below 'return -1' is impossible */ | |
556 if((err=vbeSetMode(video_mode,NULL)) != VBE_OK) | 561 if((err=vbeSetMode(video_mode,NULL)) != VBE_OK) |
557 { | 562 { |
558 PRINT_VBE_ERR("vbeSetMode",err); | 563 PRINT_VBE_ERR("vbeSetMode",err); |
559 return -1; | 564 return -1; |
560 } | 565 } |