changeset 32169:e55fdf5b1dd7

Require DirectFB version 0.9.22. This allows getting rid of a lot of library version check #ifdeffery. Release 0.9.22 is from February 2005, so the requirement is reasonable.
author diego
date Wed, 15 Sep 2010 18:34:15 +0000
parents c026f1657647
children a5dc81ecf224
files DOCS/xml/en/install.xml configure libvo/vo_dfbmga.c libvo/vo_directfb2.c
diffstat 4 files changed, 5 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/xml/en/install.xml	Wed Sep 15 17:22:04 2010 +0000
+++ b/DOCS/xml/en/install.xml	Wed Sep 15 18:34:15 2010 +0000
@@ -66,7 +66,7 @@
   required for the optional PNG video output driver
 </para></listitem>
 <listitem><para>
-  <emphasis role="bold">directfb</emphasis> - optional, 0.9.15 or later
+  <emphasis role="bold">directfb</emphasis> - optional, 0.9.22 or later
   required for the directfb/dfbmga video output drivers
 </para></listitem>
 <listitem><para>
--- a/configure	Wed Sep 15 17:22:04 2010 +0000
+++ b/configure	Wed Sep 15 18:34:15 2010 +0000
@@ -4261,7 +4261,7 @@
   cat > $TMPC << EOF
 #include <directfb.h>
 #include <directfb_version.h>
-#if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 15)
+#if (DIRECTFB_MAJOR_VERSION << 16 | DIRECTFB_MINOR_VERSION << 8 | DIRECTFB_MICRO_VERSION) < (0 << 16 | 9 << 8 | 22)
 #error "DirectFB version too old."
 #endif
 int main(void) { DirectFBInit(0, 0); return 0; }
--- a/libvo/vo_dfbmga.c	Wed Sep 15 17:22:04 2010 +0000
+++ b/libvo/vo_dfbmga.c	Wed Sep 15 18:34:15 2010 +0000
@@ -21,14 +21,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-/* directfb includes */
 #include <directfb.h>
 #include <directfb_version.h>
-
-#define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
-#define DIRECTFBVERSION DFB_VERSION(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
-
-/* other things */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -105,16 +99,6 @@
 
 static int is_g200;
 
-#if DIRECTFBVERSION < DFB_VERSION(0,9,18)
- #define DSPF_ALUT44 DSPF_LUT8
- #define DLBM_TRIPLE ~0
- #define DSFLIP_ONSYNC 0
-#endif
-
-#if DIRECTFBVERSION < DFB_VERSION(0,9,16)
- #define DSPF_ARGB1555 DSPF_RGB15
-#endif
-
 static uint32_t in_width;
 static uint32_t in_height;
 static uint32_t buf_height;
@@ -145,12 +129,10 @@
           return "I420";
      case DSPF_ALUT44:
           return "ALUT44";
-#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case DSPF_NV12:
           return "NV12";
      case DSPF_NV21:
           return "NV21";
-#endif
      default:
           return "Unknown pixel format";
      }
@@ -175,12 +157,10 @@
      case IMGFMT_I420:
      case IMGFMT_IYUV:
           return DSPF_I420;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case IMGFMT_NV12:
           return DSPF_NV12;
      case IMGFMT_NV21:
           return DSPF_NV21;
-#endif
      default:
           return DSPF_UNKNOWN;
      }
@@ -200,20 +180,9 @@
 {
      struct layer_enum *l = (struct layer_enum *) data;
 
-#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)
                return DFENUM_CANCEL;
-#else
-     /* Fake it according to id */
-     if ((id == 0 && !strcmp( l->name, "FBDev Primary Layer" )) ||
-         (id == 1 && !strcmp( l->name, "Matrox Backend Scaler" )) ||
-         (id == 2 && !strcmp( l->name, "Matrox CRTC2" )) ||
-         (id == 3 && !strcmp( l->name, "Matrox CRTC2 Sub-Picture" )))
-          if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK)
-               return DFENUM_CANCEL;
-#endif
 
      return DFENUM_OK;
 }
@@ -230,13 +199,8 @@
      use_crtc2 = 1;
      use_spic = 1;
      field_parity = -1;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,17)
      buffermode = DLBM_TRIPLE;
      osd_max = 4;
-#else
-     buffermode = DLBM_BACKVIDEO;
-     osd_max = 2;
-#endif
      flipping = 1;
      tvnorm = -1;
 
