comparison libvo/vo_x11.c @ 2234:36fa77e785d4

swscale - 16bpp and -fs support
author arpi
date Wed, 17 Oct 2001 10:54:34 +0000
parents d9ea650b2c24
children 9ee34c6950e0
comparison
equal deleted inserted replaced
2233:5d8a0bc932c4 2234:36fa77e785d4
170 depth=attribs.depth; 170 depth=attribs.depth;
171 171
172 if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24; 172 if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24;
173 XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo ); 173 XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
174 174
175 if( flags&0x04 && depth>=24 && format==IMGFMT_YV12 ) { 175 if( flags&0x04 && format==IMGFMT_YV12 ) {
176 // software scale 176 // software scale
177 scale_xinc=(width << 8) / d_width - 1; // -1 needed for proper rounding 177 if(fullscreen){
178 scale_yinc=(height << 16) / d_height; 178 image_width=vo_screenwidth;
179 image_width=d_width; 179 image_height=vo_screenheight;
180 image_height=d_height; 180 } else {
181 image_width=d_width&(~3);
182 image_height=d_height;
183 }
184 scale_xinc=(width << 8) / image_width - 1; // -1 needed for proper rounding
185 scale_yinc=(height << 16) / image_height;
181 SwScale_Init(); 186 SwScale_Init();
182 } 187 }
183 188
184 #ifdef HAVE_NEW_GUI 189 #ifdef HAVE_NEW_GUI
185 if ( vo_window != None ) { mywindow=vo_window; mygc=vo_gc; } 190 if ( vo_window != None ) { mywindow=vo_window; mygc=vo_gc; }
478 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y ) 483 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
479 { 484 {
480 485
481 if(scale_xinc){ 486 if(scale_xinc){
482 SwScale_YV12slice_brg24(src,stride,y,h, 487 SwScale_YV12slice_brg24(src,stride,y,h,
483 ImageData, image_width*((bpp+7)/8), image_width, ((bpp+7)/8), 488 ImageData, image_width*((bpp+7)/8), image_width, bpp,
484 scale_xinc, scale_yinc); 489 scale_xinc, scale_yinc);
485 } else { 490 } else {
486 uint8_t *dst=ImageData + ( image_width * y + x ) * ( bpp/8 ); 491 uint8_t *dst=ImageData + ( image_width * y + x ) * ( bpp/8 );
487 yuv2rgb( dst,src[0],src[1],src[2],w,h,image_width*( bpp/8 ),stride[0],stride[1] ); 492 yuv2rgb( dst,src[0],src[1],src[2],w,h,image_width*( bpp/8 ),stride[0],stride[1] );
488 } 493 }