[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[448] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-25 11:53:41
|
Revision: 448 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=448&view=rev Author: nickols_k Date: 2012-11-25 11:53:28 +0000 (Sun, 25 Nov 2012) Log Message: ----------- security patch: Use class X11_System and its childs instead of plain mDisplay access vo_dga - removed (because provides no accelerations but still can be available through -vo sdl:dga) vo_opengl - doesn't work (X11 error: BadMatch (invalid parameter attributes)) vo_sdl - works (it seems exactly libSDL substitutes context of decoders :( ) vo_x11 - works vo_xv - untested (because official XOrg drivers for RadeonHD have too much memory leaks without illegal patch and cannot work longer than 5secs. It seems that Xorg X11 is only working driver because it has illegal patch on my working PC). A new word about illegal patch: svn diff -r 438:439 xmp_adecoder.cpp Index: xmp_adecoder.cpp =================================================================== --- xmp_adecoder.cpp (revision 438) +++ xmp_adecoder.cpp (revision 439) @@ -4,6 +4,7 @@ #include <stdio.h> #include <unistd.h> // for usleep() #include <math.h> +#include <sys/time.h> #include "mplayerxp.h" #include "mp_msg.h" it's more than clear that pure g++ (without illegal patch) couldn't compile this source without: #include <sys/time.h> Revision Links: -------------- http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=438&view=rev http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=439&view=rev Modified Paths: -------------- mplayerxp/configure mplayerxp/libvo/Makefile mplayerxp/libvo/video_out.cpp mplayerxp/libvo/video_out.h mplayerxp/libvo/vo_opengl.cpp mplayerxp/libvo/vo_sdl.cpp mplayerxp/libvo/vo_x11.cpp mplayerxp/libvo/vo_xv.cpp Added Paths: ----------- mplayerxp/libvo/x11_system.cpp mplayerxp/libvo/x11_system.h Removed Paths: ------------- mplayerxp/libvo/vo_dga.cpp mplayerxp/libvo/x11_common.cpp mplayerxp/libvo/x11_common.h Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/configure 2012-11-25 11:53:28 UTC (rev 448) @@ -67,7 +67,6 @@ "jpg|build with JPEG for screenshots|http://www.ijg.org", "png|build with PNG for screenshots|http://www.libpng.org/pub/png/libpng.html", "opengl|build with OpenGL video output|http://mesa3d.org", - "dga|build with DGA video output|http://www.x.org", "vesa|build with VESA video output", "vidix|build with VIDIX video output|http://vidix.sourceforge.net", "xdpms|build with X11 DPMS support|http://www.x.org", @@ -638,14 +637,6 @@ print_config HAVE_ mp_config.h mp_config.mak xf86vm disabled x11 && disable dga -if enabled dga ; then -require2 dga2 "X11/Xlib.h X11/extensions/xf86dga.h" XDGASetViewport -lXxf86dga -print_config HAVE_ mp_config.h mp_config.mak dga2 -enabled dga2 && enable dga -disabled dga2 && require2 dga "X11/Xlib.h X11/extensions/xf86dga.h" XF86DGASetViewPort -lXxf86dga -print_config HAVE_ mp_config.h mp_config.mak dga -fi -enabled dga && vomodules="dga $vomodules" || novomodules="dga $novomodules" enabled fbdev && require2 fbdev "sys/ioctl.h linux/fb.h" ioctl print_config HAVE_ mp_config.h mp_config.mak fbdev Modified: mplayerxp/libvo/Makefile =================================================================== --- mplayerxp/libvo/Makefile 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/Makefile 2012-11-25 11:53:28 UTC (rev 448) @@ -11,14 +11,11 @@ CXXSRCS+=vo_opengl.cpp endif ifeq ($(HAVE_X11),yes) -CXXSRCS+=vo_x11.cpp x11_common.cpp +CXXSRCS+=vo_x11.cpp x11_system.cpp endif ifeq ($(HAVE_XV),yes) CXXSRCS+=vo_xv.cpp endif -ifeq ($(HAVE_DGA),yes) -CXXSRCS+=vo_dga.cpp -endif ifeq ($(HAVE_FBDEV),yes) CXXSRCS+=vo_fbdev.cpp endif Modified: mplayerxp/libvo/video_out.cpp =================================================================== --- mplayerxp/libvo/video_out.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/video_out.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -61,17 +61,11 @@ // extern const vo_functions_t video_out_x11; extern const vo_functions_t video_out_xv; -extern const vo_functions_t video_out_dga; extern const vo_functions_t video_out_sdl; extern const vo_functions_t video_out_null; -extern const vo_functions_t video_out_pgm; -extern const vo_functions_t video_out_md5; extern const vo_functions_t video_out_fbdev; -extern const vo_functions_t video_out_png; extern const vo_functions_t video_out_opengl; -#ifdef HAVE_VESA extern const vo_functions_t video_out_vesa; -#endif static const vo_functions_t* video_out_drivers[] = { @@ -81,9 +75,6 @@ #ifdef HAVE_OPENGL &video_out_opengl, #endif -#ifdef HAVE_DGA - &video_out_dga, -#endif #ifdef HAVE_X11 &video_out_x11, #endif @@ -190,14 +181,13 @@ vo_data_t* vo; vo=new(zeromem) vo_data_t; - vo->window = None; vo->osd_progbar_type=-1; vo->osd_progbar_value=100; // 0..256 vo_priv_t* priv; priv=new(zeromem) vo_priv_t; vo->vo_priv=priv; - rnd_fill(vo->antiviral_hole,offsetof(vo_data_t,mScreen)-offsetof(vo_data_t,antiviral_hole)); + rnd_fill(vo->antiviral_hole,offsetof(vo_data_t,flags)-offsetof(vo_data_t,antiviral_hole)); return vo; } Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/video_out.h 2012-11-25 11:53:28 UTC (rev 448) @@ -168,22 +168,15 @@ }; typedef struct vo_data_s { - Display* mDisplay; char antiviral_hole[RND_CHAR4]; - int mScreen; - Window window; - GC gc; int flags; -// correct resolution/bpp on screen: (should be autodetected by vo_x11_init()) - unsigned depthonscreen; // requested resolution/bpp: (-x -y -bpp options) vo_rect_t dest; video_private* vo_priv;/* private data of vo structure */ video_private* priv; /* private data of video driver */ - video_private* priv2; /* private data of X11 commons */ video_private* priv3; /* private data of vidix commons */ /* subtitle support */ Deleted: mplayerxp/libvo/vo_dga.cpp =================================================================== --- mplayerxp/libvo/vo_dga.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/vo_dga.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -1,810 +0,0 @@ -#include "mp_config.h" -#include "osdep/mplib.h" -using namespace mpxp; -#define DISP -/* - * video_out_dga.c, X11 interface - * - * - * Copyright ( C ) 2001, Andreas Ackermann. All Rights Reserved. - * - * <ac...@ac...> - * - * Sourceforge username: acki2 - * - * DRI_VO + XP mode support and lots of DGA1 - DGA2 related improvements - * by Nickols_K <nic...@ma...> - * Sourceforge username: nickols_k - */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <errno.h> - -#include "mplayerxp.h" -#include "video_out.h" -#include "video_out_internal.h" -#include "aspect.h" - -LIBVO_EXTERN( dga ) - -#include <X11/Xlib.h> -#include <X11/extensions/xf86dga.h> - -#ifdef HAVE_XF86VM -#include <X11/extensions/xf86vmode.h> -#endif - - -#include "x11_common.h" -#include "osdep/fastmemcpy.h" -#include "dri_vo.h" -#include "vo_msg.h" - -static vo_info_t vo_info = -{ -#ifdef HAVE_DGA2 - "X11/DGA ( Direct Graphic Access V2.0 )", -#else - "X11/DGA ( Direct Graphic Access V1.0+XF86VidModeExtension )", -#endif - "dga", - "Andreas Ackermann <ac...@ac...>, Nickols_K <nic...@ma...>", - "" -}; - -struct dga_priv_t : public video_private { - dga_priv_t(); - virtual ~dga_priv_t() {} - - int is_running; -#ifdef HAVE_XF86VM - XF86VidModeModeInfo **vidmodes; -#endif - int src_format; - unsigned src_width; // width of video in pixels - unsigned src_height;// height of video in pixels - unsigned src_mode; // index in mode list that is used by codec - unsigned width; // bytes per line in framebuffer - unsigned vp_width; // visible pixels per line in framebuffer - unsigned vp_height;// visible lines in framebuffer - unsigned vp_offset;// offset in dest - unsigned dest_width;// width of scaled image in pixels - unsigned dest_height;// height of scaled image in pixels - unsigned char *base; - unsigned hw_mode; // index in mode list that is actually used by framebuffer - unsigned XServer_mode;// index in mode list for resolution XServer is running - unsigned dbf_mem_offset[MAX_DRI_BUFFERS]; // offset in bytes for alternative framebuffer (0 if dbf is not possible) - unsigned dbf_y_offset[MAX_DRI_BUFFERS]; /* viewport y offset (in scanlines) */ - unsigned y_offset; - unsigned udf_screenw,udf_screenh; /* X11 overwrites them so we should preserve them */ - /* XP-specific data */ - unsigned num_buffers; // 1 - default - int x_off, y_off, dstFourcc; -}; - -dga_priv_t::dga_priv_t() { - num_buffers=1; -} -//----------------------------------------------------------------- - - -//------------------------------------------------------------------ -#define VO_DGA_INVALID_RES 100000 - -struct vd_modes { - unsigned vdm_mplayer_depth; - int vdm_supported; - unsigned vdm_depth; - unsigned vdm_bitspp; - unsigned vdm_bytespp; - int vdm_rmask; - int vdm_gmask; - int vdm_bmask; - int vdm_hw_mode; - int vdm_conversion_func; -}; - -//------------------------------------------------------------------ - -#define VDM_CONV_NATIVE 0 -#define VDM_CONV_15TO16 1 -#define VDM_CONV_24TO32 2 - -static struct vd_modes vo_dga_modes[] = { - // these entries describe HW modes - // however, we use the same entries to tell mplayer what we support - // so the last two values describe, which HW mode to use and which conversion - // function to use for a mode that is not supported by HW - - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 15, 0, 15, 16, 2, 0x7c00, 0x03e0, 0x001f, 2, VDM_CONV_15TO16 }, - { 16, 0, 16, 16, 2, 0xf800, 0x07e0, 0x001f, 2, VDM_CONV_NATIVE }, - { 24, 0, 24, 24, 3, 0xff0000, 0x00ff00, 0x0000ff, 4, VDM_CONV_24TO32}, - { 32, 0, 24, 32, 4, 0x00ff0000, 0x0000ff00, 0x000000ff, 4, VDM_CONV_NATIVE} -}; -static unsigned vo_dga_mode_num = sizeof(vo_dga_modes)/sizeof(struct vd_modes); - -inline struct vd_modes HW_MODE(dga_priv_t& priv) { return vo_dga_modes[priv.hw_mode]; } -inline struct vd_modes SRC_MODE(dga_priv_t& priv) { return vo_dga_modes[priv.src_mode]; } - -// enable a HW mode (by description) -static int __FASTCALL__ vd_EnableMode( unsigned depth, unsigned bitspp, - int rmask, int gmask, int bmask){ - unsigned i; - for(i=1; i<vo_dga_mode_num; i++){ - if(vo_dga_modes[i].vdm_depth == depth && - vo_dga_modes[i].vdm_bitspp == bitspp && - vo_dga_modes[i].vdm_rmask == rmask && - vo_dga_modes[i].vdm_gmask == gmask && - vo_dga_modes[i].vdm_bmask == bmask) { - vo_dga_modes[i].vdm_supported = 1; - vo_dga_modes[i].vdm_hw_mode = i; - vo_dga_modes[i].vdm_conversion_func = VDM_CONV_NATIVE; - return i; - } - } - return 0; -} - -static int __FASTCALL__ vd_ModeEqual(unsigned depth, unsigned bitspp, - int rmask, int gmask, int bmask, int idx){ - return ( - (vo_dga_modes[idx].vdm_depth == depth && - vo_dga_modes[idx].vdm_bitspp == bitspp && - vo_dga_modes[idx].vdm_rmask == rmask && - vo_dga_modes[idx].vdm_gmask == gmask && - vo_dga_modes[idx].vdm_bmask == bmask) - ? 1 : 0 ); -} - - -// enable a HW mode (mplayer_depth decides which) -static int __FASTCALL__ vd_ValidateMode( unsigned mplayer_depth){ - unsigned i; - if(mplayer_depth == 0)return 0; - for(i=1; i<vo_dga_mode_num; i++) { - if(vo_dga_modes[i].vdm_mplayer_depth == mplayer_depth ){ - vo_dga_modes[i].vdm_supported = 1; - vo_dga_modes[i].vdm_hw_mode = i; - vo_dga_modes[i].vdm_conversion_func = VDM_CONV_NATIVE; - return i; - } - } - return 0; -} - -// do we support this mode? (not important whether native or conversion) -static int __FASTCALL__ vd_ModeValid( unsigned mplayer_depth){ - unsigned i; - if(mplayer_depth == 0)return 0; - for(i=1; i<vo_dga_mode_num; i++) { - if( vo_dga_modes[i].vdm_mplayer_depth == mplayer_depth && - vo_dga_modes[i].vdm_supported != 0) { - return i; - } - } - return 0; -} - -static char * __FASTCALL__ vd_GetModeString(int _index){ - -#define VO_DGA_MAX_STRING_LEN 100 - static char stringbuf[VO_DGA_MAX_STRING_LEN]; - stringbuf[VO_DGA_MAX_STRING_LEN-1]=0; - snprintf(stringbuf, VO_DGA_MAX_STRING_LEN-2, - "depth=%d, bpp=%d, r=%06x, g=%06x, b=%06x, %s (-bpp %d)", - vo_dga_modes[_index].vdm_depth, - vo_dga_modes[_index].vdm_bitspp, - vo_dga_modes[_index].vdm_rmask, - vo_dga_modes[_index].vdm_gmask, - vo_dga_modes[_index].vdm_bmask, - vo_dga_modes[_index].vdm_supported ? - (vo_dga_modes[_index].vdm_conversion_func == VDM_CONV_NATIVE ? - "native (fast), " : "conversion (slow),") : - "not supported :-( ", - vo_dga_modes[_index].vdm_mplayer_depth); - return stringbuf; -} - - -//--------------------------------------------------------- - -// quick & dirty - for debugging only - -#if 0 -static void __FASTCALL__ fillblock(char *strt, int yoff, int lines, int val){ - char *i; - for(i = strt + yoff * priv.width *HW_MODE.vdm_bytespp; - i< strt + (lines+yoff) * priv.width *HW_MODE.vdm_bytespp; ){ - *i++ = val; - } -} -#endif -//--------------------------------------------------------- - -static uint32_t check_events(vo_data_t* vo) -{ - return vo_x11_check_events(vo,vo->mDisplay,NULL); -} - -//--------------------------------------------------------- - -#include "sub.h" - -static void __FASTCALL__ select_frame(vo_data_t*vo, unsigned idx ) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); -#ifdef HAVE_DGA2 - XDGASetViewport (vo->mDisplay, XDefaultScreen(vo->mDisplay), - 0, priv.dbf_y_offset[idx], - XDGAFlipRetrace); -#else - XF86DGASetViewPort (vo->mDisplay, XDefaultScreen(vo->mDisplay), - 0, priv.dbf_y_offset[idx]); -#endif -} - -//--------------------------------------------------------- - -static const vo_info_t* get_info(const vo_data_t* vo ) -{ - UNUSED(vo); - return &vo_info; -} - -//--------------------------------------------------------- - -static MPXP_Rc __FASTCALL__ query_format(vo_data_t*vo, vo_query_fourcc_t *fourcc ) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); -#ifdef HAVE_DGA2 - XDGAMode *modelines; - int modecount; -#endif - Display *qdisp; - - unsigned i; - static int dga_depths_init = 0; - - if(dga_depths_init == 0) { - if((qdisp = XOpenDisplay(0))==NULL) { - MSG_ERR( "vo_dga: Can't open display!\n"); - return MPXP_False; - } - priv.udf_screenw = vo_conf.screenwidth; - priv.udf_screenh = vo_conf.screenheight; - if(vo_x11_init(vo)!=MPXP_Ok){ - MSG_ERR( "vo_dga: vo_x11_init() failed!\n"); - return MPXP_False; - } - priv.XServer_mode = vd_ValidateMode(vo->depthonscreen); - - if(priv.XServer_mode ==0){ -#ifndef HAVE_DGA2 - MSG_ERR( "vo_dga: Your X-Server is not running in a "); - MSG_ERR( "resolution supported by DGA driver!\n"); -#endif - } - -#ifdef HAVE_DGA2 - modelines=XDGAQueryModes(qdisp, XDefaultScreen(qdisp),&modecount); - if(modelines) { - for(i=0; i< modecount; i++){ - MSG_DBG2( "vo_dga: (%03d) depth=%d, bpp=%d, r=%08x, g=%08x, b=%08x, %d x %d\n", - i, - modelines[i].depth, - modelines[i].bitsPerPixel, - modelines[i].redMask, - modelines[i].greenMask, - modelines[i].blueMask, - modelines[i].viewportWidth, - modelines[i].viewportHeight); - vd_EnableMode( - modelines[i].depth, - modelines[i].bitsPerPixel, - modelines[i].redMask, - modelines[i].greenMask, - modelines[i].blueMask); - } - XFree(modelines); - } -#endif - dga_depths_init = 1; - XCloseDisplay(qdisp); - - if( !vo_dga_modes[1].vdm_supported && vo_dga_modes[2].vdm_supported ) { - vo_dga_modes[1].vdm_supported = 1; - } - - if( !vo_dga_modes[3].vdm_supported && vo_dga_modes[4].vdm_supported ) { - vo_dga_modes[3].vdm_supported = 1; - } - - for(i=1; i<vo_dga_mode_num; i++) { - MSG_V( "vo_dga: Mode: %s", vd_GetModeString(i)); - if(vo_conf.dbpp && vo_conf.dbpp != vo_dga_modes[i].vdm_mplayer_depth) { - vo_dga_modes[i].vdm_supported = 0; - MSG_V( " ...disabled by -bpp %d", vo_conf.dbpp ); - } - MSG_V( "\n"); - } - } - fourcc->flags=VOCAP_NA; - switch(fourcc->fourcc) { - case IMGFMT_BGR15: if(vo_dga_modes[1].vdm_supported != 0) fourcc->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR16: if(vo_dga_modes[2].vdm_supported != 0) fourcc->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR24: if(vo_dga_modes[3].vdm_supported != 0) fourcc->flags=VOCAP_SUPPORTED; break; - case IMGFMT_BGR32: if(vo_dga_modes[4].vdm_supported != 0) fourcc->flags=VOCAP_SUPPORTED; break; - default: break; - } - return MPXP_Ok; -} - -//--------------------------------------------------------- - -static void uninit(vo_data_t*vo) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); -#ifdef HAVE_DGA2 - XDGADevice *dgadevice; -#endif - - if(priv.is_running) { - priv.is_running = 0; - MSG_DBG2( "vo_dga: in uninit\n"); - XUngrabPointer (vo->mDisplay, CurrentTime); - XUngrabKeyboard (vo->mDisplay, CurrentTime); -#ifdef HAVE_DGA2 - XDGACloseFramebuffer(vo->mDisplay, XDefaultScreen(vo->mDisplay)); - dgadevice = XDGASetMode(vo->mDisplay, XDefaultScreen(vo->mDisplay), 0); - if(dgadevice != NULL){ - XFree(dgadevice); - } -#else - XF86DGADirectVideo (vo->mDisplay, XDefaultScreen(vo->mDisplay), 0); - // first disable DirectVideo and then switch mode back! -#ifdef HAVE_XF86VM - if (priv.vidmodes != NULL ){ - int screen; - screen=XDefaultScreen( vo->mDisplay ); - MSG_DBG2( "vo_dga: VidModeExt: Switching back..\n"); - // seems some graphics adaptors need this more than once ... - XF86VidModeSwitchToMode(vo->mDisplay,screen,priv.vidmodes[0]); - XF86VidModeSwitchToMode(vo->mDisplay,screen,priv.vidmodes[0]); - XF86VidModeSwitchToMode(vo->mDisplay,screen,priv.vidmodes[0]); - XF86VidModeSwitchToMode(vo->mDisplay,screen,priv.vidmodes[0]); - XFree(priv.vidmodes); - } -#endif -#endif - XCloseDisplay(vo->mDisplay); - } - delete vo->priv; -} - -/*----------------------------------------------------------*/ -/* NK: since multibuffering maxY is meaningless */ -static int __FASTCALL__ check_res( int num, int x, int y, int bpp, - int new_x, int new_y, int new_vbi, int new_maxy, - int *old_x, int *old_y, int *old_vbi, int *old_maxy) { - -// MSG_V( "vo_dga: (%3d) Trying %4d x %4d @ %3d Hz @ depth %2d ..", -// num, new_x, new_y, new_vbi, bpp ); -// MSG_V( "%dx%d (old: %dx%d@%d).", x, y, *old_x, *old_y, *old_vbi); - if(new_x >= x && new_y >= y) { - /* NK: TODO: check for BPP of video mode and select the best */ - if( - (new_x < *old_x && new_y < *old_y) - || ((new_x == *old_x || new_y == *old_y) && new_vbi >= *old_vbi) - ) { - *old_x = new_x; - *old_y = new_y; - *old_maxy = new_maxy; - *old_vbi = new_vbi; - MSG_V( ".ok!!\n"); - return 1; - } - } - MSG_V( ".no\n"); - return 0; -} - -/*---------------------------------------------------------*/ - -#ifdef HAVE_DGA2 -static int __FASTCALL__ dga2_find_best_mode(vo_data_t*vo,unsigned wanted_width,unsigned wanted_height) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - XDGAMode *modelines=NULL; - unsigned i,j=0; - int mVBI=100000, mMaxY=0,mX=VO_DGA_INVALID_RES, mY=VO_DGA_INVALID_RES,modecount; - int dga_modenum; - - modelines=XDGAQueryModes(vo->mDisplay, XDefaultScreen(vo->mDisplay),&modecount); - - MSG_DBG2("vo_dga: modelines=%p, modecount=%d\n", modelines, modecount); - - if (modelines == NULL) { - MSG_ERR( "vo_dga: can't get modelines\n"); - /* no mode is available */ - return -1; - } - - MSG_V("vo_dga: DGA 2.0 available! Can switch resolution AND depth!\n"); - - for (i=0; i<unsigned(modecount); i++) { - MSG_V("vo_dga: Trying hardware mode (%s) %ux%u@(depth %2d, bitspp %2d) *%3.2fHz [stride=%u]\n" - ,modelines[i].name - ,modelines[i].viewportWidth - ,modelines[i].viewportHeight - ,modelines[i].depth - ,modelines[i].bitsPerPixel - ,modelines[i].verticalRefresh - ,modelines[i].bytesPerScanline/((modelines[i].bitsPerPixel+7)/8)); - if(vd_ModeEqual( modelines[i].depth, - modelines[i].bitsPerPixel, - modelines[i].redMask, - modelines[i].greenMask, - modelines[i].blueMask, - priv.hw_mode)) { - MSG_DBG2( "maxy: %4d, depth: %2d, %4dx%4d, ", - modelines[i].maxViewportY, modelines[i].depth, - modelines[i].imageWidth, modelines[i].imageHeight ); - if ( check_res(i, wanted_width, wanted_height, modelines[i].depth, - modelines[i].viewportWidth, - modelines[i].viewportHeight, - (unsigned) modelines[i].verticalRefresh, - modelines[i].maxViewportY, - &mX, &mY, &mVBI, &mMaxY )) j = i; - } - } - MSG_V("vo_dga: Found hardware mode (%s) %ux%u@(depth %2d, bitspp %2d) *%3.2fHz [stride=%u]\n" - ,modelines[j].name - ,modelines[j].viewportWidth - ,modelines[j].viewportHeight - ,modelines[j].depth - ,modelines[j].bitsPerPixel - ,modelines[j].verticalRefresh - ,modelines[j].bytesPerScanline/((modelines[j].bitsPerPixel+7)/8)); - - priv.vp_width = mX; - priv.vp_height = mY; - - priv.width = modelines[j].bytesPerScanline / HW_MODE(priv).vdm_bytespp ; - dga_modenum = modelines[j].num; - - XFree(modelines); - return dga_modenum; -} - -static int __FASTCALL__ dga2_select_mode(vo_data_t*vo, int dga_modenum ) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - XDGADevice *dgadevice; - int bank, ram_size; - if (!XDGAOpenFramebuffer(vo->mDisplay, XDefaultScreen(vo->mDisplay))){ - MSG_ERR( "vo_dga: Framebuffer mapping failed!!!\n"); - XCloseDisplay(vo->mDisplay); - return 1; - } - if(dga_modenum != -1) { - dgadevice=XDGASetMode(vo->mDisplay, XDefaultScreen(vo->mDisplay), dga_modenum); - XDGASync(vo->mDisplay, XDefaultScreen(vo->mDisplay)); - priv.base = dgadevice->data; - XFree(dgadevice); - } - else XF86DGAGetVideo (vo->mDisplay, XDefaultScreen(vo->mDisplay), - (char **)&priv.base, reinterpret_cast<int*>(&priv.width), - &bank, &ram_size); - XDGASetViewport (vo->mDisplay, XDefaultScreen(vo->mDisplay), 0, 0, XDGAFlipRetrace); - return 0; -} -#else - -#ifdef HAVE_XF86VM -static int __FASTCALL__ xf86vm_find_best_mode(vo_data_t*vo,unsigned wanted_width,unsigned wanted_height) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - unsigned vm_event, vm_error; - unsigned vm_ver, vm_rev; - int i, j=0, have_vm=0; - int modecount, mX=VO_DGA_INVALID_RES, mY=VO_DGA_INVALID_RES, mVBI=100000, mMaxY=0, dga_modenum=-1; - - MSG_V("vo_dga: DGA 1.0 compatibility code: Using XF86VidMode for mode switching!\n"); - - if (XF86VidModeQueryExtension(vo->mDisplay, &vm_event, &vm_error)) { - XF86VidModeQueryVersion(vo->mDisplay, &vm_ver, &vm_rev); - MSG_V( "vo_dga: XF86VidMode Extension v%i.%i\n", vm_ver, vm_rev); - have_vm=1; - } else { - MSG_ERR( "vo_dga: XF86VidMode Extension not available.\n"); - return -1; - } - -#define GET_VREFRESH(dotclk, x, y)( (((dotclk)/(x))*1000)/(y) ) - - if (have_vm) { - int screen; - screen=XDefaultScreen(vo->mDisplay); - XF86VidModeGetAllModeLines(vo->mDisplay,screen,&modecount,&priv.vidmodes); - - if(priv.vidmodes != NULL ){ - for (i=0; i<modecount; i++){ - if ( check_res( i, wanted_width, wanted_height, - vo_dga_modes[priv.hw_mode].vdm_depth, - priv.vidmodes[i]->hdisplay, - priv.vidmodes[i]->vdisplay, - GET_VREFRESH(priv.vidmodes[i]->dotclock, - priv.vidmodes[i]->htotal, - priv.vidmodes[i]->vtotal), - 0, - &mX, &mY, &mVBI, &mMaxY )) j = i; - } - MSG_V("vo_dga: Selected video mode %4d x %4d @ %3d Hz @ depth %2d, bitspp %2d\n", - mX, mY, mVBI, - vo_dga_modes[priv.hw_mode].vdm_depth, - vo_dga_modes[priv.hw_mode].vdm_bitspp); - } else { - MSG_V( "vo_dga: XF86VidMode returned no screens - using current resolution.\n"); - } - dga_modenum = j; - priv.vp_width = mX; - priv.vp_height = mY; - } - return dga_modenum; -} - -static void __FASTCALL__ xf86vm_select_mode(vo_data_t*vo, int dga_modenum ) -{ - if (dga_modenum != -1) { - XF86VidModeLockModeSwitch(vo->mDisplay,XDefaultScreen(vo->mDisplay),0); - /* Two calls are needed to switch modes on my ATI Rage 128. Why? - for riva128 one call is enough! */ - XF86VidModeSwitchToMode(vo->mDisplay,XDefaultScreen(vo->mDisplay),priv.vidmodes[dga_modenum]); - XF86VidModeSwitchToMode(vo->mDisplay,XDefaultScreen(vo->mDisplay),priv.vidmodes[dga_modenum]); - } -} -#endif -#endif - -static MPXP_Rc __FASTCALL__ config(vo_data_t*vo, uint32_t width,uint32_t height, - uint32_t d_width,uint32_t d_height, - uint32_t flags,char *title,uint32_t format) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - unsigned wanted_width, wanted_height; - int dga_modenum; - int bank,ram_size; - unsigned dest_frame_size,freq; - int mX,mY; - - UNUSED(title); - if( priv.is_running ) return MPXP_False; - - priv.src_format = format; - priv.src_width = priv.dest_width = width; - priv.src_height = priv.dest_height = height; - - wanted_width = d_width; - wanted_height = d_height; - - if(!wanted_height) wanted_height = height; - if(!wanted_width) wanted_width = width; - - if(priv.udf_screenw) wanted_width = priv.udf_screenw; - if(priv.udf_screenh) wanted_height = priv.udf_screenh; - - if(vo_x11_init(vo)!=MPXP_Ok) { - MSG_ERR( "vo_dga: vo_x11_init() failed!\n"); - return MPXP_False; - } - - if(!vo_conf.dbpp ) priv.src_mode = priv.XServer_mode; - else priv.src_mode = vd_ModeValid(vo_conf.dbpp); - - priv.hw_mode = SRC_MODE(priv).vdm_hw_mode; - - if(priv.src_mode != priv.hw_mode ){ - MSG_ERR("vo_dga: swScaler supports native modes only. Using %d instead of selected %d.\n", - HW_MODE(priv).vdm_mplayer_depth, - SRC_MODE(priv).vdm_mplayer_depth ); - priv.src_mode = priv.hw_mode; - } - - if(!priv.src_mode) { - MSG_ERR( "vo_dga: unsupported video format!\n"); - return MPXP_False; - } - - if((vo->mDisplay = XOpenDisplay(0))==NULL) { - MSG_ERR( "vo_dga: Can't open display\n"); - return MPXP_False; - } - -// choose a suitable mode ... - -#ifdef HAVE_DGA2 - dga_modenum = dga2_find_best_mode(vo,wanted_width,wanted_height); -#else -#ifdef HAVE_XF86VM - dga_modenum = xf86vm_find_best_mode(wanted_width,wanted_height); -#else - UNUSED(dga_modenum); - MSG_V( "vo_dga: Only have DGA 1.0 extension and no XF86VidMode :-(\n" - " Thus, resolution switching is NOT possible.\n"); -#endif -#endif - MSG_V("vo_dga: Video parameters by codec: %3d x %3d, depth %2d, bitspp %2d.\n", - width, height, - SRC_MODE(priv).vdm_depth, - SRC_MODE(priv).vdm_bitspp); -/* now lets start the DGA thing */ -#ifdef HAVE_DGA2 - if(dga2_select_mode(vo,dga_modenum)) return MPXP_False; -#else - -#ifdef HAVE_XF86VM - xf86vm_select_mode(dga_modenum); -#endif - XF86DGADirectVideo (vo->mDisplay, XDefaultScreen(vo->mDisplay), - XF86DGADirectGraphics | XF86DGADirectMouse | - XF86DGADirectKeyb); - - XF86DGASetViewPort (vo->mDisplay, XDefaultScreen(vo->mDisplay), 0, 0); -#endif - /* for both DGA1 and DGA2 we need to know ram_size */ - XF86DGAGetVideo (vo->mDisplay, XDefaultScreen(vo->mDisplay), - (char **)&priv.base, reinterpret_cast<int*>(&priv.vp_width), - &bank, &ram_size); - - XF86DGAGetViewPortSize(vo->mDisplay,DefaultScreen(vo->mDisplay),&mX,&mY); - priv.vp_width = mX; - priv.vp_height = mY; - - MSG_DBG2( "vo_dga: XServer res: %dx%d\n", - priv.vp_width, priv.vp_height); - - if(priv.dest_width > priv.vp_width || priv.dest_height > priv.vp_height) { - MSG_ERR( "vo_dga: Sorry, video larger than viewport is not yet supported!\n"); - // ugly, do something nicer in the future ... -#ifndef HAVE_DGA2 -#ifdef HAVE_XF86VM - if(priv.vidmodes){ - XFree(priv.vidmodes); - priv.vidmodes = NULL; - } -#endif -#endif - return MPXP_False; - } - - if((flags&0x04)||(flags&0x01)) { /* -zoom or -fs */ - priv.dest_width = d_width; - priv.dest_height = d_height; - - aspect_save_orig(priv.src_width,priv.src_height); - aspect_save_screenres(mX,mY); - aspect_save_prescale(priv.dest_width,priv.dest_height); - if((flags&0x05)==0x05) /* -fs -zoom */ - aspect(&priv.dest_width,&priv.dest_height,A_ZOOM); - else if(flags&0x04)/* -zoom */ - aspect(&priv.dest_width,&priv.dest_height,A_NOZOOM); - else { /* -fs */ - priv.dest_width = mX; - priv.dest_height = mY; - } - MSG_V("vo_dga: Aspect corrected size for SwScaler: %4d x %4d.\n", - priv.dest_width, priv.dest_height); - } - switch(HW_MODE(priv).vdm_bitspp) { - case 32: priv.dstFourcc = IMGFMT_BGR32; break; - case 24: priv.dstFourcc = IMGFMT_BGR24; break; - case 15: priv.dstFourcc = IMGFMT_BGR15; break; - default: priv.dstFourcc = IMGFMT_BGR16; break; - } - - MSG_DBG2( "vo_dga: bytes/line: %d, screen res: %dx%d, depth: %d, base: %08x, bpp: %d\n", - priv.width, priv.vp_width, - priv.vp_height, HW_MODE(priv).vdm_bytespp, priv.base, - HW_MODE(priv).vdm_bitspp); - - priv.x_off = (priv.vp_width - priv.dest_width)>>1; - priv.y_offset = priv.y_off = (priv.vp_height - priv.dest_height)>>1; - priv.vp_offset = (priv.y_off * priv.width + priv.x_off ) * HW_MODE(priv).vdm_bytespp; - - MSG_DBG2( "vo_dga: vp_off=%d\n", priv.vp_offset); - - XGrabKeyboard (vo->mDisplay, DefaultRootWindow(vo->mDisplay), True, - GrabModeAsync,GrabModeAsync, CurrentTime); - XGrabPointer (vo->mDisplay, DefaultRootWindow(vo->mDisplay), True, - ButtonPressMask,GrabModeAsync, GrabModeAsync, - None, None, CurrentTime); -// TODO: check if mem of graphics adaptor is large enough for dbf - -// set up variables for double buffering ... - priv.dbf_y_offset[0] = 0; - priv.dbf_mem_offset[0] = 0; - dest_frame_size = priv.width*HW_MODE(priv).vdm_bytespp*priv.vp_height; - - priv.num_buffers = (ram_size*1024)/dest_frame_size; - if(priv.num_buffers > vo_conf.xp_buffs) priv.num_buffers = vo_conf.xp_buffs; - if(priv.num_buffers > MAX_DRI_BUFFERS) priv.num_buffers = MAX_DRI_BUFFERS; - - for(freq=1;freq<priv.num_buffers;freq++) { - priv.dbf_y_offset[freq] = priv.dbf_y_offset[freq-1] + priv.vp_height; - priv.dbf_mem_offset[freq] = priv.dbf_mem_offset[freq-1] + dest_frame_size; - } - - /* clear screen */ - for(freq=0;freq<priv.num_buffers;freq++) { - any_t*d; - d=(&((char*)priv.base)[priv.dbf_mem_offset[freq]]); - memset(d,0,dest_frame_size); - } - MSG_V("vo_dga: Doublebuffering is %s.\n",priv.num_buffers>1?"enabled":"disabled"); - priv.is_running = 1; - return MPXP_Ok; -} - -static MPXP_Rc __FASTCALL__ preinit(vo_data_t*vo,const char *arg) -{ - if(arg) { - MSG_V( "vo_dga: Unknown subdevice: %s\n",arg); - return MPXP_False; - } - dga_priv_t*priv=new(zeromem) dga_priv_t; - vo->priv=priv; - return MPXP_Ok; -} - -static void __FASTCALL__ dga_dri_get_surface_caps(vo_data_t*vo,dri_surface_cap_t *caps) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - caps->caps = DRI_CAP_VIDEO_MMAPED; - caps->fourcc=priv.dstFourcc; - caps->width=priv.vp_width; - caps->height=priv.vp_height; - caps->x=priv.x_off; - caps->y=priv.y_off; - caps->w=priv.dest_width; - caps->h=priv.dest_height; - caps->strides[0] = priv.width*((HW_MODE(priv).vdm_bitspp+7)/8); - caps->strides[1] = 0; - caps->strides[2] = 0; - caps->strides[3] = 0; -} - -static void __FASTCALL__ dga_dri_get_surface(vo_data_t*vo,dri_surface_t *surf) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - surf->planes[0] = priv.base + priv.dbf_mem_offset[surf->idx]; - surf->planes[1] = 0; - surf->planes[2] = 0; - surf->planes[3] = 0; -} - -static MPXP_Rc __FASTCALL__ control(vo_data_t*vo,uint32_t request, any_t*data) -{ - dga_priv_t& priv = *static_cast<dga_priv_t*>(vo->priv); - switch (request) { - case VOCTRL_QUERY_FORMAT: - return query_format(vo,(vo_query_fourcc_t*)data); - case VOCTRL_CHECK_EVENTS: - check_events(vo); - (*(vo_resize_t *)data).event_type = 0; /* VO_EVENT_RESIZE is meaningless here */ - return MPXP_True; - case VOCTRL_GET_NUM_FRAMES: - *(uint32_t *)data = priv.num_buffers; - return MPXP_True; - case DRI_GET_SURFACE_CAPS: - dga_dri_get_surface_caps(vo,reinterpret_cast<dri_surface_cap_t*>(data)); - return MPXP_True; - case DRI_GET_SURFACE: - dga_dri_get_surface(vo,reinterpret_cast<dri_surface_t*>(data)); - return MPXP_True; - } - return MPXP_NA; -} Modified: mplayerxp/libvo/vo_opengl.cpp =================================================================== --- mplayerxp/libvo/vo_opengl.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/vo_opengl.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -41,11 +41,8 @@ #include <GL/gl.h> #include "w32_common.h" #else -#include <GL/gl.h> #include <X11/Xlib.h> -#include <GL/glx.h> -#include <GL/glut.h> -#include "x11_common.h" +#include "x11_system.h" #endif #include "aspect.h" @@ -80,8 +77,10 @@ unsigned depth,bpp,out_mode; unsigned num_buffers; // 1 - default - any_t* glx_context; uint32_t gl_out_format,out_format; +#ifdef HAVE_X11 + GLX_System* glx; +#endif }; ogl_priv_t::ogl_priv_t() { @@ -94,17 +93,6 @@ return(&vo_info); } -static XVisualInfo *get_visual_info(Display *dpy, Window win) -{ - XWindowAttributes wattr; - XVisualInfo vi_template; - int dummy; - - XGetWindowAttributes(dpy, win, &wattr); - vi_template.visualid = XVisualIDFromVisual(wattr.visual); - return XGetVisualInfo(dpy, VisualIDMask, &vi_template, &dummy); -} - static void gl_init_fb(vo_data_t*vo,unsigned x,unsigned y,unsigned d_width,unsigned d_height) { ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); @@ -143,7 +131,6 @@ } static void resize(vo_data_t*vo,int x,int y){ - ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); MSG_V("[gl] Resize: %dx%d\n",x,y); gl_init_fb(vo, 0, 0, x, y ); glClear(GL_COLOR_BUFFER_BIT); @@ -155,14 +142,11 @@ static MPXP_Rc __FASTCALL__ config(vo_data_t*vo,uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); + GLX_System& glx = *priv.glx; int is_bgr; - const char *hello = (title == NULL) ? "Glx render" : title; XSizeHints hint; + unsigned i; - XGCValues xgcv; - XSetWindowAttributes xswa; - unsigned long xswamask,i; - aspect_save_orig(width,height); aspect_save_prescale(d_width,d_height); @@ -176,76 +160,47 @@ aspect_save_screenres(vo_conf.screenwidth,vo_conf.screenheight); aspect(&d_width,&d_height,vo_ZOOM(vo)?A_ZOOM:A_NOZOOM); - vo_x11_calcpos(vo,&hint,d_width,d_height,flags); - hint.flags = PPosition | PSize; + glx.calcpos(vo,&hint,d_width,d_height,flags); + hint.flags = PPosition | PSize; priv.dwidth=d_width; priv.dheight=d_height; //XXX: what are the copy vars used for? - XGetWindowAttributes(vo->mDisplay, DefaultRootWindow(vo->mDisplay), &priv.attribs); - priv.depth=priv.attribs.depth; - if (priv.depth != 15 && priv.depth != 16 && priv.depth != 24 && priv.depth != 32) priv.depth = 24; - XMatchVisualInfo(vo->mDisplay, vo->mScreen, priv.depth, TrueColor, &priv.vinfo); + priv.depth=glx.depth(); - xswa.background_pixel = 0; - xswa.border_pixel = 0; - xswamask = CWBackPixel | CWBorderPixel; + if (priv.depth != 15 && priv.depth != 16 && priv.depth != 24 && priv.depth != 32) + priv.depth = 24; + glx.match_visual( &priv.vinfo); - vo->window = XCreateWindow( vo->mDisplay, RootWindow(vo->mDisplay,vo->mScreen), - hint.x, hint.y, hint.width, hint.height, - 0, priv.depth,CopyFromParent,priv.vinfo.visual,xswamask,&xswa); + glx.create_window(hint,priv.vinfo.visual,vo_VM(vo),priv.depth,title); - vo_x11_classhint( vo->mDisplay,vo->window,"opengl" ); - vo_x11_hidecursor(vo->mDisplay,vo->window); + glx.classhint("opengl"); + glx.hidecursor(); - XSelectInput(vo->mDisplay, vo->window, - StructureNotifyMask | KeyPressMask | PointerMotionMask | - ButtonPressMask | ButtonReleaseMask ); - XSetStandardProperties(vo->mDisplay, vo->window, hello, hello, None, NULL, 0, &hint); - if ( vo_FS(vo) ) vo_x11_decoration(vo, vo->mDisplay,vo->window,0 ); - XMapWindow(vo->mDisplay, vo->window); -#ifdef HAVE_XINERAMA - vo_x11_xinerama_move(vo,vo->mDisplay,vo->window,&hint); -#endif - vo->gc = XCreateGC(vo->mDisplay, vo->window, 0L, &xgcv); - XFlush(vo->mDisplay); - XSync(vo->mDisplay, False); -#ifdef HAVE_XF86VM - if ( vo_VM(vo) ) { - /* Grab the mouse pointer in our window */ - XGrabPointer( vo->mDisplay, vo->window, True, 0, - GrabModeAsync, GrabModeAsync, - vo->window, None, CurrentTime); - XSetInputFocus(vo->mDisplay, vo->window, RevertToNone, CurrentTime); - } -#endif + if ( vo_FS(vo) ) glx.decoration(0); + + /* we cannot grab mouse events on root window :( */ + glx.select_input(StructureNotifyMask | KeyPressMask | + ButtonPressMask | ButtonReleaseMask | PointerMotionMask); #ifdef GL_WIN32 if (!vo_w32_config(d_width, d_height, flags)) return MPXP_False; #else { XVisualInfo *vi; - vi = get_visual_info(vo->mDisplay, vo->window); + vi = glx.get_visual(); if (vi == NULL) { MSG_ERR("[vo_oengl]: Can't get XVisualInfo\n"); return MPXP_False; } - priv.glx_context = glXCreateContext(vo->mDisplay, vi, NULL, True); + glx.create_context(vi); XFree(vi); - if (priv.glx_context == NULL) { - MSG_ERR("[vo_oengl]: Can't create GLX context\n"); - return MPXP_False; - } - if (!glXMakeCurrent(vo->mDisplay, vo->window, reinterpret_cast<__GLXcontextRec*>(priv.glx_context))) { - MSG_ERR("[vo_oengl]: Can't make GLX context current\n"); - return MPXP_False; - } } #endif gl_init_fb(vo,0,0,d_width,d_height); /* allocate multibuffers */ - for(i=0;i<priv.num_buffers;i++) vo_x11_getMyXImage(vo,i,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); + for(i=0;i<priv.num_buffers;i++) glx.getMyXImage(i,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); priv.out_mode=GL_RGB; - XImage *ximg=vo_x11_Image(vo,0); + XImage *ximg=glx.Image(0); is_bgr=(ximg->blue_mask&0x01)!=0; switch ((priv.bpp=ximg->bits_per_pixel)){ case 32:priv.out_mode=GL_RGBA; @@ -263,13 +218,14 @@ break; default: break; } - saver_off(vo,vo->mDisplay); return MPXP_Ok; } static uint32_t __FASTCALL__ check_events(vo_data_t*vo,vo_adjust_size_t adjust_size) { - int e=vo_x11_check_events(vo,vo->mDisplay,adjust_size); + ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); + GLX_System& glx = *priv.glx; + int e=glx.check_events(vo,adjust_size); if(e&VO_EVENT_RESIZE) resize(vo,vo->dest.w,vo->dest.h); return e|VO_EVENT_FORCE_UPDATE; } @@ -286,9 +242,10 @@ static void select_frame(vo_data_t*vo,unsigned idx) { ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); + GLX_System& glx = *priv.glx; - gl_display_Image(vo,vo_x11_Image(vo,idx)); - if (priv.num_buffers>1) glXSwapBuffers(vo->mDisplay, vo->window); + gl_display_Image(vo,glx.Image(idx)); + if (priv.num_buffers>1) glx.swap_buffers(); glFlush(); return; } @@ -309,17 +266,16 @@ static void uninit(vo_data_t*vo) { ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); + GLX_System& glx = *priv.glx; unsigned i; // if (!vo_config_count) return; glFinish(); - glXMakeCurrent(vo->mDisplay, None, NULL); - glXDestroyContext(vo->mDisplay, reinterpret_cast<__GLXcontextRec*>(priv.glx_context)); - for(i=0;i<priv.num_buffers;i++) vo_x11_freeMyXImage(vo,i); - saver_on(vo,vo->mDisplay); // screen saver back on + glx.destroy_context(); + for(i=0;i<priv.num_buffers;i++) glx.freeMyXImage(i); + glx.saver_on(); // screen saver back on #ifdef HAVE_XF86VM - vo_vm_close(vo,vo->mDisplay); + glx.vm_close(); #endif - vo_x11_uninit(vo,vo->mDisplay, vo->window); delete vo->priv; } @@ -329,7 +285,8 @@ priv=new(zeromem) ogl_priv_t; vo->priv=priv; UNUSED(arg); - if (vo_x11_init(vo)!=MPXP_Ok) return MPXP_False; + priv->glx=new(zeromem) GLX_System(vo_conf.mDisplayName); + priv->glx->saver_off(); return MPXP_Ok; } @@ -355,8 +312,8 @@ static void __FASTCALL__ gl_dri_get_surface(const vo_data_t*vo,dri_surface_t *surf) { ogl_priv_t& priv = *static_cast<ogl_priv_t*>(vo->priv); - UNUSED(priv); - surf->planes[0] = vo_x11_ImageData(vo,surf->idx); + GLX_System& glx = *priv.glx; + surf->planes[0] = glx.ImageData(surf->idx); surf->planes[1] = 0; surf->planes[2] = 0; surf->planes[3] = 0; Modified: mplayerxp/libvo/vo_sdl.cpp =================================================================== --- mplayerxp/libvo/vo_sdl.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/vo_sdl.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -121,7 +121,7 @@ #ifdef HAVE_X11 #include <X11/Xlib.h> -#include "x11_common.h" +#include "x11_system.h" #endif #include "input2/input.h" @@ -242,6 +242,9 @@ const char * vidix_name; vidix_server_t* vidix_server; #endif +#ifdef HAVE_X11 + X11_System* x11; +#endif }; sdl_priv_t::sdl_priv_t() { @@ -1161,15 +1164,17 @@ static void uninit(vo_data_t*vo) { + sdl_priv_t& priv = *static_cast<sdl_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; #ifdef HAVE_X11 - saver_on(vo,vo->mDisplay); - vo_x11_uninit(vo,vo->mDisplay, vo->window); + x11.saver_on(); #endif sdl_close(vo); #ifdef CONFIG_VIDIX - vidix_term(vo); - sdl_priv_t& priv = *static_cast<sdl_priv_t*>(vo->priv); - delete priv.vidix_server; + if(priv.vidix_name) { + vidix_term(vo); + delete priv.vidix_server; + } #endif delete vo->priv; } @@ -1180,8 +1185,8 @@ vo->priv=priv; if(arg) strcpy(sdl_subdevice,arg); #ifdef HAVE_X11 - if(vo_x11_init(vo)!=MPXP_Ok) return MPXP_False; // Can't open X11 - saver_off(vo,vo->mDisplay); + priv->x11=new(zeromem) X11_System(vo_conf.mDisplayName); + priv->x11->saver_off(); #endif return sdl_open(vo); } Modified: mplayerxp/libvo/vo_x11.cpp =================================================================== --- mplayerxp/libvo/vo_x11.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/vo_x11.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -2,7 +2,6 @@ #include "osdep/mplib.h" using namespace mpxp; -#define DISP /* * video_out_x11.c,X11 interface * @@ -37,7 +36,7 @@ #include <X11/extensions/xf86vmode.h> #endif -#include "x11_common.h" +#include "x11_system.h" #include "osdep/fastmemcpy.h" #include "sub.h" @@ -87,7 +86,6 @@ unsigned depth,bpp,mode; - XWindowAttributes attribs; XVisualInfo vinfo; int baseAspect; // 1<<16 based fixed point aspect, so that the aspect stays correct during resizing @@ -98,6 +96,7 @@ vidix_server_t* vidix_server; #endif uint32_t subdev_flags; + X11_System* x11; }; x11_priv_t::x11_priv_t() { @@ -105,14 +104,66 @@ subdev_flags = 0xFFFFFFFEUL; } +static uint32_t __FASTCALL__ parseSubDevice(vo_data_t*vo,const char *sd) +{ + x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + uint32_t flags; + flags = 0; #ifdef CONFIG_VIDIX + if(memcmp(sd,"vidix",5) == 0) priv.vidix_name = &sd[5]; /* priv.vidix_name will be valid within init() */ + else +#endif + { MSG_ERR("vo_vesa: Unknown subdevice: '%s'\n", sd); return 0xFFFFFFFFUL; } + return flags; +} + +static MPXP_Rc __FASTCALL__ preinit(vo_data_t*vo,const char *arg) +{ + MPXP_Rc vidix_err=MPXP_Ok; + x11_priv_t* priv; + priv=new(zeromem) x11_priv_t; + vo->priv=priv; + if(arg) priv->subdev_flags = parseSubDevice(vo,arg); +#ifdef CONFIG_VIDIX + if(priv->vidix_name) { + if(!(priv->vidix_server=vidix_preinit(vo,priv->vidix_name,&video_out_x11))) + vidix_err=MPXP_False; + } +#endif + priv->x11=new(zeromem) X11_System(vo_conf.mDisplayName); + priv->x11->saver_off(); + return vidix_err; +} + + +static void uninit(vo_data_t*vo) +{ + unsigned i; + x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; +#ifdef CONFIG_VIDIX + if(priv.vidix_name) vidix_term(vo); + delete priv.vidix_server; +#endif + for(i=0;i<priv.num_buffers;i++) x11.freeMyXImage(i); + x11.saver_on(); // screen saver back on + +#ifdef HAVE_XF86VM + x11.vm_close(); +#endif + delete &x11; + delete vo->priv; +} + +#ifdef CONFIG_VIDIX static void resize_vidix(vo_data_t* vo) { x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); - XWindowAttributes xwa; - XGetWindowAttributes(vo->mDisplay, vo->window, &xwa); + X11_System& x11 = *priv.x11; + vo_rect_t winc; + x11.get_win_coord(&winc); vidix_stop(vo); - if (vidix_init(vo,priv.image_width, priv.image_height, xwa.x, xwa.y, - xwa.width, xwa.height, priv.in_format, vo->depthonscreen, + if (vidix_init(vo,priv.image_width, priv.image_height, winc.x, winc.y, + winc.w, winc.h, priv.in_format, x11.depth(), vo_conf.screenwidth, vo_conf.screenheight) != MPXP_Ok) { MSG_FATAL( "Can't initialize VIDIX driver: %s: %s\n", @@ -128,19 +179,17 @@ static uint32_t __FASTCALL__ check_events(vo_data_t*vo,vo_adjust_size_t adjust_size) { x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); - uint32_t ret = vo_x11_check_events(vo,vo->mDisplay,adjust_size); + X11_System& x11 = *priv.x11; + uint32_t ret = x11.check_events(vo,adjust_size); - /* clear the old window */ - if (ret & VO_EVENT_RESIZE) - { + /* clear the old window */ + if (ret & VO_EVENT_RESIZE) { unsigned idx; unsigned newW= vo->dest.w; unsigned newH= vo->dest.h; int newAspect= (newW*(1<<16) + (newH>>1))/newH; if(newAspect>priv.baseAspect) newW= (newH*priv.baseAspect + (1<<15))>>16; else newH= ((newW<<16) + (priv.baseAspect>>1)) /priv.baseAspect; - XSetBackground(vo->mDisplay, vo->gc, 0); - XClearWindow(vo->mDisplay, vo->window); priv.image_width= (newW+7)&(~7); priv.image_height= newH; #ifdef CONFIG_VIDIX @@ -150,8 +199,8 @@ { vo_lock_surfaces(vo); for(idx=0;idx<priv.num_buffers;idx++) { - vo_x11_freeMyXImage(vo,idx); - vo_x11_getMyXImage(vo,idx,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); + x11.freeMyXImage(idx); + x11.getMyXImage(idx,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); } vo_unlock_surfaces(vo); } @@ -162,14 +211,9 @@ static MPXP_Rc __FASTCALL__ config(vo_data_t*vo,uint32_t width,uint32_t height,uint32_t d_width,uint32_t d_height,uint32_t flags,char *title,uint32_t format) { x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; // int interval, prefer_blank, allow_exp, nothing; - unsigned int fg,bg; XSizeHints hint; - XEvent xev; - XGCValues xgcv; - Colormap theCmap; - XSetWindowAttributes xswa; - unsigned long xswamask; unsigned i; priv.num_buffers=vo_conf.xp_buffs; @@ -179,12 +223,11 @@ priv.in_format=format; - XGetWindowAttributes( vo->mDisplay,DefaultRootWindow( vo->mDisplay ),&priv.attribs ); - priv.depth=priv.attribs.depth; + priv.depth=x11.depth(); + if ( priv.depth != 15 && priv.depth != 16 && priv.depth != 24 && priv.depth != 32 ) + priv.depth=24; + x11.match_visual( &priv.vinfo ); - if ( priv.depth != 15 && priv.depth != 16 && priv.depth != 24 && priv.depth != 32 ) priv.depth=24; - XMatchVisualInfo( vo->mDisplay,vo->mScreen,priv.depth,TrueColor,&priv.vinfo ); - priv.baseAspect= ((1<<16)*d_width + d_height/2)/d_height; aspect_save_orig(width,height); @@ -193,75 +236,33 @@ aspect(&d_width,&d_height,vo_FS(vo)?A_ZOOM:A_NOZOOM); - vo_x11_calcpos(vo,&hint,d_width,d_height,flags); + x11.calcpos(vo,&hint,d_width,d_height,flags); hint.flags=PPosition | PSize; - - bg=WhitePixel( vo->mDisplay,vo->mScreen ); - fg=BlackPixel( vo->mDisplay,vo->mScreen ); vo->dest.w=hint.width; vo->dest.h=hint.height; priv.image_width=d_width; priv.image_height=d_height; - theCmap =XCreateColormap( vo->mDisplay,RootWindow( vo->mDisplay,vo->mScreen ), - priv.vinfo.visual,AllocNone ); + x11.create_window(hint,priv.vinfo.visual,vo_VM(vo),priv.depth,title); - xswa.background_pixel=0; - xswa.border_pixel=0; - xswa.colormap=theCmap; - xswamask=CWBackPixel | CWBorderPixel | CWColormap; + x11.classhint("vo_x11"); + x11.hidecursor(); + if ( vo_FS(vo) ) x11.decoration(0); -#ifdef HAVE_XF86VM - if ( vo_VM(vo) ) { - xswa.override_redirect=True; - xswamask|=CWOverrideRedirect; - } -#endif - - vo->window=XCreateWindow( vo->mDisplay,RootWindow( vo->mDisplay,vo->mScreen ), - hint.x,hint.y, - hint.width,hint.height, - xswa.border_pixel,priv.depth,CopyFromParent,priv.vinfo.visual,xswamask,&xswa ); - vo_x11_classhint( vo->mDisplay,vo->window,"vo_x11" ); - vo_x11_hidecursor(vo->mDisplay,vo->window); - if ( vo_FS(vo) ) vo_x11_decoration(vo,vo->mDisplay,vo->window,0 ); - XSelectInput( vo->mDisplay,vo->window,StructureNotifyMask ); - XSetStandardProperties( vo->mDisplay,vo->window,title,title,None,NULL,0,&hint ); - XMapWindow( vo->mDisplay,vo->window ); -#ifdef HAVE_XINERAMA - vo_x11_xinerama_move(vo,vo->mDisplay,vo->window,&hint); -#endif - do { XNextEvent( vo->mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo->window ); - XSelectInput( vo->mDisplay,vo->window,NoEventMask ); - - XFlush( vo->mDisplay ); - XSync( vo->mDisplay,False ); - vo->gc=XCreateGC( vo->mDisplay,vo->window,0L,&xgcv ); - /* we cannot grab mouse events on root window :( */ - XSelectInput(vo->mDisplay,vo->window, - StructureNotifyMask | KeyPressMask | - ButtonPressMask | ButtonReleaseMask | PointerMotionMask); + x11.select_input(StructureNotifyMask | KeyPressMask | + ButtonPressMask | ButtonReleaseMask | PointerMotionMask); -#ifdef HAVE_XF86VM - if ( vo_VM(vo) ) { - /* Grab the mouse pointer in our window */ - XGrabPointer(vo->mDisplay, vo->window, True, 0, - GrabModeAsync, GrabModeAsync, - vo->window, None, CurrentTime); - XSetInputFocus(vo->mDisplay, vo->window, RevertToNone, CurrentTime); - } -#endif #ifdef CONFIG_VIDIX if(!priv.vidix_name) #endif - for(i=0;i<priv.num_buffers;i++) vo_x11_getMyXImage(vo,i,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); + for(i=0;i<priv.num_buffers;i++) x11.getMyXImage(i,priv.vinfo.visual,priv.depth,priv.image_width,priv.image_height); #ifdef CONFIG_VIDIX if(!priv.vidix_name) { #endif - XImage* ximg=vo_x11_Image(vo,0); + XImage* ximg=x11.Image(0); switch ((priv.bpp=ximg->bits_per_pixel)){ case 24: priv.out_format= IMGFMT_BGR24; break; case 32: priv.out_format= IMGFMT_BGR32; break; @@ -301,11 +302,11 @@ #endif #ifdef CONFIG_VIDIX if(priv.vidix_name) { - XWindowAttributes xwa; - XGetWindowAttributes(vo->mDisplay, vo->window, &xwa); - if(vidix_init(vo,priv.image_width,priv.image_height,xwa.x,xwa.y, - xwa.width,xwa.height, - priv.in_format,priv.depth, + vo_rect_t winc; + x11.get_win_coord(&winc); + if(vidix_init(vo,priv.image_width,priv.image_height,winc.x,winc.y, + winc.w,winc.h, + priv.in_format,x11.depth(), vo_conf.screenwidth,vo_conf.screenheight) != MPXP_Ok) { MSG_ERR("vo_vesa: Can't initialize VIDIX driver\n"); priv.vidix_name = NULL; @@ -324,7 +325,6 @@ } } #endif - saver_off(vo,vo->mDisplay); return MPXP_Ok; } @@ -336,36 +336,27 @@ static void __FASTCALL__ Display_Image(vo_data_t*vo,XImage *myximage ) { -#ifdef DISP -#ifdef HAVE_SHM - if( vo_x11_Shmem_Flag(vo)) { - XShmPutImage( vo->mDisplay,vo->window,vo->gc,myximage, - 0,0, - ( vo->dest.w - myximage->width ) / 2,( vo->dest.h - myximage->height ) / 2, - myximage->width,myximage->height,True ); - } - else -#endif - { - XPutImage( vo->mDisplay,vo->window,vo->gc,myximage, - 0,0, - ( vo->dest.w - myximage->width ) / 2,( vo->dest.h - myximage->height ) / 2, - myximage->width,myximage->height); - } -#endif + x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; + vo_rect_t r; + r.x=r.y=0; + r.w=(vo->dest.w-myximage->width)/2; + r.h=(vo->dest.h-myximage->height)/2; + x11.put_image(myximage,r); } static void __FASTCALL__ select_frame(vo_data_t*vo, unsigned idx ){ x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; #ifdef CONFIG_VIDIX if(priv.vidix_server) { priv.vidix_server->select_frame(vo,idx); return; } #endif - Display_Image(vo,vo_x11_Image(vo,idx)); - if (priv.num_buffers>1) XFlush(vo->mDisplay); - else XSync(vo->mDisplay, False); + Display_Image(vo,x11.Image(idx)); + if (priv.num_buffers>1) x11.flush(); + else x11.sync(False); return; } @@ -386,55 +377,6 @@ return MPXP_False; } - -static void uninit(vo_data_t*vo) -{ - unsigned i; - x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); -#ifdef CONFIG_VIDIX - if(priv.vidix_name) vidix_term(vo); - delete priv.vidix_server; -#endif - for(i=0;i<priv.num_buffers;i++) vo_x11_freeMyXImage(vo,i); - saver_on(vo,vo->mDisplay); // screen saver back on - -#ifdef HAVE_XF86VM - vo_vm_close(vo,vo->mDisplay); -#endif - vo_x11_uninit(vo,vo->mDisplay, vo->window); - delete vo->priv; -} - -static uint32_t __FASTCALL__ parseSubDevice(vo_data_t*vo,const char *sd) -{ - x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); - uint32_t flags; - flags = 0; -#ifdef CONFIG_VIDIX - if(memcmp(sd,"vidix",5) == 0) priv.vidix_name = &sd[5]; /* priv.vidix_name will be valid within init() */ - else -#endif - { MSG_ERR("vo_vesa: Unknown subdevice: '%s'\n", sd); return 0xFFFFFFFFUL; } - return flags; -} - -static MPXP_Rc __FASTCALL__ preinit(vo_data_t*vo,const char *arg) -{ - MPXP_Rc vidix_err=MPXP_Ok; - x11_priv_t* priv; - priv=new(zeromem) x11_priv_t; - vo->priv=priv; - if(arg) priv->subdev_flags = parseSubDevice(vo,arg); -#ifdef CONFIG_VIDIX - if(priv->vidix_name) { - if(!(priv->vidix_server=vidix_preinit(vo,priv->vidix_name,&video_out_x11))) - vidix_err=MPXP_False; - } -#endif - if(vo_x11_init(vo)!=MPXP_Ok) return MPXP_False; // Can't open X11 - return vidix_err; -} - static void __FASTCALL__ x11_dri_get_surface_caps(const vo_data_t*vo,dri_surface_cap_t *caps) { x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); @@ -454,8 +396,9 @@ static void __FASTCALL__ x11_dri_get_surface(const vo_data_t*vo,dri_surface_t *surf) { - UNUSED(vo); - surf->planes[0] = vo_x11_ImageData(vo,surf->idx); + x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; + surf->planes[0] = x11.ImageData(surf->idx); surf->planes[1] = 0; surf->planes[2] = 0; surf->planes[3] = 0; @@ -464,6 +407,7 @@ static MPXP_Rc __FASTCALL__ control(vo_data_t*vo,uint32_t request, any_t*data) { x11_priv_t& priv = *static_cast<x11_priv_t*>(vo->priv); + X11_System& x11 = *priv.x11; #ifdef CONFIG_VIDIX if(priv.vidix_server) if(priv.vidix_server->control(vo,request,data)==MPXP_Ok) return MPXP_Ok; @@ -478,7 +422,7 @@ return MPXP_True; } case VOCTRL_FULLSCREEN: - vo_x11_fullscreen(vo); + x11.fullscreen(vo); #ifdef CONFIG_VIDIX if(priv.vidix_name) resize_vidix(vo); #endif Modified: mplayerxp/libvo/vo_xv.cpp =================================================================== --- mplayerxp/libvo/vo_xv.cpp 2012-11-24 09:44:40 UTC (rev 447) +++ mplayerxp/libvo/vo_xv.cpp 2012-11-25 11:53:28 UTC (rev 448) @@ -29,10 +29,9 @@ #include <X11/Xlib.h> #include <X11/Xutil.h> -#include <X11/extensions/XShm.h> #include <errno.h> -#include "x11_common.h" +#include "x11_system.h" #include "osdep/fastmemcpy.h" #include "sub.h" @@ -40,11 +39,6 @@ #include "dri_vo.h" #include "xmpcore/mp_image.h" -#include <X11/extensions/Xv.h> -#include <X11/extensions/Xvlib.h> -#include <sys/ipc.h> -#include <sys/shm.h> -#include <X11/extensions/XShm.h> #include "vo_msg.h" static vo_info_t vo_info = @@ -70,196 +64,48 @@ uint32_t image_format; unsigned depth; - XWindowAttributes attribs; - XvAdaptorInfo* ai; - XvImageFormatValues*fo; - - unsigned int ver,rel,req,ev,err; unsigned int formats, adaptors, port, format, bpp; unsigned expose_idx,num_buffers; // 1 - default - XvImage* image[MAX_DRI_BUFFERS]; - XShmSegmentInfo Shminfo[MAX_DRI_BUFFERS]; + unsigned dwidth,dheight; - Window mRoot; - uint32_t drwX,drwY,drwWidth,drwHeight,drwBorderWidth,drwDepth; - uint32_t drwcX,drwcY,dwidth,dheight; + Xv_System* xv; }; xv_priv_t::xv_priv_t() { num_buffers=1; } -static int __FASTCALL__ xv_reset_video_eq(vo_data_t*vo) +static void set_gamma_correction( vo_data_t*vo ) { xv_priv_t& priv = *static_cast<xv_priv_t*>(vo->priv); - unsigned i; - XvAttribute *attributes; - int howmany,xv_atomka; - static int was_reset = 0; - /* get available attributes */ - attributes = XvQueryPortAttributes(vo->mDisplay, priv.port, &howmany); - /* first pass try reset */ - for (i = 0; (int)i < howmany && attributes; i++) { - if (attributes[i].flags & XvSettable && !strcmp(attributes[i].name,"XV_SET_DEFAULTS")) { - was_reset = 1; - MSG_DBG2("vo_xv: reset gamma correction\n"); - xv_atomka = XInternAtom(vo->mDisplay, attributes[i].name, True); - XvSetPortAttribute(vo->mDisplay, priv.port, xv_atomka, attributes[i].max_value); - } - } - return was_reset; + Xv_System& xv = *priv.xv; + vo_videq_t info; + /* try all */ + xv.reset_video_eq(); + info.name=VO_EC_BRIGHTNESS; + info.value=vo_conf.gamma.brightness; + xv.set_video_eq(&info); + info.name=VO_EC_CONTRAST; + info.value=vo_conf.gamma.contrast; + xv.set_video_eq(&info); + info.name=VO_EC_SATURATION; + info.value=vo_conf.gamma.saturation; + xv.set_video_eq(&info); + info.name=VO_EC_HUE; + info.value=vo_conf.gamma.hue; + xv.set_video_eq(&info); + info.name=VO_EC_RED_INTENSITY; + info.value=vo_conf.gamma.red_intensity; + xv.set_video_eq(&info); + info.name=VO_EC_GREEN_INTENSITY; + info.value=vo_conf.gamma.green_intensity; + xv.set_video_eq(&info); + info.name=VO_EC_BLUE_INTENSITY; + info.value=vo_conf.gamma.blue_intensity; + xv.set_video_eq(&info); } -static int __FASTCALL__ xv_set_video_eq(vo_data_t*vo,const vo_videq_t *info) -{ - xv_priv_t& priv = *static_cast<xv_priv_t*>(vo->priv); - unsigned i; - XvAttribute *attributes; - int howmany, xv_min,xv_max,xv_atomka; - /* get available attributes */ - attributes = XvQueryPortAttributes(vo->mDisplay, priv.port, &howmany); - for (i = 0; (int)i < howmany && attributes; i++) { - if (attributes[i].flags & XvSettable) { - xv_min = attributes[i].min_value; - xv_max = attributes[i].max_value; - xv_atomka = XInternAtom(vo->mDisplay, attributes[i].name, True); - /* since we have SET_DEFAULTS first in our list, we can check if it's available - then trigger it if it's ok so that the other values are at default upon query */ - if (xv_atomka != None) { - int port_value,port_min,port_max,port_mid,has_value=0; - if(!strcmp(attributes[i].name,"XV_BRIGHTNESS") && !strcmp(info->name,VO_EC_BRIGHTNESS)) { - has_value=1; - port_value = info->value; - } else if(!strcmp(attributes[i].name,"XV_SATURATION") && !strcmp(info->name,VO_EC_SATURATION)) { - has_value=1; - port_value = info->value; - } else if(!strcmp(attributes[i].name,"XV_CONTRAST") && !strcmp(info->name,VO_EC_CONTRAST)) { - has_value=1; - port_value = info->value; - } else -#if 0 -/* We may safely skip this parameter since NVidia driver has default == min - for XV_HUE but not mid. IMHO it's meaningless against RGB. */ - if(!strcmp(attributes[i].name,"XV_HUE") && !strcmp(info->name,VO_EC_HUE)) - { - has_value=1; - port_value = info->value; - } - else -#endif - /* Note: since 22.01.2002 GATOS supports these attrs for radeons (NK) */ - ... [truncated message content] |