[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.48,1.49

Alex Beregszaszi alex at mplayer.dev.hu
Thu Jan 24 19:14:01 CET 2002


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv11157

Modified Files:
	vo_x11.c 
Log Message:
added support for i420 and iyuv

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- vo_x11.c	23 Jan 2002 15:16:20 -0000	1.48
+++ vo_x11.c	24 Jan 2002 18:13:54 -0000	1.49
@@ -170,7 +170,7 @@
  if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24;
  XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
 
- if( flags&0x04 && format==IMGFMT_YV12 ) {
+ if( flags&0x04 && (format==IMGFMT_YV12 || format==IMGFMT_I420 || format==IMGFMT_IYUV)) {
      // software scale
      if(fullscreen){
          image_width=vo_screenwidth;
@@ -424,7 +424,8 @@
 //   return -1;
   }
 
- if( format==IMGFMT_YV12 ) yuv2rgb_init( ( depth == 24 ) ? bpp : depth,mode );
+ if((format == IMGFMT_YV12) || (format == IMGFMT_I420) || (format == IMGFMT_IYUV))
+    yuv2rgb_init( ( depth == 24 ) ? bpp : depth,mode );
   
 #ifdef HAVE_NEW_GUI  
  if ( vo_window == None ) 
@@ -486,10 +487,19 @@
 
 static uint32_t draw_slice( uint8_t *src[],int stride[],int w,int h,int x,int y )
 {
-
+ /* hack: swap planes for I420 ;) -- alex */
+ if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420))
+ {
+    uint8_t *src_i420[3];
+    
+    src_i420[0] = src[0];
+    src_i420[1] = src[2];
+    src_i420[2] = src[1];
+    src = src_i420;
+ }
 if(scale_srcW){
  uint8_t *dst[3] = {ImageData, NULL, NULL};
- SwScale_YV12slice(src,stride,y,h,
+    SwScale_YV12slice(src,stride,y,h,
                          dst, image_width*((bpp+7)/8), ( depth == 24 ) ? bpp : depth,
 			 scale_srcW, scale_srcH, image_width, image_height);
 } else {
@@ -570,6 +580,8 @@
 
  switch( format )
   {
+   case IMGFMT_I420:
+   case IMGFMT_IYUV:
    case IMGFMT_YV12: return 1;
   }
  return 0;




More information about the MPlayer-cvslog mailing list