comparison libvo/vo_vesa.c @ 2971:56faed773768

Added preinit of lvo stuff
author nick
date Sun, 18 Nov 2001 15:06:32 +0000
parents 8cd493fd5db7
children e9b18714e3dc
comparison
equal deleted inserted replaced
2970:4ecb26be6657 2971:56faed773768
96 uint8_t multi_size=0; /* total number of buffers */ 96 uint8_t multi_size=0; /* total number of buffers */
97 uint8_t multi_idx=0; /* active buffer */ 97 uint8_t multi_idx=0; /* active buffer */
98 98
99 /* Linux Video Overlay */ 99 /* Linux Video Overlay */
100 static const char *lvo_name = NULL; 100 static const char *lvo_name = NULL;
101 static int pre_init_err = 0;
101 102
102 #define HAS_DGA() (win.idx == -1) 103 #define HAS_DGA() (win.idx == -1)
103 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS) 104 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS)
104 #define FRAME_MODE (MODE_WIN_RELOCATABLE | MODE_WIN_WRITEABLE) 105 #define FRAME_MODE (MODE_WIN_RELOCATABLE | MODE_WIN_WRITEABLE)
105 106
410 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */ 411 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */
411 else { printf("vo_vesa: Unknown subdevice: %s\n", sd); return -1; } 412 else { printf("vo_vesa: Unknown subdevice: %s\n", sd); return -1; }
412 return flags; 413 return flags;
413 } 414 }
414 415
415
416 static uint32_t query_format(uint32_t format) 416 static uint32_t query_format(uint32_t format)
417 { 417 {
418 static int first = 1;
418 uint32_t retval; 419 uint32_t retval;
419 if(verbose > 2) 420 if(verbose > 2)
420 printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format)); 421 printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
421 if(vo_subdevice) parseSubDevice(vo_subdevice); 422 if(first)
422 if(lvo_name) return 1; 423 {
424 if(verbose > 2)
425 printf("vo_vesa: subdevice %s have been initialized\n",vo_subdevice);
426 if(vo_subdevice) parseSubDevice(vo_subdevice);
427 if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
428 if(verbose > 2)
429 printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
430 first = 0;
431 }
432 if(!pre_init_err && lvo_name) return vlvo_query_info(format);
423 switch(format) 433 switch(format)
424 { 434 {
425 case IMGFMT_YV12: 435 case IMGFMT_YV12:
426 #if 0 /* Should be tested better */ 436 #if 0 /* Should be tested better */
427 case IMGFMT_I420: 437 case IMGFMT_I420:
541 image_width = width; 551 image_width = width;
542 image_height = height; 552 image_height = height;
543 fs_mode = 0; 553 fs_mode = 0;
544 rgb2rgb_fnc = NULL; 554 rgb2rgb_fnc = NULL;
545 sd_flags = 0; 555 sd_flags = 0;
556 if(pre_init_err)
557 {
558 printf("vo_vesa: initialization have been terminated due wrong preinitialization\n");
559 return -1;
560 }
546 if(vo_subdevice) sd_flags = parseSubDevice(vo_subdevice); 561 if(vo_subdevice) sd_flags = parseSubDevice(vo_subdevice);
547 if(sd_flags == -1) return -1; 562 if(sd_flags == -1) return -1;
548 if(flags & 0x8) 563 if(flags & 0x8)
549 { 564 {
550 printf("vo_vesa: switch -flip is not supported\n"); 565 printf("vo_vesa: switch -flip is not supported\n");
848 printf("vo_vesa: Graphics mode was activated\n"); 863 printf("vo_vesa: Graphics mode was activated\n");
849 fflush(stdout); 864 fflush(stdout);
850 } 865 }
851 if(lvo_name) 866 if(lvo_name)
852 { 867 {
853 if(vlvo_init(lvo_name,width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0) 868 if(vlvo_init(width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
854 { 869 {
855 printf("vo_vesa: Can't initialize Linux Video Overlay\n"); 870 printf("vo_vesa: Can't initialize Linux Video Overlay\n");
856 lvo_name = NULL; 871 lvo_name = NULL;
857 vesa_term(); 872 vesa_term();
858 return -1; 873 return -1;