Commit cabbb158 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/x11/*, configure.ac.in: Xinerama support remotely based from an old patch by Xavier Maillard.
parent 11ac594c
...@@ -514,25 +514,6 @@ NEED_GNOME2_MAIN=no ...@@ -514,25 +514,6 @@ NEED_GNOME2_MAIN=no
dnl build the qte plugin ? dnl build the qte plugin ?
NEED_QTE_MAIN=no NEED_QTE_MAIN=no
dnl Check for DPMS
if test "x${SYS}" != "xmingw32"
then
CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_MSG_RESULT(yes)
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
],[
AC_MSG_RESULT(no)
])
],,[
#include <X11/Xlib.h>
])
CPPFLAGS="${CPPFLAGS_save}"
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],
...@@ -1962,6 +1943,25 @@ dnl ...@@ -1962,6 +1943,25 @@ dnl
AC_ARG_WITH(,[Video plugins:]) AC_ARG_WITH(,[Video plugins:])
dnl Check for DPMS
if test "x${SYS}" != "xmingw32"
then
CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_MSG_CHECKING(for DPMSInfo in X11/extensions/dpms.h)
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_MSG_RESULT(yes)
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.)
],[
AC_MSG_RESULT(no)
])
],,[
#include <X11/Xlib.h>
])
CPPFLAGS="${CPPFLAGS_save}"
fi
dnl dnl
dnl X11 module dnl X11 module
dnl (enabled by default except on win32) dnl (enabled by default except on win32)
...@@ -1975,6 +1975,11 @@ if test "x${enable_x11}" != "xno" && ...@@ -1975,6 +1975,11 @@ if test "x${enable_x11}" != "xno" &&
PLUGINS="${PLUGINS} x11" PLUGINS="${PLUGINS} x11"
LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext" LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}" CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
LDFLAGS_x11="${LDFLAGS_x11} -lXinerama")
])
]) ])
CPPFLAGS="${CPPFLAGS_save}" CPPFLAGS="${CPPFLAGS_save}"
fi fi
...@@ -2004,6 +2009,11 @@ if test "x${enable_xvideo}" != "xno" && ...@@ -2004,6 +2009,11 @@ if test "x${enable_xvideo}" != "xno" &&
: :
) )
) )
AC_CHECK_HEADERS(X11/extensions/Xinerama.h, [
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
LDFLAGS_xvideo="${LDFLAGS_xvideo} -lXinerama")
])
CFLAGS="${CFLAGS_save}" CFLAGS="${CFLAGS_save}"
] ]
CPPFLAGS="${CPPFLAGS_save}") CPPFLAGS="${CPPFLAGS_save}")
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* x11.c : X11 plugin for vlc * x11.c : X11 plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: x11.c,v 1.7 2003/05/15 22:27:38 massiot Exp $ * $Id: x11.c,v 1.8 2003/05/25 19:24:53 gbazin 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>
...@@ -58,12 +58,20 @@ extern void E_(Deactivate) ( vlc_object_t * ); ...@@ -58,12 +58,20 @@ extern void E_(Deactivate) ( vlc_object_t * );
#define SHM_LONGTEXT N_( \ #define SHM_LONGTEXT N_( \
"Use shared memory to communicate between VLC and the X server.") "Use shared memory to communicate between VLC and the X server.")
#define SCREEN_TEXT N_("choose the screen to be used for fullscreen mode.")
#define SCREEN_LONGTEXT N_( \
"Choose the screen you want to use in fullscreen mode. For instance " \
"set it to 0 for first screen, 1 for the second.")
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("X11"), NULL, VLC_TRUE ); add_category_hint( N_("X11"), NULL, VLC_TRUE );
add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE ); add_string( "x11-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE );
add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT, VLC_TRUE ); add_bool( "x11-altfullscreen", 0, NULL, ALT_FS_TEXT, ALT_FS_LONGTEXT, VLC_TRUE );
#ifdef HAVE_SYS_SHM_H #ifdef HAVE_SYS_SHM_H
add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE ); add_bool( "x11-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE );
#endif
#ifdef HAVE_XINERAMA
add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
#endif #endif
set_description( _("X11 video output") ); set_description( _("X11 video output") );
set_capability( "video output", 50 ); set_capability( "video output", 50 );
......
...@@ -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.16 2003/05/25 11:31:54 gbazin Exp $ * $Id: xcommon.c,v 1.17 2003/05/25 19:24:53 gbazin 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>
...@@ -66,6 +66,10 @@ ...@@ -66,6 +66,10 @@
# include <X11/extensions/Xvlib.h> # include <X11/extensions/Xvlib.h>
#endif #endif
#ifdef HAVE_XINERAMA
# include <X11/extensions/Xinerama.h>
#endif
#include "xcommon.h" #include "xcommon.h"
/***************************************************************************** /*****************************************************************************
...@@ -1334,6 +1338,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout ) ...@@ -1334,6 +1338,7 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
XEvent xevent; XEvent xevent;
mwmhints_t mwmhints; mwmhints_t mwmhints;
XSetWindowAttributes attributes; XSetWindowAttributes attributes;
int i_d1, i_d2;
p_vout->b_fullscreen = !p_vout->b_fullscreen; p_vout->b_fullscreen = !p_vout->b_fullscreen;
...@@ -1401,9 +1406,54 @@ static void ToggleFullScreen ( vout_thread_t *p_vout ) ...@@ -1401,9 +1406,54 @@ static void ToggleFullScreen ( vout_thread_t *p_vout )
p_vout->p_sys->p_win->i_height = p_vout->p_sys->p_win->i_height =
DisplayHeight( p_vout->p_sys->p_display, p_vout->p_sys->i_screen ); DisplayHeight( p_vout->p_sys->p_display, p_vout->p_sys->i_screen );
p_vout->p_sys->p_win->i_x = 0;
p_vout->p_sys->p_win->i_y = 0;
#ifdef HAVE_XINERAMA
if( XineramaQueryExtension( p_vout->p_sys->p_display, &i_d1, &i_d2 ) &&
XineramaIsActive( p_vout->p_sys->p_display ) )
{
XineramaScreenInfo *screens; /* infos for xinerama */
int i_num_screens;
msg_Dbg( p_vout, "Using XFree Xinerama extension");
#define SCREEN p_vout->p_sys->p_win->i_screen
/* Get Informations about Xinerama (num of screens) */
screens = XineramaQueryScreens( p_vout->p_sys->p_display,
&i_num_screens );
if( !SCREEN )
SCREEN = config_GetInt( p_vout,
MODULE_STRING "-xineramascreen" );
/* just check that user has entered a good value */
if( SCREEN >= i_num_screens || SCREEN < 0 )
{
msg_Dbg( p_vout, "requested screen number invalid" );
SCREEN = 0;
}
/* Get the X/Y upper left corner coordinate of the above screen */
p_vout->p_sys->p_win->i_x = screens[SCREEN].x_org;
p_vout->p_sys->p_win->i_y = screens[SCREEN].y_org;
/* Set the Height/width to the screen resolution */
p_vout->p_sys->p_win->i_width = screens[SCREEN].width;
p_vout->p_sys->p_win->i_height = screens[SCREEN].height;
XFree(screens);
#undef SCREEN
}
#endif
XMoveResizeWindow( p_vout->p_sys->p_display, XMoveResizeWindow( p_vout->p_sys->p_display,
p_vout->p_sys->p_win->base_window, p_vout->p_sys->p_win->base_window,
0, 0, p_vout->p_sys->p_win->i_x,
p_vout->p_sys->p_win->i_y,
p_vout->p_sys->p_win->i_width, p_vout->p_sys->p_win->i_width,
p_vout->p_sys->p_win->i_height ); p_vout->p_sys->p_win->i_height );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xcommon.h: Defines common to the X11 and XVideo plugins * xcommon.h: Defines common to the X11 and XVideo plugins
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.h,v 1.4 2002/12/06 16:34:08 sam Exp $ * $Id: xcommon.h,v 1.5 2003/05/25 19:24:53 gbazin 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>
...@@ -51,13 +51,21 @@ typedef struct x11_window_t ...@@ -51,13 +51,21 @@ typedef struct x11_window_t
Window base_window; /* base window */ Window base_window; /* base window */
Window video_window; /* sub-window for displaying video */ Window video_window; /* sub-window for displaying video */
GC gc; /* graphic context instance handler */ GC gc; /* graphic context instance handler */
unsigned int i_width; /* window width */ unsigned int i_width; /* window width */
unsigned int i_height; /* window height */ unsigned int i_height; /* window height */
int i_x; /* window x coordinate */
int i_y; /* window y coordinate */
Atom wm_protocols; Atom wm_protocols;
Atom wm_delete_window; Atom wm_delete_window;
vlc_bool_t b_owned; /* do we own this window? */ vlc_bool_t b_owned; /* do we own this window? */
#ifdef HAVE_XINERAMA
int i_screen;
#endif
} x11_window_t; } x11_window_t;
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* xvideo.c : Xvideo plugin for vlc * xvideo.c : Xvideo plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: xvideo.c,v 1.7 2003/05/15 22:27:38 massiot Exp $ * $Id: xvideo.c,v 1.8 2003/05/25 19:24:53 gbazin Exp $
* *
* Authors: Shane Harper <shanegh@optusnet.com.au> * Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -69,6 +69,11 @@ extern void E_(Deactivate) ( vlc_object_t * ); ...@@ -69,6 +69,11 @@ extern void E_(Deactivate) ( vlc_object_t * );
#define SHM_LONGTEXT N_( \ #define SHM_LONGTEXT N_( \
"Use shared memory to communicate between VLC and the X server.") "Use shared memory to communicate between VLC and the X server.")
#define SCREEN_TEXT N_("choose the screen to be used for fullscreen mode.")
#define SCREEN_LONGTEXT N_( \
"Choose the screen you want to use in fullscreen mode. For instance " \
"set it to 0 for first screen, 1 for the second.")
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("XVideo"), NULL, VLC_TRUE ); add_category_hint( N_("XVideo"), NULL, VLC_TRUE );
add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE ); add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, VLC_TRUE );
...@@ -78,6 +83,10 @@ vlc_module_begin(); ...@@ -78,6 +83,10 @@ vlc_module_begin();
#ifdef HAVE_SYS_SHM_H #ifdef HAVE_SYS_SHM_H
add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE ); add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, VLC_TRUE );
#endif #endif
#ifdef HAVE_XINERAMA
add_integer ( "xvideo-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
#endif
set_description( _("XVideo extension video output") ); set_description( _("XVideo extension video output") );
set_capability( "video output", 150 ); set_capability( "video output", 150 );
set_callbacks( E_(Activate), E_(Deactivate) ); set_callbacks( E_(Activate), E_(Deactivate) );
......
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