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 | |
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')
-rw-r--r-- | libvo/video_out.c | 2 | ||||
-rw-r--r-- | libvo/vo_dfbmga.c | 63 | ||||
-rw-r--r-- | libvo/vo_directfb2.c | 57 |
3 files changed, 7 insertions, 115 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index e960a813d7..e223830e1e 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -236,7 +236,7 @@ const struct vo_driver *video_out_drivers[] = #ifdef CONFIG_VESA &video_out_vesa, #endif -#ifdef CONFIG_DFBMGA +#ifdef CONFIG_DIRECTFB &video_out_dfbmga, #endif #ifdef CONFIG_VIDIX diff --git a/libvo/vo_dfbmga.c b/libvo/vo_dfbmga.c index 457a481c7a..a0a9d07760 100644 --- a/libvo/vo_dfbmga.c +++ b/libvo/vo_dfbmga.c @@ -21,12 +21,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> @@ -103,16 +99,6 @@ static int osd_max; 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; @@ -143,12 +129,10 @@ pixelformat_name( DFBSurfacePixelFormat format ) 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"; } @@ -173,12 +157,10 @@ imgfmt_to_pixelformat( uint32_t format ) 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; } @@ -198,20 +180,9 @@ get_layer_by_name( DFBDisplayLayerID id, { 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; } @@ -228,13 +199,8 @@ preinit( const char *arg ) 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; @@ -479,11 +445,7 @@ preinit( const char *arg ) if (use_crtc2) { struct layer_enum l = { -#if DIRECTFBVERSION > DFB_VERSION(0,9,20) "Matrox CRTC2 Layer", -#else - "Matrox CRTC2", -#endif &crtc2, DFB_UNSUPPORTED }; @@ -751,11 +713,9 @@ config( uint32_t width, uint32_t height, 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: @@ -799,10 +759,8 @@ config( uint32_t width, uint32_t height, 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 ); @@ -878,11 +836,9 @@ config( uint32_t width, uint32_t height, 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", @@ -971,13 +927,11 @@ query_format( uint32_t format ) 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; } @@ -1077,10 +1031,8 @@ draw_alpha( int x0, int y0, 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, @@ -1117,13 +1069,10 @@ draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) 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; @@ -1157,10 +1106,8 @@ blit_to_screen( void ) 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; @@ -1168,10 +1115,8 @@ blit_to_screen( void ) } 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 ); @@ -1180,10 +1125,8 @@ blit_to_screen( void ) } 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 ); 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); |