@@ -481,11 +445,7 @@
 
      if (use_crtc2) {
           struct layer_enum l = {
-#if DIRECTFBVERSION > DFB_VERSION(0,9,20)
                "Matrox CRTC2 Layer",
-#else
-               "Matrox CRTC2",
-#endif
                &crtc2,
                DFB_UNSUPPORTED
           };
@@ -753,11 +713,9 @@
           dlc.buffermode = buffermode;
           dlc.options    = DLOP_NONE;
 
-#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
           if (field_parity != -1) {
                dlc.options |= DLOP_FIELD_PARITY;
           }
-#endif
           mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Field parity set to: ");
           switch (field_parity) {
           case -1:
@@ -801,10 +759,8 @@
                return -1;
           }
 
-#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
           if (field_parity != -1)
                crtc2->SetFieldParity( crtc2, field_parity );
-#endif
 
           crtc2->GetSurface( crtc2, &c2frame );
           c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX );
@@ -880,11 +836,9 @@
           dlc.flags       = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
           dlc.pixelformat = DSPF_ALUT44;
           dlc.buffermode  = buffermode;
-
-#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
           dlc.flags      |= DLCONF_OPTIONS;
           dlc.options     = DLOP_ALPHACHANNEL;
-#endif
+
           if ((res = spic->TestConfiguration( spic, &dlc, &failed )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR,
                        "vo_dfbmga: Invalid sub-picture configuration - %s!\n",
@@ -973,13 +927,11 @@
           break;
      case IMGFMT_YUY2:
           break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case IMGFMT_NV12:
      case IMGFMT_NV21:
           if (use_crtc1 || use_crtc2)
                return 0;
           break;
-#endif
      default:
           return 0;
      }
@@ -1079,10 +1031,8 @@
                               dst + pitch * y0 + 2 * x0 + 1,
                               pitch );
           break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case DSPF_NV12:
      case DSPF_NV21:
-#endif
      case DSPF_I420:
      case DSPF_YV12:
           vo_draw_alpha_yv12( w, h, src, srca, stride,
@@ -1119,13 +1069,10 @@
      y /= 2;
      h /= 2;
 
-#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] );
-     } else
-#endif
-     {
+     } else {
           x /= 2;
           w /= 2;
           pitch /= 2;
@@ -1159,10 +1106,8 @@
      DFBRectangle *srect = NULL;
 
      if (use_bes) {
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
           if (vo_vsync && !flipping)
                bes->WaitForSync( bes );
-#endif
 
           besframe->Blit( besframe, blitsrc, NULL, besrect.x, besrect.y );
           blitsrc = besframe;
@@ -1170,10 +1115,8 @@
      }
 
      if (use_crtc1) {
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
           if (vo_vsync && !flipping)
                crtc1->WaitForSync( crtc1 );
-#endif
 
           if (c1stretch)
                c1frame->StretchBlit( c1frame, blitsrc, srect, &c1rect );
@@ -1182,10 +1125,8 @@
      }
 
      if (use_crtc2) {
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
           if (vo_vsync && !flipping)
                crtc2->WaitForSync( crtc2 );
-#endif
 
           if (c2stretch)
                c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect );
--- a/libvo/vo_directfb2.c	Wed Sep 15 17:22:04 2010 +0000
+++ b/libvo/vo_directfb2.c	Wed Sep 15 18:34:15 2010 +0000
@@ -22,16 +22,8 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-// directfb includes
-
 #include <directfb.h>
 #include <directfb_version.h>
-
-#define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c))
-#define DIRECTFBVERSION DFB_VERSION(DIRECTFB_MAJOR_VERSION, DIRECTFB_MINOR_VERSION, DIRECTFB_MICRO_VERSION)
-
-// other things
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -50,16 +42,14 @@
 #define min(x,y) (((x)<(y))?(x):(y))
 #endif
 
-#if DIRECTFBVERSION > DFB_VERSION(0,9,17)
 // triple buffering
 #define TRIPLE 1
-#endif
 
 static const vo_info_t info = {
 	"Direct Framebuffer Device",
 	"directfb",
 	"Jiri Svoboda Jiri.Svoboda@seznam.cz",
-	"v 2.0 (for DirectFB version >=0.9.15)"
+	"v 2.0 (for DirectFB version >=0.9.22)"
 };
 
 const LIBVO_EXTERN(directfb)
@@ -272,12 +262,6 @@
 
         DFBCHECK (DirectFBCreate (&dfb));
 
-#if DIRECTFBVERSION < DFB_VERSION(0,9,17)
-        if (DFB_OK != dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN)) {
-            mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot switch to fullscreen mode");
-        };
-#endif
-
   /*
    * (Get keyboard)
    */
