summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cfg-mplayer.h10
-rw-r--r--libvo/vo_directfb2.c53
2 files changed, 59 insertions, 4 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 8f6242c753..60d18cdd22 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -21,6 +21,11 @@ extern char *fb_mode_name;
extern char *fb_dev_name;
#endif
#endif
+#ifdef HAVE_DIRECTFB
+#if DIRECTFBVERSION > 912
+extern char *dfb_params;
+#endif
+#endif
#ifdef HAVE_PNG
extern int z_compression;
#endif
@@ -237,6 +242,11 @@ static config_t mplayer_opts[]={
{"fb", &fb_dev_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
#endif
+#ifdef HAVE_DIRECTFB
+#if DIRECTFBVERSION > 912
+ {"dfbopts", &dfb_params, CONF_TYPE_STRING, 0, 0, 0, NULL},
+#endif
+#endif
// force window width/height or resolution (with -vm)
{"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL},
diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c
index e0375078c9..380e69fa51 100644
--- a/libvo/vo_directfb2.c
+++ b/libvo/vo_directfb2.c
@@ -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 @@ static vo_info_t vo_info = {
"Direct Framebuffer Device",
"directfb",
"Jiri Svoboda Jiri.Svoboda@seznam.cz",
- "version 2.0beta"
+ "v 2.0 (for DirectFB version >=0.9.13)"
};
extern int verbose;
@@ -130,6 +134,8 @@ extern char *fb_dev_name;
#else
char *fb_dev_name;
#endif
+char *dfb_params;
+int layer_id = -1;
/******************************
* implementation *
@@ -148,7 +154,36 @@ DFBResult ret;
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 @@ if (verbose) printf("DirectFB: Preinit entered\n");
*/
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 @@ DFBEnumerationResult test_format_callback( unsigned int id,
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 @@ DFBEnumerationResult test_format_callback( unsigned int id,
};
};
+ };
+
return DFENUM_OK;
}
@@ -539,12 +580,16 @@ static uint32_t config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
// 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;
}
};