aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar syrjala <syrjala@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-08 22:16:38 +0000
committerGravatar syrjala <syrjala@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-08 22:16:38 +0000
commit8db718fbf80845fa0fee3fe547d93f3394944743 (patch)
tree455035ad1e2103acc2bb31ae480f147f61a70ebc /libvo
parent348ea88925e18cb0de79d52107e56fa98c481ca2 (diff)
Fix DirectFB version check. The old code simply concatenated the
digits, so 1.0.0 was considered older than 0.9.XY. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20118 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_dfbmga.c32
-rw-r--r--libvo/vo_directfb2.c24
2 files changed, 30 insertions, 26 deletions
diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c
index e339bda564..1c8f1fa76e 100644
--- a/libvo/vo_dfbmga.c
+++ b/libvo/vo_dfbmga.c
@@ -25,6 +25,8 @@
/* directfb includes */
#include <directfb.h>
+#define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
+
/* other things */
#include <stdio.h>
#include <stdlib.h>
@@ -108,13 +110,13 @@ static int is_g200;
* vo_dfbmga *
******************************/
-#if DIRECTFBVERSION < 918
+#if DIRECTFBVERSION < DFB_VERSION(0,9,18)
#define DSPF_ALUT44 DSPF_LUT8
#define DLBM_TRIPLE ~0
#define DSFLIP_ONSYNC 0
#endif
-#if DIRECTFBVERSION < 916
+#if DIRECTFBVERSION < DFB_VERSION(0,9,16)
#define DSPF_ARGB1555 DSPF_RGB15
#endif
@@ -149,7 +151,7 @@ pixelformat_name( DFBSurfacePixelFormat format )
return "I420";
case DSPF_ALUT44:
return "ALUT44";
-#if DIRECTFBVERSION > 921
+#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
case DSPF_NV12:
return "NV12";
case DSPF_NV21:
@@ -181,7 +183,7 @@ imgfmt_to_pixelformat( uint32_t format )
case IMGFMT_I420:
case IMGFMT_IYUV:
return DSPF_I420;
-#if DIRECTFBVERSION > 921
+#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
case IMGFMT_NV12:
return DSPF_NV12;
case IMGFMT_NV21:
@@ -206,7 +208,7 @@ get_layer_by_name( DFBDisplayLayerID id,
{
struct layer_enum *l = (struct layer_enum *) data;
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
/* We have desc.name so use it */
if (!strcmp( l->name, desc.name ))
if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK)
@@ -237,7 +239,7 @@ preinit( const char *arg )
use_crtc2 = 1;
use_spic = 1;
field_parity = -1;
-#if DIRECTFBVERSION > 917
+#if DIRECTFBVERSION > DFB_VERSION(0,9,17)
buffermode = DLBM_TRIPLE;
osd_max = 4;
#else
@@ -479,7 +481,7 @@ preinit( const char *arg )
if (use_crtc2) {
struct layer_enum l = {
-#if DIRECTFBVERSION > 920
+#if DIRECTFBVERSION > DFB_VERSION(0,9,20)
"Matrox CRTC2 Layer",
#else
"Matrox CRTC2",
@@ -694,7 +696,7 @@ config( uint32_t width, uint32_t height,
dlc.buffermode = buffermode;
dlc.options = DLOP_NONE;
-#if DIRECTFBVERSION > 916
+#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
if (field_parity != -1) {
dlc.options |= DLOP_FIELD_PARITY;
}
@@ -742,7 +744,7 @@ config( uint32_t width, uint32_t height,
return -1;
}
-#if DIRECTFBVERSION > 916
+#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
if (field_parity != -1)
crtc2->SetFieldParity( crtc2, field_parity );
#endif
@@ -822,7 +824,7 @@ config( uint32_t width, uint32_t height,
dlc.pixelformat = DSPF_ALUT44;
dlc.buffermode = buffermode;
-#if DIRECTFBVERSION > 916
+#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
dlc.flags |= DLCONF_OPTIONS;
dlc.options = DLOP_ALPHACHANNEL;
#endif
@@ -903,7 +905,7 @@ query_format( uint32_t format )
return 0;
case IMGFMT_YUY2:
break;
-#if DIRECTFBVERSION > 921
+#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
case IMGFMT_NV12:
case IMGFMT_NV21:
if (!use_bes || use_crtc2)
@@ -1012,7 +1014,7 @@ draw_alpha( int x0, int y0,
((uint8_t *) dst) + pitch * y0 + 2 * x0 + 1,
pitch );
break;
-#if DIRECTFBVERSION > 921
+#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
case DSPF_NV12:
case DSPF_NV21:
#endif
@@ -1050,7 +1052,7 @@ draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y )
y /= 2;
h /= 2;
-#if DIRECTFBVERSION > 921
+#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
if (frame_format == DSPF_NV12 || frame_format == DSPF_NV21) {
memcpy_pic( dst + pitch * y + x, src[1],
w, h, pitch, stride[1] );
@@ -1090,7 +1092,7 @@ blit_to_screen( void )
DFBRectangle *srect = NULL;
if (use_bes) {
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
if (vo_vsync && !flipping && !use_crtc2)
bes->WaitForSync( bes );
#endif
@@ -1101,7 +1103,7 @@ blit_to_screen( void )
}
if (use_crtc2) {
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
if (vo_vsync && !flipping)
crtc2->WaitForSync( crtc2 );
#endif
diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c
index e1130c5ccb..7be855a58d 100644
--- a/libvo/vo_directfb2.c
+++ b/libvo/vo_directfb2.c
@@ -25,6 +25,8 @@
#include <directfb.h>
+#define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
+
// other things
#include <stdio.h>
@@ -50,7 +52,7 @@
#define min(x,y) (((x)<(y))?(x):(y))
#endif
-#if DIRECTFBVERSION > 917
+#if DIRECTFBVERSION > DFB_VERSION(0,9,17)
// triple buffering
#define TRIPLE 1
#endif
@@ -273,7 +275,7 @@ static int preinit(const char *arg)
DFBCHECK (DirectFBCreate (&dfb));
-#if DIRECTFBVERSION < 917
+#if DIRECTFBVERSION < DFB_VERSION(0,9,17)
if (DFB_OK != dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)) {
mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot swith to fullscreen mode");
};
@@ -318,7 +320,7 @@ DFBSurfacePixelFormat convformat(uint32_t format)
case IMGFMT_BGR24: return DSPF_RGB24; break;
case IMGFMT_RGB16: return DSPF_RGB16; break;
case IMGFMT_BGR16: return DSPF_RGB16; break;
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
case IMGFMT_RGB15: return DSPF_ARGB1555; break;
case IMGFMT_BGR15: return DSPF_ARGB1555; break;
#else
@@ -568,7 +570,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
} // vm end
// just for sure clear primary layer
-#if DIRECTFBVERSION > 913
+#if DIRECTFBVERSION > DFB_VERSION(0,9,13)
ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer);
if (ret==DFB_OK) {
ret = layer->GetSurface(layer,&primary);
@@ -609,7 +611,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer));
-#if DIRECTFBVERSION > 916
+#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
mp_msg(MSGT_VO, MSGL_INFO,"DirectFB: Config - switching layer to exclusive mode\n");
ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE);
@@ -667,7 +669,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
case DSPF_RGB32: bpp=32;break;
case DSPF_RGB24: bpp=24;break;
case DSPF_RGB16: bpp=16;break;
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
case DSPF_ARGB1555: bpp=15;break;
#else
case DSPF_RGB15: bpp=15;break;
@@ -680,7 +682,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
case DSPF_RGB32:
case DSPF_RGB24:
case DSPF_RGB16:
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
case DSPF_ARGB1555:
#else
case DSPF_RGB15:
@@ -751,7 +753,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
}
#endif
-#if DIRECTFBVERSION > 916
+#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
if (field_parity != -1) {
dlc.flags = DLCONF_OPTIONS;
ret = layer->GetConfiguration( layer, &dlc );
@@ -790,7 +792,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
// test surface for flipping
DFBCHECK(primary->GetCapabilities(primary,&caps));
-#if DIRECTFBVERSION > 913
+#if DIRECTFBVERSION > DFB_VERSION(0,9,13)
primary->Clear(primary,0,0,0,0xff);
#endif
flipping = 0;
@@ -802,7 +804,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width,
ret = primary->Flip(primary,NULL,0);
if (ret==DFB_OK) {
flipping = 1;
-#if DIRECTFBVERSION > 913
+#if DIRECTFBVERSION > DFB_VERSION(0,9,13)
primary->Clear(primary,0,0,0,0xff);
#ifdef TRIPLE
// if we have 3 buffers clean once more
@@ -1487,7 +1489,7 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
case DSPF_RGB16:
vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch);
break;
-#if DIRECTFBVERSION > 915
+#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
case DSPF_ARGB1555:
#else
case DSPF_RGB15: