[Mplayer-cvslog] CVS: main/libvo vo_x11.c,1.55,1.56

Michael Niedermayer michael at mplayer.dev.hu
Sun Feb 3 15:41:33 CET 2002


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

Modified Files:
	vo_x11.c 
Log Message:
YUY2 BGR32 BGR24 support for vo_x11 if swScaler is used


Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- vo_x11.c	31 Jan 2002 11:56:11 -0000	1.55
+++ vo_x11.c	3 Feb 2002 14:41:31 -0000	1.56
@@ -132,6 +132,9 @@
 static SwsContext *swsContext=NULL;
 static int useSws=0; 
 extern int sws_flags;
+/*needed so we can output the correct supported formats in query_format()
+  should perhaps be passed as argument to query_format() */
+extern int softzoom; 
 
 static XVisualInfo vinfo;
 
@@ -274,7 +277,8 @@
  if ( depth != 15 && depth != 16 && depth != 24 && depth != 32 ) depth=24;
  XMatchVisualInfo( mDisplay,mScreen,depth,TrueColor,&vinfo );
 
- if( flags&0x04 && (format==IMGFMT_YV12 || format==IMGFMT_I420 || format==IMGFMT_IYUV)) {
+ if( flags&0x04 && (   format==IMGFMT_YV12 || format==IMGFMT_I420  || format==IMGFMT_IYUV 
+                    || format==IMGFMT_YUY2 || format==IMGFMT_BGR24 || format==IMGFMT_BGR32)) {
      // software scale
      if(fullscreen){
          image_width=vo_screenwidth;
@@ -508,6 +512,16 @@
     char *s=src[0];
     //printf( "sbpp=%d  dbpp=%d  depth=%d  bpp=%d\n",sbpp,dbpp,depth,bpp );
 
+    if(swsContext)
+    {
+      int stride[3]= {0,0,0};
+      if     (swsContext->srcFormat==IMGFMT_YUY2)  stride[0]=swsContext->srcW*2;
+      else if(swsContext->srcFormat==IMGFMT_BGR24) stride[0]=swsContext->srcW*3;
+      else if(swsContext->srcFormat==IMGFMT_BGR32) stride[0]=swsContext->srcW*4;
+      
+      return draw_slice(src, stride, swsContext->srcW, swsContext->srcH, 0, 0);
+    }
+    
   if( Flip_Flag ){
     // flipped BGR
     int i;
@@ -572,6 +586,11 @@
 
  switch( format )
   {
+   case IMGFMT_BGR24:
+   case IMGFMT_BGR32:
+   case IMGFMT_YUY2: 
+   	if(softzoom) return 1;
+	else	     return 0;
    case IMGFMT_I420:
    case IMGFMT_IYUV:
    case IMGFMT_YV12: return 1;




More information about the MPlayer-cvslog mailing list