summaryrefslogtreecommitdiffstats
path: root/libvo/vo_x11.c
diff options
context:
space:
mode:
authorlaaz <laaz@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-10 00:00:04 +0000
committerlaaz <laaz@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-10 00:00:04 +0000
commit473f1b7b0780d24799a1bf54929118073709df4d (patch)
treec59b550f1c52b78ebbfa397cdc3863f7dbe549e2 /libvo/vo_x11.c
parentfd9595e99bf039bcc053c3e52d026001314c649d (diff)
downloadmpv-473f1b7b0780d24799a1bf54929118073709df4d.tar.bz2
mpv-473f1b7b0780d24799a1bf54929118073709df4d.tar.xz
Szebb es jobb screensaver-kikapcsolo resz
xmga, xv, x11 support (sdl comming soon) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@325 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r--libvo/vo_x11.c60
1 files changed, 5 insertions, 55 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index d10dbfb2f7..e636e01fd4 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -28,7 +28,6 @@ LIBVO_EXTERN( x11 )
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XShm.h>
-#include <X11/extensions/dpms.h>
#ifdef HAVE_XF86VM
#include <X11/extensions/xf86vmode.h>
#endif
@@ -67,8 +66,6 @@ static int depth,bpp,mode;
static XWindowAttributes attribs;
static int X_already_started=0;
-static int timeout_save=0;
-static int dpms_disabled=0;
//static int vo_dwidth,vo_dheight;
#define SH_MEM
@@ -340,24 +337,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
// vo_initthread( mThread );
- if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
- {
- BOOL onoff;
- CARD16 state;
- DPMSInfo(mDisplay, &state, &onoff);
- if (onoff)
- {
- printf ("Disabling DPMS\n");
- dpms_disabled=1;
- DPMSDisable(mDisplay); // monitor powersave off
- }
- }
-
- XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
- if (timeout_save)
- XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp);
- // switching off screensaver
-
+ saver_off(mDisplay);
return 0;
}
@@ -535,49 +515,19 @@ static uint32_t draw_frame( uint8_t *src[] )
static uint32_t query_format( uint32_t format )
{
if( !vo_init() ) return 0; // Can't open X11
- if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR ){
- int bpp=format&0xFF;
- if( bpp==vo_depthonscreen ) return 1;
- if( bpp==15 && vo_depthonscreen==16) return 1; // built-in conversion
- if( bpp==24 && vo_depthonscreen==32) return 1; // built-in conversion
- }
+ if( ( format&IMGFMT_BGR_MASK )==IMGFMT_BGR && ( format&0xFF )==vo_depthonscreen ) return 1;
switch( format )
- {
+ {
case IMGFMT_YV12: return 1;
- }
+ }
return 0;
}
-
static void
uninit(void)
{
-
- int nothing;
-
-// DMPSEnable doesn't work if there isn't a DPMSQueryExtension after it.
-// XSetScreenSaver doesn't work if there isn't an XGetScreensaver after it.
-
-if (dpms_disabled)
- {
- if (DPMSQueryExtension(mDisplay, &nothing, &nothing))
- {
- printf ("Enabling DPMS\n");
- DPMSEnable(mDisplay); // restoring power saving settings
- DPMSQueryExtension(mDisplay, &nothing, &nothing);
- }
- }
-
- if (timeout_save)
- {
- int dummy, interval, prefer_blank, allow_exp;
- XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp);
- XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); // screensaver
- XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp);
- }
-
-
+saver_on(mDisplay); // screen saver back on
#ifdef HAVE_XF86VM
if (vidmodes!=NULL)
{