diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-09-15 15:58:48 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:16:55 +0200 |
commit | 868fb5d278485f707cf8921ea137094fa8a7fdf5 (patch) | |
tree | 08357525b709dfaaf459da92e6f50419586fd22b /libvo/vo_directfb2.c | |
parent | 7c5e3a19331b004883848a4efc9263c68cc3f4da (diff) | |
download | mpv-868fb5d278485f707cf8921ea137094fa8a7fdf5.tar.bz2 mpv-868fb5d278485f707cf8921ea137094fa8a7fdf5.tar.xz |
build: update DirectFB requirements, reduce #ifdefs
Require DirectFB version 0.9.15 instead of 0.9.13.
This simplifies the build system at the cost of requiring a library
version that was released at the end rather than the middle of 2002.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32251 b3059339-0415-0410-9bf9-f77b7e298cf2
Simplify DirectFB check.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32252 b3059339-0415-0410-9bf9-f77b7e298cf2
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.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32253 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_directfb2.c')
-rw-r--r-- | libvo/vo_directfb2.c | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/libvo/vo_directfb2.c b/libvo/vo_directfb2.c index 0c2fb9b423..3771f3d6a9 100644 --- a/libvo/vo_directfb2.c +++ b/libvo/vo_directfb2.c @@ -22,14 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -// directfb includes - #include <directfb.h> - -#define DFB_VERSION(a,b,c) (((a)<<16)|((b)<<8)|(c)) - -// other things - +#include <directfb_version.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -48,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.13)" + "v 2.0 (for DirectFB version >=0.9.22)" }; const LIBVO_EXTERN(directfb) @@ -241,7 +233,7 @@ static int preinit(const char *arg) if (((directfb_major_version <= 0) && (directfb_minor_version <= 9) && - (directfb_micro_version < 13))) + (directfb_micro_version < 15))) { mp_msg(MSGT_VO, MSGL_ERR,"DirectFB: Unsupported DirectFB version\n"); return 1; @@ -269,12 +261,6 @@ static int preinit(const char *arg) 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) */ @@ -314,17 +300,10 @@ 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 > 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; @@ -568,7 +547,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, } // vm end // just to be sure clear primary layer -#if DIRECTFBVERSION > DFB_VERSION(0,9,13) ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer); if (ret==DFB_OK) { ret = layer->GetSurface(layer,&primary); @@ -584,7 +562,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, layer->Release(layer); } layer=NULL; -#endif // find best layer @@ -609,7 +586,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, 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); @@ -617,7 +593,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, 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; @@ -667,13 +642,8 @@ 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 > 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; } @@ -682,13 +652,8 @@ 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 > 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 @@ -755,7 +720,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, } #endif -#if DIRECTFBVERSION > DFB_VERSION(0,9,16) if (field_parity != -1) { dlc.flags = DLCONF_OPTIONS; ret = layer->GetConfiguration( layer, &dlc ); @@ -780,9 +744,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, break; } -#endif - - // get layer surface ret = layer->GetSurface(layer,&primary); @@ -794,9 +755,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 > DFB_VERSION(0,9,13) primary->Clear(primary,0,0,0,0xff); -#endif flipping = 0; if (caps & (DSCAPS_FLIPPING #ifdef TRIPLE @@ -806,7 +765,6 @@ 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 > DFB_VERSION(0,9,13) primary->Clear(primary,0,0,0,0xff); #ifdef TRIPLE // if we have 3 buffers clean once more @@ -816,7 +774,6 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t d_width, flipping = 2; } #endif -#endif } }; @@ -1476,18 +1433,10 @@ 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 > 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); |