[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[467] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-28 07:09:46
|
Revision: 467 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=467&view=rev Author: nickols_k Date: 2012-11-28 07:09:37 +0000 (Wed, 28 Nov 2012) Log Message: ----------- remove some ancient cfg-keys Modified Paths: -------------- mplayerxp/cfg-mplayerxp.h mplayerxp/libmpcodecs/dec_video.cpp mplayerxp/libvo/video_out.cpp mplayerxp/libvo/video_out.h mplayerxp/libvo/vo_opengl.cpp mplayerxp/libvo/vo_vesa.cpp mplayerxp/libvo/vo_x11.cpp mplayerxp/libvo/vo_xv.cpp mplayerxp/libvo/x11_system.cpp mplayerxp/libvo/x11_system.h mplayerxp/mplayerxp.h mplayerxp/postproc/vf_scale.cpp Modified: mplayerxp/cfg-mplayerxp.h =================================================================== --- mplayerxp/cfg-mplayerxp.h 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/cfg-mplayerxp.h 2012-11-28 07:09:37 UTC (rev 467) @@ -140,7 +140,6 @@ {NULL, NULL, 0, 0, 0, 0, NULL}, }; - static const config_t subtitle_config[]={ {"on", &mp_conf.has_dvdsub, CONF_TYPE_FLAG, 0, 0, 1, "enables subtitle-steam playback"}, {"off", &mp_conf.has_dvdsub, CONF_TYPE_FLAG, 0, 1, 0, "disables subtitle-stream playback"}, @@ -171,7 +170,7 @@ static const config_t x11_config[]={ {"display", &vo_conf.mDisplayName, CONF_TYPE_STRING, 0, 0, 0, "specifies the hostname and display number of the X server"}, #ifdef HAVE_XINERAMA - {"xinerama", &mp_conf.xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, "tells MPlayerXP the display for movie playback"}, + {"xinerama", &vo_conf.xinerama_screen, CONF_TYPE_INT, CONF_RANGE, 0, 32, "tells MPlayerXP the display for movie playback"}, #endif {NULL, NULL, 0, 0, 0, 0, NULL}, }; @@ -191,11 +190,9 @@ static const config_t video_config[]={ {"on", &mp_conf.has_video, CONF_TYPE_FLAG, 0, 0, 1, "enables video-steam playback"}, {"off", &mp_conf.has_video, CONF_TYPE_FLAG, 0, 1, 0, "disables video-stream playback"}, - {"width", &vo_conf.opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "scale output image to width (if driver supports)"}, - {"height", &vo_conf.opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "scale output image to height (if driver supports)"}, - {"zoom", &vo_conf.screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0, 4096, "scale output image by given factor"}, - {"screenw", &vo_conf.screenwidth, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "specifies the horizontal resolution of the screen (if supported)"}, - {"screenh", &vo_conf.screenheight, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "specifies the vertical resolution of the screen (if supported)"}, + {"width", &vo_conf.image_width, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "scale output image to width (if driver supports)"}, + {"height", &vo_conf.image_height, CONF_TYPE_INT, CONF_RANGE, 0, 4096, "scale output image to height (if driver supports)"}, + {"zoom", &vo_conf.image_zoom, CONF_TYPE_FLOAT, CONF_RANGE, 0, 4096, "scale output image by given factor"}, {"aspect", &vo_conf.movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, "sets aspect-ratio of movies (autodetect)"}, {"noaspect", &vo_conf.movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, "unsets aspect-ratio of movies"}, {"aspect-ratio", &vo_conf.softzoom, CONF_TYPE_FLAG, 0, 0, 1, "keeps aspect-ratio of the movie during window resize"}, Modified: mplayerxp/libmpcodecs/dec_video.cpp =================================================================== --- mplayerxp/libmpcodecs/dec_video.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libmpcodecs/dec_video.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -507,9 +507,9 @@ // time to do aspect ratio corrections... if(vo_conf.movie_aspect>-1.0) sh->aspect = vo_conf.movie_aspect; // cmdline overrides autodetect - if(vo_conf.opt_screen_size_x||vo_conf.opt_screen_size_y){ - screen_size_x = vo_conf.opt_screen_size_x; - screen_size_y = vo_conf.opt_screen_size_y; + if(vo_conf.image_width||vo_conf.image_height){ + screen_size_x = vo_conf.image_width; + screen_size_y = vo_conf.image_height; if(!vo_conf.vidmode){ if(!screen_size_x) screen_size_x=1; if(!screen_size_y) screen_size_y=1; @@ -520,15 +520,15 @@ // check source format aspect, calculate prescale ::atmos screen_size_x=sh->src_w; screen_size_y=sh->src_h; - if(vo_conf.screen_size_xy>=0.001){ - if(vo_conf.screen_size_xy<=8){ + if(vo_conf.image_zoom>=0.001){ + if(vo_conf.image_zoom<=8){ // -xy means x+y scale - screen_size_x*=vo_conf.screen_size_xy; - screen_size_y*=vo_conf.screen_size_xy; + screen_size_x*=vo_conf.image_zoom; + screen_size_y*=vo_conf.image_zoom; } else { // -xy means forced width while keeping correct aspect - screen_size_x=vo_conf.screen_size_xy; - screen_size_y=vo_conf.screen_size_xy*sh->src_h/sh->src_w; + screen_size_x=vo_conf.image_zoom; + screen_size_y=vo_conf.image_zoom*sh->src_h/sh->src_w; } } if(sh->aspect>0.01){ @@ -536,7 +536,7 @@ MSG_V("Movie-Aspect is %.2f:1 - prescaling to correct movie aspect.\n",sh->aspect); _w=(int)((float)screen_size_y*sh->aspect); _w+=_w%2; // round // we don't like horizontal downscale || user forced width: - if(_w<screen_size_x || vo_conf.screen_size_xy>8){ + if(_w<screen_size_x || vo_conf.image_zoom>8){ screen_size_y=(int)((float)screen_size_x*(1.0/sh->aspect)); screen_size_y+=screen_size_y%2; // round if(screen_size_y<sh->src_h) // Do not downscale verticaly Modified: mplayerxp/libvo/video_out.cpp =================================================================== --- mplayerxp/libvo/video_out.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/video_out.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -55,6 +55,7 @@ flip=-1; xp_buffs=64; dbpp=0; + xinerama_screen=0; } VO_Config vo_conf; Modified: mplayerxp/libvo/video_out.h =================================================================== --- mplayerxp/libvo/video_out.h 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/video_out.h 2012-11-28 07:09:37 UTC (rev 467) @@ -112,6 +112,7 @@ char * subdevice; // currently unused char* mDisplayName; + int xinerama_screen; int vsync; @@ -120,13 +121,10 @@ vo_gamma_t gamma; - unsigned screenwidth; - unsigned screenheight; + int image_width; //opt_screen_size_x + int image_height; //opt_screen_size_y + float image_zoom; //screen_size_xy - int opt_screen_size_x; - int opt_screen_size_y; - - float screen_size_xy; float movie_aspect; int fsmode; int vidmode; Modified: mplayerxp/libvo/vo_opengl.cpp =================================================================== --- mplayerxp/libvo/vo_opengl.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/vo_opengl.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -166,7 +166,7 @@ flags=_flags; - aspect.save(width,height,d_width,d_height,vo_conf.screenwidth,vo_conf.screenheight); + aspect.save(width,height,d_width,d_height,glx.screen_width(),glx.screen_height()); aspect.calc(d_width,d_height,flags&VOFLAG_FULLSCREEN?Aspect::ZOOM:Aspect::NOZOOM); image_height= height; Modified: mplayerxp/libvo/vo_vesa.cpp =================================================================== --- mplayerxp/libvo/vo_vesa.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/vo_vesa.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -540,10 +540,8 @@ dstW = d_width; dstH = d_height; } - if(vo_conf.screenwidth) w = vo_conf.screenwidth; - else w = std::max(dstW,width); - if(vo_conf.screenheight) h = vo_conf.screenheight; - else h = std::max(dstH,height); + w = std::max(dstW,width); + h = std::max(dstH,height); for(i=0;i < num_modes;i++) { if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK) { PRINT_VBE_ERR("vbeGetModeInfo",err); Modified: mplayerxp/libvo/vo_x11.cpp =================================================================== --- mplayerxp/libvo/vo_x11.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/vo_x11.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -171,7 +171,7 @@ vidix->stop(); if (vidix->configure(image_width, image_height, winc.x, winc.y, winc.w, winc.h, in_format, x11.depth(), - vo_conf.screenwidth, vo_conf.screenheight) != MPXP_Ok) + x11.screen_width(), x11.screen_height()) != MPXP_Ok) { MSG_FATAL( "Can't initialize VIDIX: %s\n",strerror(errno)); delete vidix; @@ -230,7 +230,7 @@ baseAspect= ((1<<16)*d_width + d_height/2)/d_height; - aspect.save(width,height,d_width,d_height,vo_conf.screenwidth,vo_conf.screenheight); + aspect.save(width,height,d_width,d_height,x11.screen_width(),x11.screen_height()); aspect.calc(d_width,d_height,flags&VOFLAG_FULLSCREEN?Aspect::ZOOM:Aspect::NOZOOM); x11.calcpos(&hint,d_width,d_height,flags); @@ -302,7 +302,7 @@ if(vidix->configure(image_width,image_height,winc.x,winc.y, winc.w,winc.h, in_format,x11.depth(), - vo_conf.screenwidth,vo_conf.screenheight) != MPXP_Ok) { + x11.screen_width(),x11.screen_height()) != MPXP_Ok) { MSG_ERR("vo_vesa: Can't initialize VIDIX driver\n"); return MPXP_False; } else MSG_V("vo_vesa: Using VIDIX\n"); Modified: mplayerxp/libvo/vo_xv.cpp =================================================================== --- mplayerxp/libvo/vo_xv.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/vo_xv.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -151,7 +151,7 @@ flags=_flags; - aspect.save(width,height,d_width,d_height,vo_conf.screenwidth,vo_conf.screenheight); + aspect.save(width,height,d_width,d_height,xv.screen_width(),xv.screen_height()); aspect.calc(d_width,d_height,flags&VOFLAG_FULLSCREEN?Aspect::ZOOM:Aspect::NOZOOM); image_height = height; Modified: mplayerxp/libvo/x11_system.cpp =================================================================== --- mplayerxp/libvo/x11_system.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/x11_system.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -44,7 +44,10 @@ return 0; } -X11_System::X11_System(const char* DisplayName) { +X11_System::X11_System(const char* DisplayName) + :screenwidth(0), + screenheight(0) +{ unsigned bpp; unsigned int mask; // char * DisplayName = ":0.0"; @@ -79,13 +82,11 @@ int num_screens; screens = ::XineramaQueryScreens(mDisplay, &num_screens); - if(mp_conf.xinerama_screen >= num_screens) mp_conf.xinerama_screen = 0; - if (! vo_conf.screenwidth) - vo_conf.screenwidth=screens[mp_conf.xinerama_screen].width; - if (! vo_conf.screenheight) - vo_conf.screenheight=screens[mp_conf.xinerama_screen].height; - xinerama_x = screens[mp_conf.xinerama_screen].x_org; - xinerama_y = screens[mp_conf.xinerama_screen].y_org; + if(vo_conf.xinerama_screen >= num_screens) vo_conf.xinerama_screen = 0; + screenwidth=screens[vo_conf.xinerama_screen].width; + screenheight=screens[vo_conf.xinerama_screen].height; + xinerama_x = screens[vo_conf.xinerama_screen].x_org; + xinerama_y = screens[vo_conf.xinerama_screen].y_org; ::XFree(screens); } else @@ -94,15 +95,13 @@ { int clock; ::XF86VidModeGetModeLine( mDisplay,mScreen,&clock ,&modeline ); - if ( !vo_conf.screenwidth ) vo_conf.screenwidth=modeline.hdisplay; - if ( !vo_conf.screenheight ) vo_conf.screenheight=modeline.vdisplay; + if(!screenwidth) screenwidth=modeline.hdisplay; + if(!screenheight) screenheight=modeline.vdisplay; } #endif - if (! vo_conf.screenwidth) - vo_conf.screenwidth=DisplayWidth( mDisplay,mScreen ); - if (! vo_conf.screenheight) - vo_conf.screenheight=DisplayHeight( mDisplay,mScreen ); + if(!screenwidth) screenwidth=DisplayWidth( mDisplay,mScreen ); + if(!screenheight) screenheight=DisplayHeight( mDisplay,mScreen ); // get color depth (from root window, or the best visual): ::XGetWindowAttributes(mDisplay, mRootWin, &attribs); @@ -148,7 +147,7 @@ if (*dispName==':') mLocalDisplay=1; else mLocalDisplay=0; MSG_OK("X11_System: running %dx%d with depth %d bits/pixel (\"%s\" => %s display)\n", - vo_conf.screenwidth,vo_conf.screenheight, + screenwidth,screenheight, _depth, dispName,mLocalDisplay?"local":"remote"); } @@ -160,11 +159,15 @@ ::XCloseDisplay(mDisplay); } +unsigned X11_System::screen_width() const { return screenwidth; } +unsigned X11_System::screen_height() const { return screenheight; } + void X11_System::get_win_coord(vo_rect_t& r) const { r = curr; } + void X11_System::update_win_coord() { XWindowAttributes xwa; @@ -751,24 +754,24 @@ static uint32_t vm_width; static uint32_t vm_height; #endif - hint->x=(vo_conf.screenwidth-d_width)/2; - hint->y=(vo_conf.screenheight-d_height)/2; + hint->x=(screenwidth-d_width)/2; + hint->y=(screenheight-d_height)/2; hint->width=d_width; hint->height=d_height; #ifdef HAVE_XF86VM if ( flags & VOFLAG_MODESWITCHING ) { vm_width=d_width; vm_height=d_height; vm_switch(vm_width, vm_height,&modeline_width, &modeline_height); - hint->x=(vo_conf.screenwidth-modeline_width)/2; - hint->y=(vo_conf.screenheight-modeline_height)/2; + hint->x=(screenwidth-modeline_width)/2; + hint->y=(screenheight-modeline_height)/2; hint->width=modeline_width; hint->height=modeline_height; } else #endif if ( flags & VOFLAG_FULLSCREEN ) { - hint->width=vo_conf.screenwidth; - hint->height=vo_conf.screenheight; + hint->width=screenwidth; + hint->height=screenheight; hint->x=0; hint->y=0; } @@ -780,7 +783,7 @@ ::XUnmapWindow( mDisplay,window ); if ( !is_fs ) { prev=curr; - curr.x=0; curr.y=0; curr.w=vo_conf.screenwidth; curr.h=vo_conf.screenheight; + curr.x=0; curr.y=0; curr.w=screenwidth; curr.h=screenheight; decoration(0); } else { curr=prev; @@ -893,8 +896,8 @@ MSG_V("XF86VM: Selected video mode %dx%d for image size %dx%d.\n",*modeline_width, *modeline_height, X, Y); ::XF86VidModeLockModeSwitch(mDisplay,mScreen,0); ::XF86VidModeSwitchToMode(mDisplay,mScreen,vidmodes[j]); - X=(vo_conf.screenwidth-*modeline_width)/2; - Y=(vo_conf.screenheight-*modeline_height)/2; + X=(screenwidth-*modeline_width)/2; + Y=(screenheight-*modeline_height)/2; ::XF86VidModeSetViewPort(mDisplay,mScreen,X,Y); } } @@ -908,8 +911,8 @@ vidmodes=NULL; ::XF86VidModeGetAllModeLines(mDisplay,mScreen,&modecount,&vidmodes); for (i=0; i<modecount; i++) - if ((vidmodes[i]->hdisplay == vo_conf.screenwidth) && (vidmodes[i]->vdisplay == vo_conf.screenheight)) { - MSG_V("\nReturning to original mode %dx%d\n", vo_conf.screenwidth, vo_conf.screenheight); + if ((vidmodes[i]->hdisplay == screenwidth) && (vidmodes[i]->vdisplay == screenheight)) { + MSG_V("\nReturning to original mode %dx%d\n", screenwidth, screenheight); break; } ::XF86VidModeSwitchToMode(mDisplay,mScreen,vidmodes[i]); Modified: mplayerxp/libvo/x11_system.h =================================================================== --- mplayerxp/libvo/x11_system.h 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/libvo/x11_system.h 2012-11-28 07:09:37 UTC (rev 467) @@ -35,6 +35,8 @@ X11_System(const char* DisplayName); virtual ~X11_System(); + unsigned screen_width() const; + unsigned screen_height() const; void match_visual(XVisualInfo*) const; virtual XVisualInfo* get_visual() const; virtual void create_window(const XSizeHints& hint,XVisualInfo* visual,int is_vm,unsigned depth,const char*title); @@ -90,6 +92,7 @@ ::GC gc; unsigned _depth; + unsigned screenwidth,screenheight; int dpms_disabled; int timeout_save; Modified: mplayerxp/mplayerxp.h =================================================================== --- mplayerxp/mplayerxp.h 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/mplayerxp.h 2012-11-28 07:09:37 UTC (rev 467) @@ -93,7 +93,6 @@ const char* npp_options; unsigned ao_channels; int z_compression; - int xinerama_screen; float monitor_pixel_aspect; }; extern MP_Config mp_conf; Modified: mplayerxp/postproc/vf_scale.cpp =================================================================== --- mplayerxp/postproc/vf_scale.cpp 2012-11-27 17:19:32 UTC (rev 466) +++ mplayerxp/postproc/vf_scale.cpp 2012-11-28 07:09:37 UTC (rev 467) @@ -291,7 +291,7 @@ break; } } - if(!vo_conf.opt_screen_size_x && !vo_conf.opt_screen_size_y && !(vo_conf.screen_size_xy >= 0.001)){ + if(!vo_conf.image_width && !vo_conf.image_height && !(vo_conf.image_zoom >= 0.001)){ // Compute new d_width and d_height, preserving aspect // while ensuring that both are >= output size in pixels. if (vf->priv->h * d_width > vf->priv->w * d_height) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |