[Mplayer-cvslog] CVS: main/libvo vo_dga.c,1.6,1.7

Andreas Ackermann acki2 at users.sourceforge.net
Sat Mar 31 01:12:33 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv29578

Modified Files:
	vo_dga.c 
Log Message:
- added double buffering :-)


Index: vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** vo_dga.c	2001/03/30 22:09:38	1.6
--- vo_dga.c	2001/03/30 23:12:31	1.7
***************
*** 30,33 ****
--- 30,38 ----
   *   movies things could be different, but I was too lazy to implement 
   *   it ...
+  * o you may define VO_DGA_FORCE_DEPTH to the depth you desire 
+  *   if you don't like the choice the driver makes
+  *   Beware: unless you can use DGA2.0 this has to be your X Servers
+  *           depth!!!
+  * o Added double buffering :-))
   */
  
***************
*** 43,46 ****
--- 48,52 ----
  #include "yuv2rgb.h"
  
+ //#undef HAVE_DGA2
  
  LIBVO_EXTERN( dga )
***************
*** 68,72 ****
  static int       vo_dga_src_offset=0;    // offset in src
  static int       vo_dga_vp_offset=0;     // offset in dest
! static int       vo_dga_bytes_per_line;  // longwords per line to copy
  static int       vo_dga_src_skip;        // bytes to skip after copying one line 
                                           // (not supported yet) in src
--- 74,78 ----
  static int       vo_dga_src_offset=0;    // offset in src
  static int       vo_dga_vp_offset=0;     // offset in dest
! static int       vo_dga_bytes_per_line;  // bytes per line to copy
  static int       vo_dga_src_skip;        // bytes to skip after copying one line 
                                           // (not supported yet) in src
***************
*** 76,79 ****
--- 82,92 ----
  static int       vo_dga_planes;          // bits per pixel on screen
  
+ static int       vo_dga_dbf_mem_offset;  // offset in bytes for alternative 
+                                          // framebuffer (0 if dbf is not 
+ 					 // possible)
+ static int       vo_dga_dbf_y_offset;    // y offset (in scanlines)
+ static int       
+                  vo_dga_dbf_current;     // current buffer (0 or 1)
+ 
  static unsigned char     *vo_dga_base;
  static Display  *vo_dga_dpy;
***************
*** 117,129 ****
    char *s, *d;
  
!   if( vo_dga_src_format==IMGFMT_YV12 ){
!     // We'll never reach this point, because YV12 codecs always
!     // calls draw_slice
!     printf("vo_dga: draw_frame() doesn't support IMGFMT_YV12 (yet?)\n");
!   }else{
!     s = *src;
!     d = (&((char *)vo_dga_base)[vo_dga_vp_offset]);
!     rep_movsl(d, s, lpl, vo_dga_vp_skip, numlines );
!   }
  
    return 0;
--- 130,136 ----
    char *s, *d;
  
!   s = *src;
!   d = (&((char *)vo_dga_base)[vo_dga_vp_offset + vo_dga_dbf_current * vo_dga_dbf_mem_offset]);
!   rep_movsl(d, s, lpl, vo_dga_vp_skip, numlines );
  
    return 0;
***************
*** 140,143 ****
--- 147,164 ----
  
  static void flip_page( void ){
+ 
+   
+   if(vo_dga_dbf_mem_offset != 0){
+ 
+ #ifdef HAVE_DGA2
+     XDGASetViewport (vo_dga_dpy, XDefaultScreen(vo_dga_dpy), 
+ 		    0, vo_dga_dbf_current * vo_dga_dbf_y_offset, 
+ 		    XDGAFlipRetrace);
+ #else
+     XF86DGASetViewPort (vo_dga_dpy, XDefaultScreen(vo_dga_dpy),
+ 		                        0, vo_dga_dbf_current * vo_dga_dbf_y_offset);
+ #endif
+     vo_dga_dbf_current = 1 - vo_dga_dbf_current;
+   }
    check_events();
  }
***************
*** 227,230 ****
--- 248,255 ----
     }
  #endif
+ #ifdef VO_DGA_FORCE_DEPTH
+    dga_depths = 1<<(VO_DGA_FORCE_DEPTH-1); 
+ #endif
+    
     dga_depths_init = 1;
   
***************
*** 278,335 ****
  
  
- #if 0
-        if (
-           (modelines[i].viewportWidth >= X) && 
-           (modelines[i].viewportHeight >= Y) &&
- 	  ( 
- 	   // prefer a better resolution either in X or in Y
- 	   // as long as the other dimension is at least the same
- 	   // 
- 	   // hmm ... MAYBE it would be more clever to focus on the 
- 	   // x-resolution; I had 712x400 and 640x480 and the movie 
- 	   // was 640x360; 640x480 would be the 'right thing' here
- 	   // but since 712x400 was queried first I got this one. 
- 	   // I think there should be a cmd-line switch to let the
- 	   // user choose the mode he likes ...   (acki2)
- 	   
- 	   (
-             ((modelines[i].viewportWidth < mX) &&
- 	    !(modelines[i].viewportHeight > mY)) ||
- 	    ((modelines[i].viewportHeight < mY) &&
- 	    !(modelines[i].viewportWidth > mX)) 
- 	   ) 
- 	   // but if we get an identical resolution choose
- 	   // the one with the lower refreshrate (saves bandwidth !!!)
- 	   // as long as it's above 50 Hz (acki2 on 30/3/2001)
- 	   ||
- 	   (
- 	    (modelines[i].viewportWidth == mX) &&
- 	    (modelines[i].viewportHeight == mY) &&
- 	      (
- 	       (
- 		modelines[i].verticalRefresh >= mVBI && mVBI < 50
- 	       )  
- 	       ||
-                (
- 		mVBI >= 50 && 
- 		modelines[i].verticalRefresh < mVBI &&
- 		modelines[i].verticalRefresh >= 50
- 	       )
- 	      )
- 	     )
- 	    )
- 	  )  
- 	  {
-            mX=modelines[i].viewportWidth;
-            mY=modelines[i].viewportHeight;
- 	   mVBI = modelines[i].verticalRefresh;
-            j=i;
- 	   printf(".ok!!\n");
-         }else{
-            printf(".no\n");
- 	}
- #endif
- 
- 
  //----------------------------------------------------------
  
--- 303,306 ----
***************
*** 578,585 ****
                  ButtonPressMask,GrabModeAsync, GrabModeAsync, 
                  None, None, CurrentTime);
!    
    // now clear screen
  
!   memset(vo_dga_base, 0, vo_dga_width * vo_dga_vp_height * vo_dga_bpp);  
  
    vo_dga_is_running = 1;
--- 549,570 ----
                  ButtonPressMask,GrabModeAsync, GrabModeAsync, 
                  None, None, CurrentTime);
!   
! // TODO: chekc if mem of graphics adaptor is large enough for dbf
! 
!   
!   // set up variables for double buffering ...
!   
!   vo_dga_dbf_y_offset = y_off + vo_dga_src_height;
!   vo_dga_dbf_mem_offset = vo_dga_width * vo_dga_bpp *  vo_dga_dbf_y_offset;
!   vo_dga_dbf_current = 0;
!   
!   if(format ==IMGFMT_YV12 )vo_dga_dbf_mem_offset = 0;
!   // disable doublebuffering for YV12
!   
    // now clear screen
  
!   memset(vo_dga_base, 0, vo_dga_width *  
! 	 (vo_dga_vp_height + (vo_dga_dbf_mem_offset != 0 ? (vo_dga_src_height+y_off) : 0)) * 
!          vo_dga_bpp);  
  
    vo_dga_is_running = 1;


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list