@@ -317,17 +301,10 @@
 	    case IMGFMT_BGR24: return  DSPF_RGB24; break;
             case IMGFMT_RGB16: return  DSPF_RGB16; break;
             case IMGFMT_BGR16: return  DSPF_RGB16; break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
             case IMGFMT_RGB15: return  DSPF_ARGB1555; break;
             case IMGFMT_BGR15: return  DSPF_ARGB1555; break;
             case IMGFMT_RGB12: return  DSPF_ARGB4444; break;
             case IMGFMT_BGR12: return  DSPF_ARGB4444; break;
-#else
-            case IMGFMT_RGB15: return  DSPF_RGB15; break;
-            case IMGFMT_BGR15: return  DSPF_RGB15; break;
-            case IMGFMT_RGB12: return  DSPF_RGB12; break;
-            case IMGFMT_BGR12: return  DSPF_RGB12; break;
-#endif
             case IMGFMT_YUY2:  return  DSPF_YUY2; break;
             case IMGFMT_UYVY:  return  DSPF_UYVY; break;
     	    case IMGFMT_YV12:  return  DSPF_YV12; break;
@@ -611,7 +588,6 @@
 
         DFBCHECK (dfb->GetDisplayLayer( dfb, params.id, &layer));
 
-#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
         mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - switching layer to exclusive mode\n");
 	ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE);
 
@@ -619,7 +595,6 @@
 	    mp_msg(MSGT_VO, MSGL_WARN,"DirectFB: Warning - cannot switch layer to exclusive mode. This could cause\nproblems. You may need to select correct pixel format manually!\n");
 	    DirectFBError("MPlayer - Switch layer to exlusive mode.",ret);
 	};
-#endif
 	if (params.scale) {
             mp_msg(MSGT_VO, MSGL_DBG2,"DirectFB: Config - changing layer configuration (size)\n");
             dlc.flags       = DLCONF_WIDTH | DLCONF_HEIGHT;
@@ -669,13 +644,8 @@
 		    case DSPF_RGB32: bpp=32;break;
     		    case DSPF_RGB24: bpp=24;break;
 	            case DSPF_RGB16: bpp=16;break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
     		    case DSPF_ARGB1555: bpp=15;break;
                     case DSPF_ARGB4444: bpp=12; break;
-#else
-        	    case DSPF_RGB15: bpp=15;break;
-                    case DSPF_RGB12: bpp=12; break;
-#endif
 		    case DSPF_RGB332 : bpp=8;break;
 		}
 
@@ -684,13 +654,8 @@
 		    case DSPF_RGB32:
     		    case DSPF_RGB24:
 	            case DSPF_RGB16:
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
     		    case DSPF_ARGB1555:
                     case DSPF_ARGB4444:
-#else
-        	    case DSPF_RGB15:
-                    case DSPF_RGB12:
-#endif
 		    case DSPF_RGB332:
 				    mp_msg(MSGT_VO, MSGL_V,"DirectFB: Trying to recover via videomode change (VM).\n");
 				    // get size
@@ -757,7 +722,6 @@
 	}
 #endif
 
-#if DIRECTFBVERSION > DFB_VERSION(0,9,16)
         if (field_parity != -1) {
 	    dlc.flags = DLCONF_OPTIONS;
 	    ret = layer->GetConfiguration( layer, &dlc );
@@ -782,9 +746,6 @@
                 break;
           }
 
-#endif
-
-
 // get layer surface
 
 	ret = layer->GetSurface(layer,&primary);
@@ -1486,18 +1447,10 @@
                 case DSPF_RGB16:
                         vo_draw_alpha_rgb16(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch);
                         break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
                 case DSPF_ARGB1555:
-#else
-                case DSPF_RGB15:
-#endif
                         vo_draw_alpha_rgb15(w,h,src,srca,stride,((uint8_t *) dst)+pitch*y0 + 2*x0,pitch);
                         break;
-#if DIRECTFBVERSION > DFB_VERSION(0,9,15)
                 case DSPF_ARGB4444:
-#else
-                case DSPF_RGB12:
-#endif
                     vo_draw_alpha_rgb12(w, h, src, srca, stride,
                                         ((uint8_t *) dst) + pitch * y0 + 2 * x0,
                                         pitch);