Commit ed4fe964 authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/x11/xcommon.c: we don't use DPMS functions if they are
    not available.
parent 595d7684
This diff is collapsed.
...@@ -184,6 +184,26 @@ AC_HEADER_TIME ...@@ -184,6 +184,26 @@ AC_HEADER_TIME
dnl Check for threads library dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h) AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Check for DPMS
if test x$SYS != xmingw32
then
if test x$x_includes = xNONE; then
x_includes=/usr/X11R6/include
fi
if test x$x_libraries = xNONE; then
x_libraries=/usr/X11R6/lib
fi
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$x_includes"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
])
])
CPPFLAGS=$saved_CPPFLAGS
fi
dnl Check for ntohl, etc. dnl Check for ntohl, etc.
AC_CACHE_CHECK([for ntohl in sys/param.h], AC_CACHE_CHECK([for ntohl in sys/param.h],
[ac_cv_c_ntohl_sys_param_h], [ac_cv_c_ntohl_sys_param_h],
...@@ -529,8 +549,8 @@ esac ...@@ -529,8 +549,8 @@ esac
dnl dnl
dnl DVD and VCD devices dnl DVD and VCD devices
dnl dnl
case $SYS in case x$SYS in
mingw32) xmingw32)
DVD_DEVICE="E:" DVD_DEVICE="E:"
VCD_DEVICE="E:" VCD_DEVICE="E:"
;; ;;
...@@ -969,7 +989,7 @@ AC_ARG_ENABLE(dsp, ...@@ -969,7 +989,7 @@ AC_ARG_ENABLE(dsp,
[ --disable-dsp Linux /dev/dsp support (default enabled)]) [ --disable-dsp Linux /dev/dsp support (default enabled)])
if test x$enable_dsp != xno && if test x$enable_dsp != xno &&
(test $SYS != mingw32 || test x$enable_dsp = xyes) (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
then then
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, [ AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, [
PLUGINS="${PLUGINS} dsp" PLUGINS="${PLUGINS} dsp"
...@@ -1139,7 +1159,7 @@ AC_ARG_ENABLE(directx, ...@@ -1139,7 +1159,7 @@ AC_ARG_ENABLE(directx,
[ --disable-directx Win32 DirectX support (default enabled on Win32)]) [ --disable-directx Win32 DirectX support (default enabled on Win32)])
if test "x$enableval" != "xno" if test "x$enableval" != "xno"
then then
if test $SYS = mingw32 if test x$SYS = xmingw32
then then
AC_ARG_WITH(directx-path, AC_ARG_WITH(directx-path,
[ --with-directx-path=path Win32 DirectX headers and libraries]) [ --with-directx-path=path Win32 DirectX headers and libraries])
...@@ -1169,7 +1189,7 @@ dnl win32 waveOut plugin ...@@ -1169,7 +1189,7 @@ dnl win32 waveOut plugin
dnl dnl
AC_ARG_ENABLE(waveout, AC_ARG_ENABLE(waveout,
[ --disable-waveout Win32 waveOut module (default enabled on Win32)]) [ --disable-waveout Win32 waveOut module (default enabled on Win32)])
if ((test "x$enableval" != "xno") && (test $SYS = mingw32)) if ((test "x$enableval" != "xno") && (test x$SYS = xmingw32))
then then
PLUGINS="${PLUGINS} waveout" PLUGINS="${PLUGINS} waveout"
LIB_WAVEOUT="-lwinmm" LIB_WAVEOUT="-lwinmm"
...@@ -1324,7 +1344,7 @@ dnl ...@@ -1324,7 +1344,7 @@ dnl
AC_ARG_ENABLE(x11, AC_ARG_ENABLE(x11,
[ --disable-x11 X11 support (default enabled)]) [ --disable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno && if test x$enable_x11 != xno &&
(test $SYS != mingw32 || test x$enable_x11 = xyes); then (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
if test x$x_includes = xNONE; then if test x$x_includes = xNONE; then
x_includes=/usr/X11R6/include x_includes=/usr/X11R6/include
fi fi
...@@ -1338,10 +1358,6 @@ if test x$enable_x11 != xno && ...@@ -1338,10 +1358,6 @@ if test x$enable_x11 != xno &&
LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext" LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
CFLAGS_X11="${CFLAGS_X11} -I$x_includes" CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
]) ])
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dmps.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dmps.h> defines DPMSInfo.)
])
CPPFLAGS=$saved_CPPFLAGS CPPFLAGS=$saved_CPPFLAGS
fi fi
...@@ -1352,7 +1368,7 @@ dnl ...@@ -1352,7 +1368,7 @@ dnl
AC_ARG_ENABLE(xvideo, AC_ARG_ENABLE(xvideo,
[ --disable-xvideo XVideo support (default enabled)]) [ --disable-xvideo XVideo support (default enabled)])
if test x$enable_xvideo != xno && if test x$enable_xvideo != xno &&
(test $SYS != mingw32 || test x$enable_xvideo = xyes); then (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
if test x$x_includes = xNONE; then if test x$x_includes = xNONE; then
x_includes=/usr/X11R6/include x_includes=/usr/X11R6/include
fi fi
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins * xcommon.c: Functions common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.13 2002/01/21 00:52:07 sam Exp $ * $Id: xcommon.c,v 1.14 2002/01/25 17:18:37 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -49,7 +49,9 @@ ...@@ -49,7 +49,9 @@
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/extensions/XShm.h> #include <X11/extensions/XShm.h>
#include <X11/extensions/dpms.h> #ifdef DPMSINFO_IN_DPMS_H
# include <X11/extensions/dpms.h>
#endif
#ifdef MODULE_NAME_IS_xvideo #ifdef MODULE_NAME_IS_xvideo
# include <X11/extensions/Xv.h> # include <X11/extensions/Xv.h>
...@@ -172,7 +174,9 @@ typedef struct vout_sys_s ...@@ -172,7 +174,9 @@ typedef struct vout_sys_s
int i_ss_interval; /* interval between changes */ int i_ss_interval; /* interval between changes */
int i_ss_blanking; /* blanking mode */ int i_ss_blanking; /* blanking mode */
int i_ss_exposure; /* exposure mode */ int i_ss_exposure; /* exposure mode */
#ifdef DPMSINFO_IN_DPMS_H
BOOL b_ss_dpms; /* DPMS mode */ BOOL b_ss_dpms; /* DPMS mode */
#endif
/* Mouse pointer properties */ /* Mouse pointer properties */
boolean_t b_mouse_pointer_visible; boolean_t b_mouse_pointer_visible;
...@@ -1709,7 +1713,9 @@ static void ToggleFullScreen ( vout_thread_t *p_vout ) ...@@ -1709,7 +1713,9 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
static void EnableXScreenSaver( vout_thread_t *p_vout ) static void EnableXScreenSaver( vout_thread_t *p_vout )
{ {
#ifdef DPMSINFO_IN_DPMS_H
int dummy; int dummy;
#endif
intf_DbgMsg( "vout: enabling screen saver" ); intf_DbgMsg( "vout: enabling screen saver" );
XSetScreenSaver( p_vout->p_sys->p_display, p_vout->p_sys->i_ss_timeout, XSetScreenSaver( p_vout->p_sys->p_display, p_vout->p_sys->i_ss_timeout,
...@@ -1718,6 +1724,7 @@ static void EnableXScreenSaver( vout_thread_t *p_vout ) ...@@ -1718,6 +1724,7 @@ static void EnableXScreenSaver( vout_thread_t *p_vout )
p_vout->p_sys->i_ss_exposure ); p_vout->p_sys->i_ss_exposure );
/* Restore DPMS settings */ /* Restore DPMS settings */
#ifdef DPMSINFO_IN_DPMS_H
if( DPMSQueryExtension( p_vout->p_sys->p_display, &dummy, &dummy ) ) if( DPMSQueryExtension( p_vout->p_sys->p_display, &dummy, &dummy ) )
{ {
if( p_vout->p_sys->b_ss_dpms ) if( p_vout->p_sys->b_ss_dpms )
...@@ -1725,6 +1732,7 @@ static void EnableXScreenSaver( vout_thread_t *p_vout ) ...@@ -1725,6 +1732,7 @@ static void EnableXScreenSaver( vout_thread_t *p_vout )
DPMSEnable( p_vout->p_sys->p_display ); DPMSEnable( p_vout->p_sys->p_display );
} }
} }
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -1734,7 +1742,9 @@ static void EnableXScreenSaver( vout_thread_t *p_vout ) ...@@ -1734,7 +1742,9 @@ static void EnableXScreenSaver( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
static void DisableXScreenSaver( vout_thread_t *p_vout ) static void DisableXScreenSaver( vout_thread_t *p_vout )
{ {
#ifdef DPMSINFO_IN_DPMS_H
int dummy; int dummy;
#endif
/* Save screen saver informations */ /* Save screen saver informations */
XGetScreenSaver( p_vout->p_sys->p_display, &p_vout->p_sys->i_ss_timeout, XGetScreenSaver( p_vout->p_sys->p_display, &p_vout->p_sys->i_ss_timeout,
...@@ -1750,15 +1760,17 @@ static void DisableXScreenSaver( vout_thread_t *p_vout ) ...@@ -1750,15 +1760,17 @@ static void DisableXScreenSaver( vout_thread_t *p_vout )
p_vout->p_sys->i_ss_exposure ); p_vout->p_sys->i_ss_exposure );
/* Disable DPMS */ /* Disable DPMS */
#ifdef DPMSINFO_IN_DPMS_H
if( DPMSQueryExtension( p_vout->p_sys->p_display, &dummy, &dummy ) ) if( DPMSQueryExtension( p_vout->p_sys->p_display, &dummy, &dummy ) )
{ {
CARD16 dummy; CARD16 unused;
/* Save DPMS current state */ /* Save DPMS current state */
DPMSInfo( p_vout->p_sys->p_display, &dummy, DPMSInfo( p_vout->p_sys->p_display, &unused,
&p_vout->p_sys->b_ss_dpms ); &p_vout->p_sys->b_ss_dpms );
intf_DbgMsg( "vout: disabling DPMS" ); intf_DbgMsg( "vout: disabling DPMS" );
DPMSDisable( p_vout->p_sys->p_display ); DPMSDisable( p_vout->p_sys->p_display );
} }
#endif
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment