[Mplayer-cvslog] CVS: main/libvo vo_directfb2.c,1.3,1.4

Arpi of Ize arpi at mplayerhq.hu
Sun Nov 10 14:57:45 CET 2002


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

Modified Files:
	vo_directfb2.c 
Log Message:
Switch containing options for DirectFB library was renamed to dfbopts.
Layer selection is done as "subdevice" - integer nuber after -vo
directfb: where -1 is autodetection and 0,1,2... are for layers
example: mplayer -vo directfb:2 -dfbopts matrox-crtc2,matrox-tv-standard=pal *.avi


Index: vo_directfb2.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_directfb2.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vo_directfb2.c	4 Sep 2002 21:53:38 -0000	1.3
+++ vo_directfb2.c	10 Nov 2002 13:57:42 -0000	1.4
@@ -38,7 +38,11 @@
 
 #include <sys/mman.h>
 #include <sys/ioctl.h>
+#ifdef __linux__
 #include <sys/kd.h>
+#else
+#include <linux/kd.h>
+#endif
 
 #include "config.h"
 #include "video_out.h"
@@ -59,7 +63,7 @@
 	"Direct Framebuffer Device",
 	"directfb",
 	"Jiri Svoboda Jiri.Svoboda at seznam.cz",
-	"version 2.0beta"
+	"v 2.0 (for DirectFB version >=0.9.13)"
 };
 
 extern int verbose;
@@ -130,6 +134,8 @@
 #else
 char *fb_dev_name;
 #endif
+char *dfb_params;
+int layer_id = -1;
 
 /******************************
 *	   implementation     *
@@ -148,7 +154,36 @@
 	
 if (verbose) printf("DirectFB: Preinit entered\n");
 
+	if (arg) {
+	    int tmp=-1;
+	    if (sscanf(arg,"%i",&tmp)) {
+		layer_id=tmp;
+		if (verbose) printf("DirectFB: Layer id forced to %i\n",layer_id);
+	    };
+	}
+
+	if (dfb_params)
+	{
+	    int argc = 2;
+	    char arg0[10] = "mplayer";
+	    char arg1[256] = "--dfb:";
+	    char* argv[3];
+	    char ** a;
+	    
+	    a = &argv[0];
+	    
+	    strncat(arg1,dfb_params,249);
+
+	    argv[0]=arg0;
+	    argv[1]=arg1;
+	    argv[2]=NULL;
+	    
+    	    DFBCHECK (DirectFBInit (&argc,&a));
+
+	} else {
+	
         DFBCHECK (DirectFBInit (NULL,NULL));
+	}
 
 	if (((directfb_major_version <= 0) &&
 	    (directfb_minor_version <= 9) &&
@@ -182,7 +217,9 @@
    */
 
         DFBCHECK (DirectFBCreate (&dfb));
-        DFBCHECK (dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN));
+        if (DFB_OK != dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)) {
+	    printf("DirectFB: Warning - cannot swith to fullscreen mode");
+	};
 
   /*
    * (Get keyboard)
@@ -255,6 +292,8 @@
      IDirectFBDisplayLayer *layer;
      DFBResult ret;
     
+     if ((layer_id == -1 )||(layer_id == id)) {
+    
      ret = dfb->GetDisplayLayer( dfb, id, &layer);
      if (ret) {
                DirectFBError( "dfb->GetDisplayLayer failed", ret );
@@ -298,6 +337,8 @@
 	};
      };
 
+    };
+    
     return DFENUM_OK;
 }
 
@@ -539,12 +580,16 @@
 
 // test surface for flipping	
 	DFBCHECK(primary->GetCapabilities(primary,&caps));
-//	primary->Clear(primary,0,0,0,0);
+#if DIRECTFBVERSION > 913
+	primary->Clear(primary,0,0,0,0);
+#endif	
         flipping = 0;
 	if (caps & DSCAPS_FLIPPING) {
 	    ret = primary->Flip(primary,NULL,0);
 	    if (ret==DFB_OK) { 
-//		primary->Clear(primary,0,0,0,0);
+#if DIRECTFBVERSION > 913
+		primary->Clear(primary,0,0,0,0);
+#endif	
 		flipping = 1; 
 	    } 
 	};




More information about the MPlayer-cvslog mailing list