comparison libvo/vo_x11.c @ 10177:9cee07f898f7

swscaler doesn't recognizes support for BGR1/BGR4 too, and so if forced it crashes, without checking the swsContext
author alex
date Fri, 23 May 2003 21:20:12 +0000
parents 69bb88bc869b
children d358fa9a1068
comparison
equal deleted inserted replaced
10176:69bb88bc869b 10177:9cee07f898f7
396 default: draw_alpha_fnc=draw_alpha_null; 396 default: draw_alpha_fnc=draw_alpha_null;
397 } 397 }
398 398
399 /* always allocate swsContext as size could change between frames */ 399 /* always allocate swsContext as size could change between frames */
400 swsContext= sws_getContextFromCmdLine(width, height, in_format, width, height, out_format ); 400 swsContext= sws_getContextFromCmdLine(width, height, in_format, width, height, out_format );
401 if (!swsContext)
402 return -1;
401 403
402 //printf( "X11 bpp: %d color mask: R:%lX G:%lX B:%lX\n",bpp,myximage->red_mask,myximage->green_mask,myximage->blue_mask ); 404 //printf( "X11 bpp: %d color mask: R:%lX G:%lX B:%lX\n",bpp,myximage->red_mask,myximage->green_mask,myximage->blue_mask );
403 405
404 // If we have blue in the lowest bit then obviously RGB 406 // If we have blue in the lowest bit then obviously RGB
405 mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_RGB : MODE_BGR; 407 mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_RGB : MODE_BGR;
563 static uint32_t query_format( uint32_t format ) 565 static uint32_t query_format( uint32_t format )
564 { 566 {
565 mp_msg(MSGT_VO,MSGL_DBG2,"vo_x11: query_format was called: %x (%s)\n",format,vo_format_name(format)); 567 mp_msg(MSGT_VO,MSGL_DBG2,"vo_x11: query_format was called: %x (%s)\n",format,vo_format_name(format));
566 if (IMGFMT_IS_BGR(format)) 568 if (IMGFMT_IS_BGR(format))
567 { 569 {
568 if (IMGFMT_BGR_DEPTH(format) == 8) 570 if (IMGFMT_BGR_DEPTH(format) <= 8)
569 return 0; // TODO 8bpp not yet fully implemented 571 return 0; // TODO 8bpp not yet fully implemented
570 if (IMGFMT_BGR_DEPTH(format) == vo_depthonscreen) 572 if (IMGFMT_BGR_DEPTH(format) == vo_depthonscreen)
571 return 3|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE; 573 return 3|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE;
572 else 574 else
573 return 1|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE; 575 return 1|VFCAP_OSD|VFCAP_SWSCALE|VFCAP_FLIP|VFCAP_ACCEPT_STRIDE;