Mercurial > mplayer.hg
comparison libvo/vo_vesa.c @ 2953:b0cf2b649d3c
Fixed incorretc terminating of lvo stuff and improving of query_format
author | nick |
---|---|
date | Sat, 17 Nov 2001 16:11:48 +0000 |
parents | a4646faefabd |
children | 8cd493fd5db7 |
comparison
equal
deleted
inserted
replaced
2952:91723d82b64f | 2953:b0cf2b649d3c |
---|---|
395 } | 395 } |
396 if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name) __vbeCopyData(data); | 396 if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name) __vbeCopyData(data); |
397 return 0; | 397 return 0; |
398 } | 398 } |
399 | 399 |
400 #define SUBDEV_NODGA 0x00000001UL | |
401 #define SUBDEV_FORCEDGA 0x00000002UL | |
402 static uint32_t parseSubDevice(const char *sd) | |
403 { | |
404 uint32_t flags; | |
405 flags = 0; | |
406 if(strcmp(sd,"nodga") == 0) { flags |= SUBDEV_NODGA; flags &= ~(SUBDEV_FORCEDGA); } | |
407 else | |
408 if(strcmp(sd,"dga") == 0) { flags &= ~(SUBDEV_NODGA); flags |= SUBDEV_FORCEDGA; } | |
409 else | |
410 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */ | |
411 else if(verbose) printf("vo_vesa: Unknown subcommand: %s\n", sd); | |
412 return flags; | |
413 } | |
414 | |
415 | |
400 static uint32_t query_format(uint32_t format) | 416 static uint32_t query_format(uint32_t format) |
401 { | 417 { |
402 uint32_t retval; | 418 uint32_t retval; |
403 if(verbose > 2) | 419 if(verbose > 2) |
404 printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format)); | 420 printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format)); |
405 if(lvo_name) return vlvo_query_info(format); | 421 if(vo_subdevice) parseSubDevice(vo_subdevice); |
422 if(lvo_name) return 1; | |
406 switch(format) | 423 switch(format) |
407 { | 424 { |
408 case IMGFMT_YV12: | 425 case IMGFMT_YV12: |
409 #if 0 /* Should be tested better */ | 426 #if 0 /* Should be tested better */ |
410 case IMGFMT_I420: | 427 case IMGFMT_I420: |
502 printf("vo_vesa: Your have too small size of video memory for this mode:\n" | 519 printf("vo_vesa: Your have too small size of video memory for this mode:\n" |
503 "vo_vesa: Requires: %08lX exists: %08lX\n", screen_size, vsize); | 520 "vo_vesa: Requires: %08lX exists: %08lX\n", screen_size, vsize); |
504 return i; | 521 return i; |
505 } | 522 } |
506 | 523 |
507 #define SUBDEV_NODGA 0x00000001UL | |
508 #define SUBDEV_FORCEDGA 0x00000002UL | |
509 uint32_t parseSubDevice(const char *sd) | |
510 { | |
511 uint32_t flags; | |
512 flags = 0; | |
513 if(strcmp(sd,"nodga") == 0) { flags |= SUBDEV_NODGA; flags &= ~(SUBDEV_FORCEDGA); } | |
514 else | |
515 if(strcmp(sd,"dga") == 0) { flags &= ~(SUBDEV_NODGA); flags |= SUBDEV_FORCEDGA; } | |
516 else | |
517 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */ | |
518 else if(verbose) printf("vo_vesa: Unknown subcommand: %s\n", sd); | |
519 return flags; | |
520 } | |
521 | 524 |
522 /* fullscreen: | 525 /* fullscreen: |
523 * bit 0 (0x01) means fullscreen (-fs) | 526 * bit 0 (0x01) means fullscreen (-fs) |
524 * bit 1 (0x02) means mode switching (-vm) | 527 * bit 1 (0x02) means mode switching (-vm) |
525 * bit 2 (0x04) enables software scaling (-zoom) | 528 * bit 2 (0x04) enables software scaling (-zoom) |
847 if(lvo_name) | 850 if(lvo_name) |
848 { | 851 { |
849 if(vlvo_init(lvo_name,width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0) | 852 if(vlvo_init(lvo_name,width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0) |
850 { | 853 { |
851 printf("vo_vesa: Can't initialize Linux Video Overlay\n"); | 854 printf("vo_vesa: Can't initialize Linux Video Overlay\n"); |
855 lvo_name = NULL; | |
852 vesa_term(); | 856 vesa_term(); |
853 return -1; | 857 return -1; |
854 } | 858 } |
855 else printf("vo_vesa: Using video overlay: %s\n",lvo_name); | 859 else printf("vo_vesa: Using video overlay: %s\n",lvo_name); |
856 } | 860 } |