0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8138 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-11-10 13:57:42 +00:00
parent b39016d60f
commit d48e57b659
2 changed files with 59 additions and 4 deletions

View File

@ -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
@ -236,6 +241,11 @@ static config_t mplayer_opts[]={
#ifdef HAVE_DIRECTFB
{"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)

View File

@ -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;
}
};