Commit 8cc8d957 authored by Sam Hocevar's avatar Sam Hocevar

  * ./configure.in: removed a bashism.
  * ./plugins/x11/xcommon.c: support for systems without shm.h.
  * QNX compilation fixes here and there; the qnx plugin still doesn't work.
parent 38ed5ffc
...@@ -45,6 +45,7 @@ PLUGINS_DIR := ac3_adec \ ...@@ -45,6 +45,7 @@ PLUGINS_DIR := ac3_adec \
mpeg_system \ mpeg_system \
mpeg_adec \ mpeg_adec \
mpeg_vdec \ mpeg_vdec \
qnx \
qt \ qt \
sdl \ sdl \
spudec \ spudec \
...@@ -116,6 +117,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \ ...@@ -116,6 +117,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
mpeg_system/mpeg_ts \ mpeg_system/mpeg_ts \
mpeg_adec/mpeg_adec \ mpeg_adec/mpeg_adec \
mpeg_vdec/mpeg_vdec \ mpeg_vdec/mpeg_vdec \
qnx/qnx \
qt/qt \ qt/qt \
sdl/sdl \ sdl/sdl \
spudec/spudec \ spudec/spudec \
......
...@@ -74,7 +74,7 @@ $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.cpp ...@@ -74,7 +74,7 @@ $(SRC_CPP:%.cpp=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.cpp
$(CC) $(CFLAGS) $(CFLAGS_EXTRA) -c $< -o $@ $(CC) $(CFLAGS) $(CFLAGS_EXTRA) -c $< -o $@
../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL) ../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL)
$(CC) $(OBJ_ALL) $(PLDFLAGS) $(LIB_$(MODULE_NAME)) -o $@ && chmod -x $@ $(CC) $(OBJ_ALL) $(PLDFLAGS) $(LIB_$(MODULE_NAME)) -o $@ && chmod a-x $@
../$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL) ../$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL)
rm -f $@ && ar rc $@ $(OBJ_ALL) && $(RANLIB) $@ rm -f $@ && ar rc $@ $(OBJ_ALL) && $(RANLIB) $@
......
This diff is collapsed.
...@@ -177,7 +177,7 @@ AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h) ...@@ -177,7 +177,7 @@ AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h) AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(dlfcn.h image.h) AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h) AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(machine/param.h) AC_CHECK_HEADERS(machine/param.h sys/shm.h)
AC_HEADER_TIME AC_HEADER_TIME
...@@ -1074,7 +1074,7 @@ dnl a52 AC3 decoder plugin ...@@ -1074,7 +1074,7 @@ dnl a52 AC3 decoder plugin
dnl dnl
AC_ARG_ENABLE(a52, AC_ARG_ENABLE(a52,
[ --disable-a52 AC3 support with liba52 (default enabled)]) [ --disable-a52 AC3 support with liba52 (default enabled)])
if ((test "x$enableval" != "xno") && (test x$SYS != xmingw32)) if test "x$enableval" != "xno" -a x$SYS != xmingw32
then then
AC_CHECK_HEADERS(a52dec/a52.h, [ AC_CHECK_HEADERS(a52dec/a52.h, [
BUILTINS="${BUILTINS} a52" BUILTINS="${BUILTINS} a52"
...@@ -1211,7 +1211,7 @@ dnl win32 waveOut plugin ...@@ -1211,7 +1211,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 x$SYS = xmingw32)) if test "x$enableval" != "xno" -a x$SYS = xmingw32
then then
PLUGINS="${PLUGINS} waveout" PLUGINS="${PLUGINS} waveout"
LIB_WAVEOUT="-lwinmm" LIB_WAVEOUT="-lwinmm"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.74 2002/02/19 00:50:18 sam Exp $ * $Id: common.h,v 1.75 2002/02/20 23:23:53 sam Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* Required system headers * Required system headers
*****************************************************************************/ *****************************************************************************/
#include <string.h> /* strerror() */ #include <string.h> /* strerror() */
#include <sys/types.h>
/***************************************************************************** /*****************************************************************************
* Basic types definitions * Basic types definitions
...@@ -37,7 +38,7 @@ typedef u8 byte_t; ...@@ -37,7 +38,7 @@ typedef u8 byte_t;
/* Boolean type */ /* Boolean type */
#ifdef BOOLEAN_T_IN_SYS_TYPES_H #ifdef BOOLEAN_T_IN_SYS_TYPES_H
# include <sys/types.h> # /* <sys/types.h> already included */
#elif defined(BOOLEAN_T_IN_PTHREAD_H) #elif defined(BOOLEAN_T_IN_PTHREAD_H)
# include <pthread.h> # include <pthread.h>
#elif defined(BOOLEAN_T_IN_CTHREADS_H) #elif defined(BOOLEAN_T_IN_CTHREADS_H)
......
/* include/defs.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* include/defs.h.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */ /* Define if using alloca.c. */
#undef C_ALLOCA #undef C_ALLOCA
...@@ -283,6 +283,9 @@ ...@@ -283,6 +283,9 @@
/* Define if you have the <sys/param.h> header file. */ /* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H #undef HAVE_SYS_PARAM_H
/* Define if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H
/* Define if you have the <sys/socket.h> header file. */ /* Define if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H #undef HAVE_SYS_SOCKET_H
......
...@@ -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.17 2002/02/19 00:50:19 sam Exp $ * $Id: xcommon.c,v 1.18 2002/02/20 23:23:53 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>
...@@ -34,21 +34,26 @@ ...@@ -34,21 +34,26 @@
#include <videolan/vlc.h> #include <videolan/vlc.h>
#ifdef HAVE_MACHINE_PARAM_H #ifdef HAVE_MACHINE_PARAM_H
/* BSD */ /* BSD */
#include <machine/param.h> # include <machine/param.h>
#include <sys/types.h> /* typedef ushort */ # include <sys/types.h> /* typedef ushort */
#include <sys/ipc.h> # include <sys/ipc.h>
#endif #endif
#ifndef WIN32 #ifndef WIN32
#include <netinet/in.h> /* BSD: struct in_addr */ # include <netinet/in.h> /* BSD: struct in_addr */
#endif
#ifdef HAVE_SYS_SHM_H
# include <sys/shm.h> /* shmget(), shmctl() */
#endif #endif
#include <sys/shm.h> /* shmget(), shmctl() */
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/extensions/XShm.h> #ifdef HAVE_SYS_SHM_H
# include <X11/extensions/XShm.h>
#endif
#ifdef DPMSINFO_IN_DPMS_H #ifdef DPMSINFO_IN_DPMS_H
# include <X11/extensions/dpms.h> # include <X11/extensions/dpms.h>
#endif #endif
...@@ -102,7 +107,9 @@ static int NewPicture ( vout_thread_t *, picture_t * ); ...@@ -102,7 +107,9 @@ static int NewPicture ( vout_thread_t *, picture_t * );
static void FreePicture ( vout_thread_t *, picture_t * ); static void FreePicture ( vout_thread_t *, picture_t * );
static IMAGE_TYPE *CreateImage ( Display *, EXTRA_ARGS, int, int ); static IMAGE_TYPE *CreateImage ( Display *, EXTRA_ARGS, int, int );
#ifdef HAVE_SYS_SHM_H
static IMAGE_TYPE *CreateShmImage ( Display *, EXTRA_ARGS_SHM, int, int ); static IMAGE_TYPE *CreateShmImage ( Display *, EXTRA_ARGS_SHM, int, int );
#endif
static void ToggleFullScreen ( vout_thread_t * ); static void ToggleFullScreen ( vout_thread_t * );
...@@ -134,7 +141,9 @@ typedef struct vout_sys_s ...@@ -134,7 +141,9 @@ typedef struct vout_sys_s
Window window; /* root window */ Window window; /* root window */
GC gc; /* graphic context instance handler */ GC gc; /* graphic context instance handler */
#ifdef HAVE_SYS_SHM_H
boolean_t b_shm; /* shared memory extension flag */ boolean_t b_shm; /* shared memory extension flag */
#endif
#ifdef MODULE_NAME_IS_xvideo #ifdef MODULE_NAME_IS_xvideo
Window yuv_window; /* sub-window for displaying yuv video Window yuv_window; /* sub-window for displaying yuv video
...@@ -195,7 +204,9 @@ typedef struct picture_sys_s ...@@ -195,7 +204,9 @@ typedef struct picture_sys_s
{ {
IMAGE_TYPE * p_image; IMAGE_TYPE * p_image;
#ifdef HAVE_SYS_SHM_H
XShmSegmentInfo shminfo; /* shared memory zone information */ XShmSegmentInfo shminfo; /* shared memory zone information */
#endif
} picture_sys_t; } picture_sys_t;
...@@ -496,25 +507,27 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -496,25 +507,27 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height, vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height,
&i_x, &i_y, &i_width, &i_height ); &i_x, &i_y, &i_width, &i_height );
#ifdef HAVE_SYS_SHM_H
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
{ {
/* Display rendered image using shared memory extension */ /* Display rendered image using shared memory extension */
#ifdef MODULE_NAME_IS_xvideo # ifdef MODULE_NAME_IS_xvideo
XvShmPutImage( p_vout->p_sys->p_display, p_vout->p_sys->i_xvport, XvShmPutImage( p_vout->p_sys->p_display, p_vout->p_sys->i_xvport,
p_vout->p_sys->yuv_window, p_vout->p_sys->gc, p_vout->p_sys->yuv_window, p_vout->p_sys->gc,
p_pic->p_sys->p_image, 0 /*src_x*/, 0 /*src_y*/, p_pic->p_sys->p_image, 0 /*src_x*/, 0 /*src_y*/,
p_vout->output.i_width, p_vout->output.i_height, p_vout->output.i_width, p_vout->output.i_height,
0 /*dest_x*/, 0 /*dest_y*/, i_width, i_height, 0 /*dest_x*/, 0 /*dest_y*/, i_width, i_height,
False /* Don't put True here or you'll waste your CPU */ ); False /* Don't put True here or you'll waste your CPU */ );
#else # else
XShmPutImage( p_vout->p_sys->p_display, p_vout->p_sys->window, XShmPutImage( p_vout->p_sys->p_display, p_vout->p_sys->window,
p_vout->p_sys->gc, p_pic->p_sys->p_image, p_vout->p_sys->gc, p_pic->p_sys->p_image,
0 /*src_x*/, 0 /*src_y*/, 0 /*dest_x*/, 0 /*dest_y*/, 0 /*src_x*/, 0 /*src_y*/, 0 /*dest_x*/, 0 /*dest_y*/,
p_vout->output.i_width, p_vout->output.i_height, p_vout->output.i_width, p_vout->output.i_height,
False /* Don't put True here ! */ ); False /* Don't put True here ! */ );
#endif # endif
} }
else else
#endif /* HAVE_SYS_SHM_H */
{ {
/* Use standard XPutImage -- this is gonna be slow ! */ /* Use standard XPutImage -- this is gonna be slow ! */
#ifdef MODULE_NAME_IS_xvideo #ifdef MODULE_NAME_IS_xvideo
...@@ -1128,22 +1141,24 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1128,22 +1141,24 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
return -1; return -1;
} }
#ifdef HAVE_SYS_SHM_H
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
{ {
/* Create image using XShm extension */ /* Create image using XShm extension */
p_pic->p_sys->p_image = p_pic->p_sys->p_image =
CreateShmImage( p_vout->p_sys->p_display, CreateShmImage( p_vout->p_sys->p_display,
#ifdef MODULE_NAME_IS_xvideo # ifdef MODULE_NAME_IS_xvideo
p_vout->p_sys->i_xvport, p_vout->p_sys->i_xvport,
p_vout->output.i_chroma, p_vout->output.i_chroma,
#else # else
p_vout->p_sys->p_visual, p_vout->p_sys->p_visual,
p_vout->p_sys->i_screen_depth, p_vout->p_sys->i_screen_depth,
#endif # endif
&p_pic->p_sys->shminfo, &p_pic->p_sys->shminfo,
p_vout->output.i_width, p_vout->output.i_height ); p_vout->output.i_width, p_vout->output.i_height );
} }
else else
#endif /* HAVE_SYS_SHM_H */
{ {
/* Create image without XShm extension */ /* Create image without XShm extension */
p_pic->p_sys->p_image = p_pic->p_sys->p_image =
...@@ -1360,6 +1375,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1360,6 +1375,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic ) static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
{ {
/* The order of operations is correct */ /* The order of operations is correct */
#ifdef HAVE_SYS_SHM_H
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
{ {
XShmDetach( p_vout->p_sys->p_display, &p_pic->p_sys->shminfo ); XShmDetach( p_vout->p_sys->p_display, &p_pic->p_sys->shminfo );
...@@ -1373,6 +1389,7 @@ static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1373,6 +1389,7 @@ static void FreePicture( vout_thread_t *p_vout, picture_t *p_pic )
} }
} }
else else
#endif
{ {
IMAGE_FREE( p_pic->p_sys->p_image ); IMAGE_FREE( p_pic->p_sys->p_image );
} }
...@@ -1986,14 +2003,16 @@ static int InitDisplay( vout_thread_t *p_vout ) ...@@ -1986,14 +2003,16 @@ static int InitDisplay( vout_thread_t *p_vout )
int i_count; /* array size */ int i_count; /* array size */
#endif #endif
#ifdef SYS_DARWIN #ifdef HAVE_SYS_SHM_H
# ifdef SYS_DARWIN
/* FIXME : As of 2001-03-16, XFree4 for MacOS X does not support Xshm. */ /* FIXME : As of 2001-03-16, XFree4 for MacOS X does not support Xshm. */
p_vout->p_sys->b_shm = 0; p_vout->p_sys->b_shm = 0;
#else # else
p_vout->p_sys->b_shm = ( XShmQueryExtension( p_vout->p_sys->p_display ) p_vout->p_sys->b_shm = ( XShmQueryExtension( p_vout->p_sys->p_display )
== True ); == True );
#endif # endif
if( !p_vout->p_sys->b_shm ) if( !p_vout->p_sys->b_shm )
#endif
{ {
intf_WarnMsg( 1, "vout warning: XShm video extension is unavailable" ); intf_WarnMsg( 1, "vout warning: XShm video extension is unavailable" );
} }
...@@ -2082,6 +2101,7 @@ static int InitDisplay( vout_thread_t *p_vout ) ...@@ -2082,6 +2101,7 @@ static int InitDisplay( vout_thread_t *p_vout )
return( 0 ); return( 0 );
} }
#ifdef HAVE_SYS_SHM_H
/***************************************************************************** /*****************************************************************************
* CreateShmImage: create an XImage or XvImage using shared memory extension * CreateShmImage: create an XImage or XvImage using shared memory extension
***************************************************************************** *****************************************************************************
...@@ -2157,6 +2177,7 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM, ...@@ -2157,6 +2177,7 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM,
return( p_image ); return( p_image );
} }
#endif
/***************************************************************************** /*****************************************************************************
* CreateImage: create an XImage or XvImage * CreateImage: create an XImage or XvImage
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* netutils.c: various network functions * netutils.c: various network functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: netutils.c,v 1.55 2002/01/13 18:13:07 gbazin Exp $ * $Id: netutils.c,v 1.56 2002/02/20 23:23:53 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#ifdef WIN32 #ifdef WIN32
# include <winsock2.h> # include <winsock2.h>
#elif !defined( SYS_BEOS ) && !defined( SYS_NTO ) #elif !defined( SYS_BEOS )
# include <netdb.h> /* hostent ... */ # include <netdb.h> /* hostent ... */
# include <sys/socket.h> /* BSD: struct sockaddr */ # include <sys/socket.h> /* BSD: struct sockaddr */
# include <netinet/in.h> /* BSD: struct in_addr */ # include <netinet/in.h> /* BSD: struct in_addr */
......
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