Commit 0a4aeaa6 authored by Sam Hocevar's avatar Sam Hocevar

  * Coding style fixes here and there.
  * Miscellaneous QNX compile fixes.
  * Beginning of the mingw32 port by Gildas Bazin <gbazin@netcourrier.com>.
  * Added Marcari and Gildas to the AUTHORS file.

  (I commited the mingw32 port because it doesn't add any new code outside
   the #ifdefs, but we won't tell a word about it for the moment. We don't
   really need windows users whining about bugs, do we ?)
parent eb7f7ca0
......@@ -5,6 +5,11 @@
# The fields are: name (N), email (E), web-address (W), CVS account login (C),
# PGP key ID and fingerprint (P), description (D), and snail-mail address (S).
N: Marc Ariberti
C: marcari
E: marcari@via.ecp.fr
D: communication with channel server
N: Pierre Baillet
E: oct@zoy.org
C: octplane
......@@ -14,6 +19,10 @@ N: Ethan C. Baldridge
E: BaldridgeE@cadmus.com
D: directory browsing code in modules.c
N: Gildas Bazin
E: gbazin@netcourrier.com
D: mingw32 port
N: Stphane Borel
E: stef@via.ecp.fr
C: stef
......@@ -40,6 +49,7 @@ E: ndeb@ece.cmu.edu
D: Minor configure.in and Makefile.in fixes
N: Cyril Deguet
C: asmax
E: asmax@via.ecp.fr
D: PS input packet allocator
......
......@@ -4,7 +4,10 @@
HEAD
* Changed broadcast handling
* Coding style fixes here and there.
* Miscellaneous QNX compile fixes.
* Beginning of the mingw32 port by Gildas Bazin <gbazin@netcourrier.com>.
* Changed broadcast handling.
* Added a vlc-howto in sgml format in the doc directory.
* Fixed the continuous 'seeking position' bug in network mode.
* Support for `ts://foo:42' style input source.
......
......@@ -176,7 +176,7 @@ distclean: clean
rm -f **/*.o **/*~ *.log
rm -f Makefile.opts
rm -f include/defs.h include/config.h include/modules_builtin.h
rm -f config.status config.cache config.log
rm -f config*status config*cache config*log
rm -f gmon.out core build-stamp
rm -Rf .dep
rm -f .gdb_history
......@@ -353,5 +353,5 @@ $(PLUGIN_OBJ): FORCE
builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
$(BUILTIN_OBJ): FORCE
cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
ranlib $@
$(RANLIB) $@
......@@ -13,13 +13,13 @@
# the plugins in this line and put them as built-ins, otherwise your
# application won't be able to load them.
#
PLUGINS := @PLUGINS@
PLUGINS :=@PLUGINS@
#
# Built-in modules to build
# WARNING: do NOT put gtk and gnome together in this rule.
#
BUILTINS := @BUILTINS@
BUILTINS :=@BUILTINS@
#
# Additional build options
......@@ -42,7 +42,9 @@ GETOPT = @GETOPT@
# Build environment
#
CC = @CC@
CFLAGS = @CFLAGS@
SHELL = @SHELL@
RANLIB = @RANLIB@
#
# Installation environment
......@@ -137,6 +139,10 @@ INCLUDE += -Iinclude -Iextras -I/usr/local/include
#
LIB += @LIB@ -L/usr/local/lib
ifneq (,$(findstring mingw32,$(SYS)))
LIB += -lws2_32
endif
#
# Libraries needed by built-in modules
#
......
This diff is collapsed.
......@@ -13,22 +13,37 @@ dnl Check for tools
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Check for compiler environment
AC_C_CONST
AC_C_BIGENDIAN
dnl Check for endianness if not cross-compiling
if test x${cross_compiling} != xyes; then
AC_C_BIGENDIAN
fi
dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)
AC_CHECK_FUNC(connect,,[AC_CHECK_LIB(socket,connect,LIB="${LIB} -lsocket")])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname,LIB="${LIB} -lnsl")])
AC_CHECK_FUNC(nanosleep,,[AC_CHECK_LIB(rt,nanosleep,LIB="${LIB} -lrt",[AC_CHECK_LIB(posix4,nanosleep,LIB="${LIB} -lposix4")])])
AC_CHECK_FUNC(connect,,[
AC_CHECK_LIB(socket,connect,LIB="${LIB} -lsocket")
])
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname,LIB="${LIB} -lnsl")
])
AC_CHECK_FUNC(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep,LIB="${LIB} -lrt",[
AC_CHECK_LIB(posix4,nanosleep,LIB="${LIB} -lposix4")
])
])
AC_CHECK_FUNCS(usleep)
AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")])
AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
......@@ -54,10 +69,10 @@ AC_EGREP_CPP(yes,
AC_CHECK_LIB(threads,thread_create,LIB="${LIB} -lthreads")
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
AC_CHECK_HEADERS(stddef.h)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(sys/sockio.h)
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h unistd.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
......@@ -66,6 +81,16 @@ AC_CHECK_HEADERS(machine/param.h)
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_cond_t.)
])
AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.)
])
dnl Do a series of bizarre compilation tests
save_CFLAGS=$CFLAGS
......@@ -74,7 +99,7 @@ CFLAGS="${CFLAGS} -Wall -Werror"
AC_MSG_CHECKING([for ntohl in sys/param.h])
AC_TRY_COMPILE([#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }],,
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if ntohl is in <sys/param.h>.)
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl Check for -rdynamic flag
......@@ -110,11 +135,17 @@ dnl
dnl default modules
dnl
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
if test x$host_os = xbeos; then
case x$host_os in
xbeos|xnto-qnx)
ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
else
;;
xmingw32msvc)
ACCEL_PLUGINS="idctmmx idctmmxext motionmmx motionmmxext"
;;
*)
ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
fi
;;
esac
dnl
dnl DVD module: check for DVD ioctls
......@@ -166,7 +197,7 @@ AC_ARG_ENABLE(mmx,
[ --disable-mmx Disable MMX optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH="${ARCH} mmx";
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
dnl
......@@ -507,9 +538,9 @@ trace mode : ${TRACE}
optimizations : ${OPTIMS}
CSS decryption : ${CSS}
need builtin getopt : ${GETOPT}
plugin modules : ${PLUGINS}
built-in modules : ${BUILTINS}
vlc aliases : ${ALIASES}
plugin modules :${PLUGINS}
built-in modules :${BUILTINS}
vlc aliases :${ALIASES}
You may now tune Makefile.opts at your convenience."
......@@ -75,6 +75,9 @@
#include <unixlib.h>
#if HAVE_STRING_H - 0
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#endif
#endif
......@@ -650,6 +653,7 @@ int
else
{
if (opterr)
{
if (argv[optind - 1][1] == '-')
/* --option */
fprintf(stderr,
......@@ -660,6 +664,7 @@ int
fprintf(stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
}
nextchar += strlen(nextchar);
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.30 2001/04/11 02:01:24 henri Exp $
* $Id: common.h,v 1.31 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -142,6 +142,7 @@ struct data_packet_s;
#ifdef NTOHL_IN_SYS_PARAM_H
# include <sys/param.h>
#elif defined(WIN32)
#else
# include <netinet/in.h>
#endif
......
......@@ -451,7 +451,7 @@
* message function was called */
#define INTF_MSG_DBG_FORMAT "## %s:%s(),%i: "
/* Maximal number of arguments on a command line, including the function name */
/* Max number of arguments on a command line, including the function name */
#define INTF_MAX_ARGS 20
/* Maximal size of a command line in a script */
......
......@@ -109,6 +109,9 @@
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
......@@ -133,7 +136,13 @@
/* getopt support */
#undef HAVE_GETOPT_LONG
/* Define if ntohl is in <sys/param.h>. */
/* Define if <pthread.h> defines pthread_cond_t. */
#undef PTHREAD_COND_T_IN_PTHREAD_H
/* Define if <strings.h> defines strncasecmp. */
#undef STRNCASECMP_IN_STRINGS_H
/* Define if <sys/param.h> defines ntohl. */
#undef NTOHL_IN_SYS_PARAM_H
/* Define if <sys/types.h> defines boolean_t. */
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.29 2001/04/25 10:22:32 massiot Exp $
* $Id: input_ext-dec.h,v 1.30 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -169,7 +169,7 @@ typedef struct bit_stream_s
byte_t * p_byte;
/* Pointer to the last byte that is to be read (in the current packet */
byte_t * p_end;
/* Temporary buffer in case we're not aligned when changing data packets. */
/* Temporary buffer in case we're not aligned when changing data packets */
WORD_TYPE i_showbits_buffer;
data_packet_t showbits_data;
} bit_stream_t;
......
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.20 2001/04/15 04:19:57 sam Exp $
* $Id: modules.h,v 1.21 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -21,6 +21,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifdef WIN32
#include <sys/types.h> /* off_t */
#endif
/* Number of tries before we unload an unused module */
#define MODULE_HIDE_DELAY 100
......
This diff is collapsed.
/*****************************************************************************
* dvd_udf.c: udf filesystem tools.
* ---
*****************************************************************************
* Mainly used to find asolute logical block adress of *.ifo files. It only
* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_udf.c,v 1.5 2001/04/15 04:19:57 sam Exp $
* $Id: dvd_udf.c,v 1.6 2001/04/28 03:36:25 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -43,6 +43,9 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include <fcntl.h>
#include "common.h"
......@@ -85,8 +88,8 @@ typedef struct ad_s
/*****************************************************************************
* UDFReadLB: reads absolute Logical Block of the disc
* ---
* returns number of read bytes on success, 0 on error
*****************************************************************************
* Returns number of read bytes on success, 0 on error
*****************************************************************************/
static int UDFReadLB( int i_fd, off_t i_lba, size_t i_block_count, u8 *pi_data )
{
......@@ -244,8 +247,8 @@ static int UDFPartition( u8 * pi_data, u16 * pi_flags, u16 * pi_nb,
/*****************************************************************************
* UDFLogVolume: reads the volume descriptor and checks the parameters
* ---
* returns 0 on OK, 1 on error
*****************************************************************************
* Returns 0 on OK, 1 on error
*****************************************************************************/
static int UDFLogVolume(u8 * pi_data, char * p_volume_descriptor )
{
......@@ -357,7 +360,7 @@ static int UDFFileIdentifier( u8 * pi_data, u8 * pi_file_characteristics,
/*****************************************************************************
* UDFMapICB: Maps ICB to FileAD
* ---
*****************************************************************************
* ICB: Location of ICB of directory to scan
* FileType: Type of the file
* File: Location of file the ICB is pointing to
......@@ -397,7 +400,7 @@ static int UDFMapICB( struct ad_s icb, u8 * pi_file_type, struct ad_s * p_file,
/*****************************************************************************
* UDFScanDir: serach filename in dir
* ---
*****************************************************************************
* Dir: Location of directory to scan
* FileName: Name of file to look for
* FileICB: Location of ICB of the found file
......@@ -489,14 +492,13 @@ static int UDFScanDir( struct ad_s dir, char * psz_filename,
return 0;
}
/******************************************************************************
/*****************************************************************************
* UDFFindPartition: looks for a partition on the disc
* ---
*****************************************************************************
* partnum: number of the partition, starting at 0
* part: structure to fill with the partition information
* return 1 if partition found, 0 on error;
******************************************************************************/
*****************************************************************************/
static int UDFFindPartition( int i_part_nb, struct partition_s *p_partition )
{
u8 pi_lb[DVD_LB_SIZE];
......@@ -634,13 +636,13 @@ static int UDFFindPartition( int i_part_nb, struct partition_s *p_partition )
}
/******************************************************************************
/*****************************************************************************
* UDFFindFile: looks for a file on the UDF disc/imagefile
* ---
*****************************************************************************
* Path has to be the absolute pathname on the UDF filesystem,
* starting with '/'.
* returns absolute LB number, or 0 on error
******************************************************************************/
*****************************************************************************/
u32 UDFFindFile( int i_fd, char * psz_path )
{
struct partition_s partition;
......@@ -737,3 +739,4 @@ u32 UDFFindFile( int i_fd, char * psz_path )
return partition.i_start + file.i_location;
}
/*****************************************************************************
* input_dvd.c: DVD raw reading plugin.
* ---
*****************************************************************************
* This plugins should handle all the known specificities of the DVD format,
* especially the 2048 bytes logical block size.
* It depends on:
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.50 2001/04/27 19:29:11 massiot Exp $
* $Id: input_dvd.c,v 1.51 2001/04/28 03:36:25 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -51,6 +51,9 @@
#include <sys/uio.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include <errno.h>
#include "config.h"
......@@ -1346,7 +1349,8 @@ static int DVDChapterSelect( thread_dvd_data_t * p_dvd, int i_chapter )
DVDChooseAngle( p_dvd );
/* Search for cell_index in cell adress_table and initialize start sector */
/* Search for cell_index in cell adress_table and initialize
* start sector */
if( DVDFindSector( p_dvd ) < 0 )
{
intf_ErrMsg( "dvd error: can't select chapter" );
......
......@@ -2,7 +2,7 @@
* fb.c : framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: fb.c,v 1.5 2001/03/21 13:42:33 sam Exp $
* $Id: fb.c,v 1.6 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* ggi.c : GGI plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: ggi.c,v 1.5 2001/03/21 13:42:34 sam Exp $
* $Id: ggi.c,v 1.6 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: glide.c,v 1.4 2001/03/21 13:42:34 sam Exp $
* $Id: glide.c,v 1.5 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.6 2001/03/21 13:42:34 sam Exp $
* $Id: gnome.c,v 1.7 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -48,7 +48,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gtk.c,v 1.2 2001/03/21 13:42:34 sam Exp $
* $Id: gtk.c,v 1.3 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -48,7 +48,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.14 2001/04/11 04:31:59 sam Exp $
* $Id: gtk_callbacks.c,v 1.15 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -29,7 +29,7 @@
* Preamble
*****************************************************************************/
#include "defs.h"
#include <sys/types.h> /* off_t */
#include <stdlib.h>
#include <gtk/gtk.h>
......@@ -58,7 +58,7 @@
/*****************************************************************************
* Callbacks
******************************************************************************/
*****************************************************************************/
void
on_menubar_open_activate (GtkMenuItem *menuitem,
gpointer user_data)
......
......@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: gtk_playlist.c,v 1.9 2001/04/08 13:09:32 octplane Exp $
* $Id: gtk_playlist.c,v 1.10 2001/04/28 03:36:25 sam Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
*
......@@ -170,7 +170,11 @@ rebuildCList(GtkCList * clist, playlist_t * playlist_p)
for( dummy=0; dummy < playlist_p->i_size; dummy++ )
{
#ifdef WIN32 /* WIN32 HACK */
text[0] = g_strdup( "" );
#else
text[0] = g_strdup( rindex( (char *)(playlist_p->p_item[playlist_p->i_size -1 - dummy].psz_name ), '/' ) + 1 );
#endif
text[1] = g_strdup( "no info");
gtk_clist_insert( clist, 0, text );
......
......@@ -340,7 +340,8 @@ static int MakeWindow( vout_thread_t *p_vout )
}
/*****************************************************************************
* AllocBuffer: forces offscreen allocation (if different than current) in memory type specified
* AllocBuffer: forces offscreen allocation (if different than current) in
* memory type specified
*****************************************************************************/
static int AllocBuffer ( vout_thread_t *p_vout, short index )
{
......@@ -462,7 +463,7 @@ static void vout_Display( vout_thread_t *p_vout )
/*****************************************************************************
* flushQD: flushes buffered window area
*****************************************************************************/
*****************************************************************************/
void flushQD( vout_thread_t *p_vout )
{
CGrafPtr thePort;
......@@ -491,7 +492,7 @@ void flushQD( vout_thread_t *p_vout )
/*****************************************************************************
* BlitToWindow: checks offscreen and blits it to the front
*****************************************************************************/
*****************************************************************************/
void BlitToWindow( vout_thread_t *p_vout, short index )
{
......
......@@ -2,7 +2,7 @@
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: mga.c,v 1.4 2001/03/21 13:42:34 sam Exp $
* $Id: mga.c,v 1.5 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* input_es.c: Elementary Stream demux and packet management
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input_es.c,v 1.1 2001/04/20 15:02:48 sam Exp $
* $Id: input_es.c,v 1.2 2001/04/28 03:36:25 sam Exp $
*
* Authors:
*
......@@ -213,7 +213,11 @@ static void ESSeek( input_thread_t * p_input, off_t i_position )
p_method = (thread_es_data_t *)p_input->p_plugin_data;
/* A little bourrin but should work for a while --Meuuh */
#ifndef WIN32
fseeko( p_method->stream, i_position, SEEK_SET );
#else
fseek( p_method->stream, (long)i_position, SEEK_SET );
#endif
p_input->stream.p_selected_area->i_tell = i_position;
}
......
......@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.19 2001/04/27 23:29:14 stef Exp $
* $Id: input_ps.c,v 1.20 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -32,6 +32,9 @@
#include <stdlib.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include <errno.h>
#include <sys/types.h>
......@@ -527,7 +530,11 @@ static void PSSeek( input_thread_t * p_input, off_t i_position )
p_method = (thread_ps_data_t *)p_input->p_plugin_data;
/* A little bourrin but should work for a while --Meuuh */
#ifndef WIN32
fseeko( p_method->stream, i_position, SEEK_SET );
#else
fseek( p_method->stream, (long)i_position, SEEK_SET );
#endif
p_input->stream.p_selected_area->i_tell = i_position;
}
......
......@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ts.c,v 1.15 2001/04/27 16:08:26 sam Exp $
* $Id: input_ts.c,v 1.16 2001/04/28 03:36:25 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -31,14 +31,22 @@
#include <stdlib.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#ifdef SYS_NTO
#include <sys/select.h>
#endif
#ifndef WIN32
#include <sys/uio.h>
#endif
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
......@@ -195,7 +203,7 @@ static void TSInit( input_thread_t * p_input )
*****************************************************************************/
void TSFakeOpen( input_thread_t * p_input )
{
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
#if !defined( SYS_BEOS ) && !defined( SYS_NTO ) && !defined( WIN32 )
char *psz_name = p_input->p_source;
if( ( strlen(psz_name) > 3 ) && !strncasecmp( psz_name, "ts:", 3 ) )
......@@ -279,7 +287,11 @@ static int TSRead( input_thread_t * p_input,
if( i_data )
{
#ifndef WIN32
i_read = readv( p_input->i_handle, p_iovec, INPUT_READ_ONCE );
#else
i_read = -1;
#endif
if( i_read == -1 )
{
......@@ -301,3 +313,4 @@ static int TSRead( input_thread_t * p_input,
}
return 0;
}
......@@ -2,7 +2,7 @@
* aout_sdl.c : audio sdl functions library
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_sdl.c,v 1.11 2001/04/26 11:23:16 sam Exp $
* $Id: aout_sdl.c,v 1.12 2001/04/28 03:36:25 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -109,7 +109,6 @@ static int aout_Probe( probedata_t *p_data )
{
SDL_AudioSpec desired, obtained;
return 0;
/* Start AudioSDL */
if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) != 0 )
{
......@@ -120,7 +119,7 @@ static int aout_Probe( probedata_t *p_data )
desired.freq = 11025; /* frequency */
desired.format = AUDIO_U8; /* unsigned 8 bits */
desired.channels = 2; /* mono */
desired.callback = NULL; /* no callback function yet */
desired.callback = aout_SDLCallback; /* callback function mandatory */
desired.userdata = NULL; /* null parm for callback */
desired.samples = 4096;
......@@ -133,6 +132,7 @@ static int aout_Probe( probedata_t *p_data )
}
/* Otherwise, there are good chances we can use this plugin, return 100. */
intf_DbgMsg( "aout: SDL_OpenAudio successfully run" );
SDL_CloseAudio();
if( TestMethod( AOUT_METHOD_VAR, "sdl" ) )
......
......@@ -2,7 +2,7 @@
* sdl.c : SDL plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: sdl.c,v 1.14 2001/03/21 13:42:34 sam Exp $
* $Id: sdl.c,v 1.15 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
......@@ -55,7 +55,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
......
......@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_sdl.c,v 1.47 2001/04/11 02:01:24 henri Exp $
* $Id: vout_sdl.c,v 1.48 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
......@@ -158,8 +158,12 @@ static int vout_Create( vout_thread_t *p_vout )
}
/* Initialize library */
if( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTTHREAD | SDL_INIT_NOPARACHUTE)
< 0 )
if( SDL_Init( SDL_INIT_VIDEO
#ifndef WIN32
/* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet*/
| SDL_INIT_EVENTTHREAD
#endif
| SDL_INIT_NOPARACHUTE ) < 0 )
{
intf_ErrMsg( "vout error: can't initialize SDL (%s)", SDL_GetError() );
free( p_vout->p_sys );
......
......@@ -2,7 +2,7 @@
* ncurses.c : NCurses plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ncurses.c,v 1.3 2001/03/21 13:42:34 sam Exp $
* $Id: ncurses.c,v 1.4 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -48,7 +48,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( intf_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* vout_x11.c: X11 video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_x11.c,v 1.21 2001/04/27 19:29:11 massiot Exp $
* $Id: vout_x11.c,v 1.22 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -559,7 +559,8 @@ static int vout_Manage( vout_thread_t *p_vout )
if ( b_gofullscreen )
{
char *psz_display;
/* Open display, unsing 'vlc_display' or DISPLAY environment variable */
/* Open display, unsing 'vlc_display' or the DISPLAY
* environment variable */
psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
intf_DbgMsg( "vout: changing full-screen status" );
......
......@@ -2,7 +2,7 @@
* x11.c : X11 plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: x11.c,v 1.5 2001/03/21 13:42:34 sam Exp $
* $Id: x11.c,v 1.6 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* xvideo.c : Xvideo plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: xvideo.c,v 1.1 2001/04/01 06:21:44 sam Exp $
* $Id: xvideo.c,v 1.2 2001/04/28 03:36:25 sam Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
*
......@@ -51,7 +51,7 @@ MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
******************************************************************************/
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* transforms_yuvmmx.h: MMX YUV transformation assembly
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: transforms_yuvmmx.h,v 1.3 2001/03/21 13:42:34 sam Exp $
* $Id: transforms_yuvmmx.h,v 1.4 2001/04/28 03:36:25 sam Exp $
*
* Authors: Olie Lho <ollie@sis.com.tw>
* Gal Hendryckx <jimmy@via.ecp.fr>
......@@ -44,7 +44,6 @@ UNUSED_LONGLONG(mmx_blueshift) = 0x03;
#undef UNUSED_LONGLONG
#define MMX_INIT_16 " \n\
\n\
movd (%1), %%mm0 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
movd (%2), %%mm1 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
pxor %%mm4, %%mm4 # zero mm4 \n\
......@@ -53,13 +52,11 @@ movq (%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
"
#define MMX_INIT_16_GRAY " \n\
\n\
movq (%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
#movl $0, (%3) # cache preload for image \n\
"
#define MMX_INIT_32 " \n\
\n\
movd (%1), %%mm0 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
movl $0, (%3) # cache preload for image \n\
movd (%2), %%mm1 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
......@@ -76,7 +73,6 @@ movq (%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
*/
#define MMX_YUV_MUL " \n\
\n\
# convert the chroma part \n\
punpcklbw %%mm4, %%mm0 # scatter 4 Cb 00 u3 00 u2 00 u1 00 u0 \n\
punpcklbw %%mm4, %%mm1 # scatter 4 Cr 00 v3 00 v2 00 v1 00 v0 \n\
......@@ -104,7 +100,6 @@ pmulhw mmx_Y_coeff, %%mm7 # Mul 4 Y odd 00 y7 00 y5 00 y3 00 y1 \n\
"
#define MMX_YUV_YCBR_422 " \n\
\n\
punpcklbw %%mm1, %%mm0 \n\
movq %%mm6, %%mm2 \n\
punpckhbw %%mm0, %%mm6 \n\
......@@ -122,7 +117,6 @@ movq %%mm6, 8(%3) \n\
*/
#define MMX_YUV_ADD " \n\
\n\
# Do horizontal and vertical scaling \n\
movq %%mm0, %%mm3 # Copy Cblue \n\
movq %%mm1, %%mm4 # Copy Cred \n\
......@@ -155,7 +149,6 @@ punpcklbw %%mm5, %%mm2 # G7 G6 G5 G4 G3 G2 G1 G0 \n\
*/
#define MMX_YUV_GRAY " \n\
\n\
# convert the luma part \n\
psubusb mmx_10w, %%mm6 \n\
movq %%mm6, %%mm7 \n\
......@@ -201,7 +194,6 @@ movq %%mm2, 8(%3) \n\
*/
#define MMX_UNPACK_16 " \n\
\n\
# mask unneeded bits off \n\
pand mmx_redmask, %%mm0 # b7b6b5b4 b3______ b7b6b5b4 b3______ \n\
pand mmx_grnmask, %%mm2 # g7g6g5g4 g3g2____ g7g6g5g4 g3g2____ \n\
......@@ -237,7 +229,6 @@ movq %%mm5, 8(%3) # store pixel 4-7 \n\
*/
#define MMX_UNPACK_32 " \n\
\n\
pxor %%mm3, %%mm3 # zero mm3 \n\
movq %%mm0, %%mm6 # B7 B6 B5 B4 B3 B2 B1 B0 \n\
movq %%mm1, %%mm7 # R7 R6 R5 R4 R3 R2 R1 R0 \n\
......@@ -265,3 +256,4 @@ movq %%mm4, 24(%3) # Store ARGB7 ARGB6 \n\
#pxor %%mm4, %%mm4 # zero mm4 \n\
#movq 8(%0), %%mm6 # Load 8 Y Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 \n\
"
......@@ -2,7 +2,7 @@
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: audio_output.c,v 1.56 2001/03/21 13:42:34 sam Exp $
* $Id: audio_output.c,v 1.57 2001/04/28 03:36:25 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -39,6 +39,9 @@
#include "defs.h"
#include <unistd.h> /* getpid() */
#ifdef WIN32 /* getpid() for win32 is located in process.h */
#include <process.h>
#endif
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* calloc(), malloc(), free() */
......@@ -116,8 +119,8 @@ aout_thread_t *aout_CreateThread( int *pi_status )
return( NULL );
}
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0; /* FIXME: only works
for i_channels == 1 or 2 ??*/
/* FIXME: only works for i_channels == 1 or 2 ?? */
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0;
if ( p_aout->pf_setformat( p_aout ) )
{
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.101 2001/04/27 18:07:56 henri Exp $
* $Id: input.c,v 1.102 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -34,12 +34,15 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include <errno.h>
/* Network functions */
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
#include <netdb.h> /* hostent ... */
#if !defined( SYS_BEOS ) && !defined( SYS_NTO ) && !defined( WIN32 )
#include <netdb.h> /* hostent ... */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
......@@ -488,7 +491,7 @@ void input_FileOpen( input_thread_t * p_input )
p_input->stream.p_selected_area->i_size = stat_info.st_size;
}
else if( S_ISFIFO(stat_info.st_mode)
#ifndef SYS_BEOS
#if !defined( SYS_BEOS ) && !defined( WIN32 )
|| S_ISSOCK(stat_info.st_mode)
#endif
)
......@@ -509,8 +512,13 @@ void input_FileOpen( input_thread_t * p_input )
vlc_mutex_unlock( &p_input->stream.stream_lock );
intf_Msg( "input: opening file `%s'", p_input->p_source );
#ifndef WIN32
if( (p_input->i_handle = open( psz_name,
/*O_NONBLOCK | O_LARGEFILE*/0 )) == (-1) )
#else
if( (p_input->i_handle = open( psz_name, O_BINARY
/*O_NONBLOCK | O_LARGEFILE*/ )) == (-1) )
#endif
{
intf_ErrMsg( "input error: cannot open file (%s)", strerror(errno) );
p_input->b_error = 1;
......@@ -531,7 +539,7 @@ void input_FileClose( input_thread_t * p_input )
}
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
#if !defined( SYS_BEOS ) && !defined( SYS_NTO ) && !defined( WIN32 )
/*****************************************************************************
* input_NetworkOpen : open a network socket
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_clock.c,v 1.10 2001/04/26 03:55:44 sam Exp $
* $Id: input_clock.c,v 1.11 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -27,6 +27,7 @@
#include "defs.h"
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_dec.c,v 1.10 2001/04/06 09:15:47 sam Exp $
* $Id: input_dec.c,v 1.11 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* input_ext-dec.c: services to the decoders
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-dec.c,v 1.13 2001/04/25 10:22:33 massiot Exp $
* $Id: input_ext-dec.c,v 1.14 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -27,6 +27,7 @@
#include "defs.h"
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-intf.c,v 1.21 2001/04/27 16:08:26 sam Exp $
* $Id: input_ext-intf.c,v 1.22 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -27,6 +27,11 @@
#include "defs.h"
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#ifdef WIN32
#define snprintf _snprintf
#endif
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* input_netlist.c: netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_netlist.c,v 1.33 2001/04/06 09:15:47 sam Exp $
* $Id: input_netlist.c,v 1.34 2001/04/28 03:36:25 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -29,7 +29,9 @@
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h>
#ifndef WIN32
#include <sys/uio.h> /* struct iovec */
#endif
#include <unistd.h>
#include "config.h"
......@@ -45,6 +47,13 @@
#include "input.h"
#include "input_netlist.h"
#ifdef WIN32
struct iovec
{
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
};
#endif
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.51 2001/04/27 19:29:11 massiot Exp $
* $Id: input_programs.c,v 1.52 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -28,6 +28,7 @@
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.51 2001/04/17 14:54:54 massiot Exp $
* $Id: mpeg_system.c,v 1.52 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -4,7 +4,7 @@
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: interface.c,v 1.72 2001/04/11 02:01:24 henri Exp $
* $Id: interface.c,v 1.73 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -32,6 +32,7 @@
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* FILE */
#include <string.h> /* strerror() */
#include <sys/types.h> /* off_t */
#include "config.h"
#include "common.h"
......
......@@ -2,7 +2,7 @@
* intf_channels.c: channel handling functions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_channels.c,v 1.2 2001/03/21 13:42:34 sam Exp $
* $Id: intf_channels.c,v 1.3 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -92,9 +92,9 @@ int intf_LoadChannels( intf_thread_t *p_intf, char *psz_filename )
if( i_index != 0 )
{
/* Allocate array and rewind - some of the lines may be invalid, and the
* array will probably be larger than the actual number of channels, but
* it has no consequence. */
/* Allocate array and rewind - some of the lines may be invalid,
* and the array will probably be larger than the actual number of
* channels, but it has no consequences. */
p_intf->p_channel = malloc( sizeof( intf_channel_t ) * i_index );
if( p_intf->p_channel == NULL )
{
......@@ -296,7 +296,7 @@ static int ParseChannel( intf_channel_t *p_channel, char *psz_str )
i_field = -1;
}
break;
case 5: /* input vlan id */
case 5: /* input vlan id */
p_channel->i_input_vlan_id = strtol( psz_str, &psz_end, 0);
if( (*psz_str == '\0') || (*psz_end != '\0') )
{
......
......@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_msg.c,v 1.31 2001/04/27 19:29:11 massiot Exp $
* $Id: intf_msg.c,v 1.32 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -47,6 +47,10 @@
#include "main.h"
#ifdef WIN32
#define snprintf _snprintf /* snprintf not defined in mingw32 (bug?) */
#endif
/*****************************************************************************
* intf_msg_item_t
*****************************************************************************
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.88 2001/04/27 18:07:56 henri Exp $
* $Id: main.c,v 1.89 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -261,7 +261,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* Read configuration
*/
if( GetConfiguration( &i_argc, ppsz_argv, ppsz_env ) ) /* parse cmd line */
if( GetConfiguration( &i_argc, ppsz_argv, ppsz_env ) ) /* parse cmd line */
{
intf_MsgDestroy();
return( errno );
......@@ -864,13 +864,15 @@ static void Version( void )
static void InitSignalHandler( void )
{
/* Termination signals */
signal( SIGHUP, FatalSignalHandler );
#ifndef WIN32
signal( SIGINT, FatalSignalHandler );
signal( SIGHUP, FatalSignalHandler );
signal( SIGQUIT, FatalSignalHandler );
/* Other signals */
signal( SIGALRM, SimpleSignalHandler );
signal( SIGPIPE, SimpleSignalHandler );
#endif
}
......@@ -897,9 +899,11 @@ static void FatalSignalHandler( int i_signal )
/* Once a signal has been trapped, the termination sequence will be
* armed and following signals will be ignored to avoid sending messages
* to an interface having been destroyed */
signal( SIGHUP, SIG_IGN );
#ifndef WIN32
signal( SIGINT, SIG_IGN );
signal( SIGHUP, SIG_IGN );
signal( SIGQUIT, SIG_IGN );
#endif
/* Acknowledge the signal received */
intf_ErrMsgImm( "intf error: signal %d received, exiting", i_signal );
......
......@@ -2,7 +2,7 @@
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.26 2001/04/20 11:06:48 sam Exp $
* $Id: modules.c,v 1.27 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -72,7 +72,7 @@ static int AllocateBuiltinModule( module_bank_t *,
int ( * ) ( module_t * ),
int ( * ) ( module_t * ),
int ( * ) ( module_t * ) );
static int FreeModule ( module_bank_t * p_bank, module_t * );
static int DeleteModule ( module_bank_t * p_bank, module_t * );
static int LockModule ( module_t * );
static int UnlockModule ( module_t * );
#ifdef HAVE_DYNAMIC_PLUGINS
......@@ -213,7 +213,7 @@ void module_DestroyBank( module_bank_t * p_bank )
while( p_bank->first != NULL )
{
if( FreeModule( p_bank, p_bank->first ) )
if( DeleteModule( p_bank, p_bank->first ) )
{
/* Module deletion failed */
intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
......@@ -406,7 +406,7 @@ void module_Unneed( module_bank_t * p_bank, module_t * p_module )
*****************************************************************************
* This function loads a dynamically loadable module and allocates a structure
* for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by FreeModule.
* module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/
static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
{
......@@ -525,7 +525,7 @@ static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
*****************************************************************************
* This function registers a built-in module and allocates a structure
* for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by FreeModule.
* module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/
static int AllocateBuiltinModule( module_bank_t * p_bank,
int ( *pf_init ) ( module_t * ),
......@@ -623,11 +623,11 @@ static int AllocateBuiltinModule( module_bank_t * p_bank,
}
/*****************************************************************************
* FreeModule: delete a module and its structure.
* DeleteModule: delete a module and its structure.
*****************************************************************************
* This function can only be called if i_usage <= 0.
*****************************************************************************/
static int FreeModule( module_bank_t * p_bank, module_t * p_module )
static int DeleteModule( module_bank_t * p_bank, module_t * p_module )
{
/* If the module is not in use but is still in memory, we first have
* to hide it and remove it from memory before we can free the
......
......@@ -3,7 +3,7 @@
* Functions are prototyped in mtime.h.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mtime.c,v 1.16 2001/03/21 13:42:34 sam Exp $
* $Id: mtime.c,v 1.17 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -40,6 +40,10 @@
#include <kernel/OS.h>
#endif
#ifdef WIN32
#include <windows.h>
#endif
#include "config.h"
#include "common.h"
#include "mtime.h"
......@@ -70,9 +74,30 @@ char *mstrtime( char *psz_buffer, mtime_t date )
*****************************************************************************/
mtime_t mdate( void )
{
#ifdef HAVE_KERNEL_OS_H
#if defined( HAVE_KERNEL_OS_H )
return( real_time_clock_usecs() );
#elif defined( WIN32 )
/* We don't get the real date, just the value of a high precision timer.
* this is because the usual time functions have at best only a milisecond
* resolution */
mtime_t freq,usec_time;
if( !QueryPerformanceFrequency((LARGE_INTEGER *)&freq) )
{
/* Milisecond resolution */
FILETIME file_time;
GetSystemTimeAsFileTime((FILETIME *)&file_time);
usec_time *= 1000;
}
else
{
/* Microsecond resolution */
QueryPerformanceCounter((LARGE_INTEGER *)&usec_time);
usec_time /= (freq/1000000);
}
return( usec_time );
#else
struct timeval tv_date;
......@@ -81,7 +106,7 @@ mtime_t mdate( void )
* here, since tv is a local variable. */
gettimeofday( &tv_date, NULL );
return( (mtime_t) tv_date.tv_sec * 1000000 + (mtime_t) tv_date.tv_usec );
#endif
}
......@@ -94,8 +119,7 @@ mtime_t mdate( void )
*****************************************************************************/
void mwait( mtime_t date )
{
#ifdef HAVE_KERNEL_OS_H
#if defined( HAVE_KERNEL_OS_H )
mtime_t delay;
delay = date - real_time_clock_usecs();
......@@ -104,15 +128,26 @@ void mwait( mtime_t date )
return;
}
snooze( delay );
#else
#ifdef HAVE_USLEEP
struct timeval tv_date;
#elif defined( WIN32 )
mtime_t usec_time, delay;
usec_time = mdate();
delay = date - usec_time;
if( delay <= 0 )
{
return;
}
/* Sleep only has milisecond resolution */
Sleep( (DWORD)(delay/1000) );
#else
struct timeval tv_date, tv_delay;
#endif
# ifdef HAVE_USLEEP
struct timeval tv_date;
# else
struct timeval tv_date, tv_delay;
# endif
mtime_t delay; /* delay in msec, signed to detect errors */
/* see mdate() about gettimeofday() possible errors */
......@@ -127,17 +162,17 @@ void mwait( mtime_t date )
return;
}
#ifdef HAVE_USLEEP
# ifdef HAVE_USLEEP
usleep( delay );
#else
# else
tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000;
/* see msleep() about select() errors */
select( 0, NULL, NULL, NULL, &tv_delay );
#endif
# endif
#endif /* HAVE_KERNEL_OS_H */
#endif
}
/*****************************************************************************
......@@ -147,12 +182,17 @@ void mwait( mtime_t date )
*****************************************************************************/
void msleep( mtime_t delay )
{
#ifdef HAVE_KERNEL_OS_H
#if defined( HAVE_KERNEL_OS_H )
snooze( delay );
#else
#ifdef HAVE_USLEEP
#elif defined( WIN32 )
Sleep( delay/1000 ); /* Sleep only has milisecond resolution */
/* Maybe we could use the multimedia timer to reach the right resolution, */
/* or the old Winsock select() function ?*/
#elif defined( HAVE_USLEEP )
usleep( delay );
#else
struct timeval tv_delay;
......@@ -163,7 +203,7 @@ void msleep( mtime_t delay )
* (i.e. when a signal is sent to the thread, or when memory is full), and
* can be ingnored. */
select( 0, NULL, NULL, NULL, &tv_delay );
#endif
#endif /* HAVE_KERNEL_OS_H */
#endif
}
......@@ -2,7 +2,7 @@
* netutils.c: various network functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.c,v 1.27 2001/04/27 18:07:57 henri Exp $
* $Id: netutils.c,v 1.28 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -28,15 +28,18 @@
*****************************************************************************/
#include "defs.h"
#include <netdb.h> /* gethostbyname() */
#include <stdlib.h> /* free(), realloc(), atoi() */
#include <errno.h> /* errno() */
#include <string.h> /* bzero(), bcopy() */
#include <unistd.h> /* gethostname() */
#include <sys/time.h> /* gettimeofday */
#ifndef WIN32
#include <netdb.h> /* gethostbyname() */
#include <netinet/in.h> /* BSD: struct in_addr */
#include <sys/socket.h> /* BSD: struct sockaddr */
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
#endif
......@@ -91,7 +94,7 @@ int network_BuildLocalAddr( struct sockaddr_in * p_socket, int i_port,
/* Reset struct */
memset( p_socket, 0, sizeof( struct sockaddr_in ) );
p_socket->sin_family = AF_INET; /* family */
p_socket->sin_family = AF_INET; /* family */
p_socket->sin_port = htons( i_port );
if( psz_broadcast == NULL )
{
......@@ -143,8 +146,8 @@ int network_BuildRemoteAddr( struct sockaddr_in * p_socket, char * psz_server )
/* Reset structure */
memset( p_socket, 0, sizeof( struct sockaddr_in ) );
p_socket->sin_family = AF_INET; /* family */
p_socket->sin_port = htons( 0 ); /* This is for remote end */
p_socket->sin_family = AF_INET; /* family */
p_socket->sin_port = htons( 0 ); /* This is for remote end */
/* Try to convert address directly from in_addr - this will work if
* psz_in_addr is dotted decimal. */
......
......@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: spu_decoder.c,v 1.37 2001/04/25 10:22:33 massiot Exp $
* $Id: spu_decoder.c,v 1.38 2001/04/28 03:36:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -27,6 +27,9 @@
#include "defs.h"
#include <unistd.h> /* getpid() */
#ifdef WIN32 /* getpid() for win32 is located in process.h */
#include <process.h>
#endif
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memcpy(), memset() */
......
......@@ -2,7 +2,7 @@
* video_text.c : text manipulation functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_text.c,v 1.25 2001/04/27 19:29:11 massiot Exp $
* $Id: video_text.c,v 1.26 2001/04/28 03:36:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -254,7 +254,11 @@ vout_font_t *vout_LoadFont( const char *psz_name )
}
/* Open file */
#ifndef WIN32
i_file = open( psz_file, O_RDONLY );
#else
i_file = open( psz_file, O_RDONLY | O_BINARY );
#endif
free( psz_file );
if( i_file != -1 )
......
......@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.79 2001/04/25 10:22:33 massiot Exp $
* $Id: video_parser.c,v 1.80 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -279,7 +279,7 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->pp_vdec[0]->b_error = 0;
p_vpar->pp_vdec[0]->p_vpar = p_vpar;
# ifndef SYS_BEOS
# if !defined(SYS_BEOS) && !defined(WIN32)
# if VDEC_NICE
/* Re-nice ourself */
if( nice(VDEC_NICE) == -1 )
......
......@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.c,v 1.79 2001/02/23 17:58:22 massiot Exp $
* $Id: vpar_blocks.c,v 1.80 2001/04/28 03:36:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -204,7 +204,8 @@ static lookup_t pl_dct_dc_chrom_init_table_2[32] =
};
/* Tables for ac DCT coefficients. There are cut in many parts to save space */
/* Tables for ac DCT coefficients. There are cut in many parts to
* save space */
/* Table B-14, DCT coefficients table zero,
* codes 0100 ... 1xxx (used for first (DC) coefficient)
*/
......@@ -2135,3 +2136,4 @@ DECLARE_PICD( vpar_PictureData2IB, 1, I_CODING_TYPE, BOTTOM_FIELD );
DECLARE_PICD( vpar_PictureData2PB, 1, P_CODING_TYPE, BOTTOM_FIELD );
DECLARE_PICD( vpar_PictureData2BB, 1, B_CODING_TYPE, BOTTOM_FIELD );
#endif
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.81 2001/04/06 09:15:48 sam Exp $
* $Id: vpar_headers.c,v 1.82 2001/04/28 03:36:26 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -344,7 +344,7 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
p_vpar->pi_default_intra_quant );
}
if( GetBits( &p_vpar->bit_stream, 1 ) ) /* load_non_intra_quantizer_matrix */
if( GetBits(&p_vpar->bit_stream, 1) ) /* load_non_intra_quantizer_matrix */
{
LoadMatrix( p_vpar, &p_vpar->sequence.nonintra_quant );
}
......@@ -381,7 +381,8 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
p_vpar->sequence.i_chroma_format = GetBits( &p_vpar->bit_stream, 2 );
p_vpar->sequence.i_width |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
p_vpar->sequence.i_height |= GetBits( &p_vpar->bit_stream, 2 ) << 12;
/* bit_rate_extension, marker_bit, vbv_buffer_size_extension, low_delay */
/* bit_rate_extension, marker_bit, vbv_buffer_size_extension,
* low_delay */
RemoveBits( &p_vpar->bit_stream, 22 );
/* frame_rate_extension_n */
i_dummy = GetBits( &p_vpar->bit_stream, 2 );
......@@ -693,7 +694,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
{
/* This is a new frame. Get a structure from the video_output. */
while( ( P_picture = vout_CreatePicture( p_vpar->p_vout,
99+p_vpar->sequence.i_chroma_format, /*XXX??*/
/* XXX */ 99+p_vpar->sequence.i_chroma_format,
p_vpar->sequence.i_width,
p_vpar->sequence.i_height ) )
== NULL )
......@@ -727,7 +728,8 @@ static void PictureHeader( vpar_thread_t * p_vpar )
#ifdef VDEC_SMP
/* Link referenced pictures for the decoder
* They are unlinked in vpar_ReleaseMacroblock() & vpar_DestroyMacroblock() */
* They are unlinked in vpar_ReleaseMacroblock() &
* vpar_DestroyMacroblock() */
if( p_vpar->picture.i_coding_type == P_CODING_TYPE ||
p_vpar->picture.i_coding_type == B_CODING_TYPE )
{
......
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