From bc061e8455fa11eec3167681d53f9df3974b13a5 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 11 Nov 2002 14:39:12 +0000 Subject: [PATCH] * ./include/*, ./src/*: separated WIN32 #tests and UNDER_CE #tests, because WIN32 isn't always defined under WinCE, but might be. Grmbl. * ./include/*: changed a few u* and s* to uint*_t and int*_t. --- include/aout_internal.h | 6 ++--- include/audio_output.h | 14 +++++----- include/input_ext-dec.h | 44 +++++++++++++++--------------- include/input_ext-intf.h | 22 +++++++-------- include/input_ext-plugins.h | 10 +++---- include/interface.h | 4 +-- include/iso_lang.h | 4 +-- include/main.h | 6 ++--- include/mmx.h | 16 +++++------ include/modules.h | 8 +++--- include/mtime.h | 4 +-- include/os_specific.h | 4 +-- include/variables.h | 4 +-- include/video.h | 27 ++++++++++--------- include/video_output.h | 10 +++---- include/vlc_common.h | 22 ++++++++------- include/vlc_config.h | 4 +-- include/vlc_cpu.h | 4 +-- include/vlc_threads.h | 14 +++++----- include/vlc_threads_funcs.h | 39 +++++++++++++++++++++++---- src/extras/dirent.c | 6 ++--- src/extras/getopt.c | 2 +- src/input/input.c | 16 +++-------- src/input/input_clock.c | 6 +---- src/input/input_dec.c | 6 +---- src/input/input_ext-dec.c | 6 +---- src/input/input_ext-intf.c | 6 +---- src/input/input_ext-plugins.c | 4 +-- src/input/input_info.c | 6 +---- src/input/input_programs.c | 8 ++---- src/interface/intf_eject.c | 13 ++++----- src/misc/configuration.c | 4 +-- src/misc/cpu.c | 6 ++--- src/misc/messages.c | 4 +-- src/misc/modules.c | 4 ++- src/misc/modules_plugin.h.in | 10 +++---- src/misc/mtime.c | 10 +++---- src/misc/netutils.c | 4 +-- src/misc/threads.c | 45 ++++++++++++++++++++++++------- src/stream_output/stream_output.c | 4 +-- 40 files changed, 230 insertions(+), 206 deletions(-) diff --git a/include/aout_internal.h b/include/aout_internal.h index d1df3a2a65..cc788d520e 100644 --- a/include/aout_internal.h +++ b/include/aout_internal.h @@ -2,7 +2,7 @@ * aout_internal.h : internal defines for audio output ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: aout_internal.h,v 1.30 2002/11/10 14:31:46 gbazin Exp $ + * $Id: aout_internal.h,v 1.31 2002/11/11 14:39:11 sam Exp $ * * Authors: Christophe Massiot * @@ -54,7 +54,7 @@ typedef struct aout_alloc_t else \ { \ int i_alloc_size; \ - i_alloc_size = (u64)(p_alloc)->i_bytes_per_sec \ + i_alloc_size = (uint64_t)(p_alloc)->i_bytes_per_sec \ * (i_nb_usec) / 1000000 + 1; \ ALLOCA_TEST( p_alloc, p_new_buffer ) \ { \ @@ -278,7 +278,7 @@ VLC_EXPORT( int, aout_FormatNbChannels, ( audio_sample_format_t * p_format ) ); VLC_EXPORT( void, aout_FormatPrepare, ( audio_sample_format_t * p_format ) ); VLC_EXPORT( void, aout_FormatPrint, ( aout_instance_t * p_aout, const char * psz_text, const audio_sample_format_t * p_format ) ); VLC_EXPORT( void, aout_FormatsPrint, ( aout_instance_t * p_aout, const char * psz_text, const audio_sample_format_t * p_format1, const audio_sample_format_t * p_format2 ) ); -void aout_FifoInit( aout_instance_t *, aout_fifo_t *, u32 ); +void aout_FifoInit( aout_instance_t *, aout_fifo_t *, uint32_t ); mtime_t aout_FifoNextStart( aout_instance_t *, aout_fifo_t * ); void aout_FifoPush( aout_instance_t *, aout_fifo_t *, aout_buffer_t * ); void aout_FifoSet( aout_instance_t *, aout_fifo_t *, mtime_t ); diff --git a/include/audio_output.h b/include/audio_output.h index 716245c82f..47b7b348b6 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -2,7 +2,7 @@ * audio_output.h : audio output interface ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: audio_output.h,v 1.69 2002/10/20 12:23:47 massiot Exp $ + * $Id: audio_output.h,v 1.70 2002/11/11 14:39:11 sam Exp $ * * Authors: Christophe Massiot * @@ -85,7 +85,7 @@ struct audio_sample_format_t * integers, but multiplication requires shifting the 64-bit result * from 56 fractional bits back to 28 (and rounding.) */ -typedef s32 vlc_fixed_t; +typedef int32_t vlc_fixed_t; #define FIXED32_FRACBITS 28 #define FIXED32_MIN ((vlc_fixed_t) -0x80000000L) #define FIXED32_MAX ((vlc_fixed_t) +0x7fffffffL) @@ -145,9 +145,9 @@ struct aout_buffer_t *****************************************************************************/ struct audio_date_t { - mtime_t date; - u32 i_divider; - u32 i_remainder; + mtime_t date; + uint32_t i_divider; + uint32_t i_remainder; }; /***************************************************************************** @@ -157,11 +157,11 @@ struct audio_date_t #define aout_New(a) __aout_New(VLC_OBJECT(a)) VLC_EXPORT( aout_instance_t *, __aout_New, ( vlc_object_t * ) ); VLC_EXPORT( void, aout_Delete, ( aout_instance_t * ) ); -VLC_EXPORT( void, aout_DateInit, ( audio_date_t *, u32 ) ); +VLC_EXPORT( void, aout_DateInit, ( audio_date_t *, uint32_t ) ); VLC_EXPORT( void, aout_DateSet, ( audio_date_t *, mtime_t ) ); VLC_EXPORT( void, aout_DateMove, ( audio_date_t *, mtime_t ) ); VLC_EXPORT( mtime_t, aout_DateGet, ( const audio_date_t * ) ); -VLC_EXPORT( mtime_t, aout_DateIncrement, ( audio_date_t *, u32 ) ); +VLC_EXPORT( mtime_t, aout_DateIncrement, ( audio_date_t *, uint32_t ) ); /* From dec.c : */ #define aout_DecNew(a, b, c) __aout_DecNew(VLC_OBJECT(a), b, c) diff --git a/include/input_ext-dec.h b/include/input_ext-dec.h index 22440791ff..0082f509ad 100644 --- a/include/input_ext-dec.h +++ b/include/input_ext-dec.h @@ -2,7 +2,7 @@ * input_ext-dec.h: structures exported to the VideoLAN decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_ext-dec.h,v 1.76 2002/11/09 16:34:52 sam Exp $ + * $Id: input_ext-dec.h,v 1.77 2002/11/11 14:39:11 sam Exp $ * * Authors: Christophe Massiot * Michel Kaempf @@ -102,7 +102,7 @@ struct decoder_fifo_t input_buffers_t *p_packets_mgt; /* packets management services data */ /* Standard pointers given to the decoders as a toolbox. */ - u16 i_id; + uint16_t i_id; vlc_fourcc_t i_fourcc; es_sys_t * p_demux_data; stream_ctrl_t * p_stream_ctrl; @@ -119,7 +119,7 @@ struct decoder_fifo_t * This type describes a bit fifo used to store bits while working with the * input stream at the bit level. *****************************************************************************/ -typedef u32 WORD_TYPE; +typedef uint32_t WORD_TYPE; typedef struct bit_fifo_t { @@ -196,12 +196,12 @@ struct bit_stream_t * results will be returned. Use RealignBits() if unsure. */ -#if (WORD_TYPE == u32) +#if (WORD_TYPE == uint32_t) # define WORD_AT U32_AT -# define WORD_SIGNED s32 -#elif (WORD_TYPE == u64) +# define WORD_SIGNED int32_t +#elif (WORD_TYPE == uint64_t) # define WORD_AT U64_AT -# define WORD_SIGNED s64 +# define WORD_SIGNED int64_t #else # error Unsupported WORD_TYPE #endif @@ -212,9 +212,9 @@ struct bit_stream_t VLC_EXPORT( int, InitBitstream, ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) ); VLC_EXPORT( vlc_bool_t, NextDataPacket, ( decoder_fifo_t *, bit_stream_t * ) ); VLC_EXPORT( void, BitstreamNextDataPacket, ( bit_stream_t * ) ); -VLC_EXPORT( u32, UnalignedShowBits, ( bit_stream_t *, unsigned int ) ); +VLC_EXPORT( uint32_t, UnalignedShowBits, ( bit_stream_t *, unsigned int ) ); VLC_EXPORT( void, UnalignedRemoveBits, ( bit_stream_t * ) ); -VLC_EXPORT( u32, UnalignedGetBits, ( bit_stream_t *, unsigned int ) ); +VLC_EXPORT( uint32_t, UnalignedGetBits, ( bit_stream_t *, unsigned int ) ); VLC_EXPORT( void, CloseBitstream, ( bit_stream_t * ) ); VLC_EXPORT( void, CurrentPTS, ( bit_stream_t *, mtime_t *, mtime_t * ) ); VLC_EXPORT( void, NextPTS, ( bit_stream_t *, mtime_t *, mtime_t * ) ); @@ -250,7 +250,8 @@ static inline void AlignWord( bit_stream_t * p_bit_stream ) /***************************************************************************** * ShowBits : return i_bits bits from the bit stream *****************************************************************************/ -static inline u32 ShowBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) +static inline uint32_t ShowBits( bit_stream_t * p_bit_stream, + unsigned int i_bits ) { if( (unsigned int)p_bit_stream->fifo.i_available >= i_bits ) { @@ -272,8 +273,8 @@ static inline u32 ShowBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) * ShowSignedBits : return i_bits bits from the bit stream, using signed * arithmetic *****************************************************************************/ -static inline s32 ShowSignedBits( bit_stream_t * p_bit_stream, - unsigned int i_bits ) +static inline int32_t ShowSignedBits( bit_stream_t * p_bit_stream, + unsigned int i_bits ) { if( (unsigned int)p_bit_stream->fifo.i_available >= i_bits ) { @@ -318,7 +319,7 @@ static inline void RemoveBits( bit_stream_t * p_bit_stream, * RemoveBits32 : removes 32 bits from the bit buffer (and as a side effect, * refill it) *****************************************************************************/ -#if (WORD_TYPE == u32) +#if (WORD_TYPE == uint32_t) static inline void RemoveBits32( bit_stream_t * p_bit_stream ) { if( p_bit_stream->p_byte <= p_bit_stream->p_end - sizeof(WORD_TYPE) ) @@ -348,9 +349,10 @@ static inline void RemoveBits32( bit_stream_t * p_bit_stream ) * GetBits : returns i_bits bits from the bit stream and removes them * XXX: do not use for 32 bits, see GetBits32 *****************************************************************************/ -static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) +static inline uint32_t GetBits( bit_stream_t * p_bit_stream, + unsigned int i_bits ) { - u32 i_result; + uint32_t i_result; p_bit_stream->fifo.i_available -= i_bits; @@ -385,12 +387,12 @@ static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) * using signed arithmetic * XXX: do not use for 32 bits *****************************************************************************/ -static inline s32 GetSignedBits( bit_stream_t * p_bit_stream, - unsigned int i_bits ) +static inline int32_t GetSignedBits( bit_stream_t * p_bit_stream, + unsigned int i_bits ) { if( (unsigned int)p_bit_stream->fifo.i_available >= i_bits ) { - s32 i_result; + int32_t i_result; p_bit_stream->fifo.i_available -= i_bits; i_result = (WORD_SIGNED)p_bit_stream->fifo.buffer @@ -407,10 +409,10 @@ static inline s32 GetSignedBits( bit_stream_t * p_bit_stream, /***************************************************************************** * GetBits32 : returns 32 bits from the bit stream and removes them *****************************************************************************/ -#if (WORD_TYPE == u32) -static inline u32 GetBits32( bit_stream_t * p_bit_stream ) +#if (WORD_TYPE == uint32_t) +static inline uint32_t GetBits32( bit_stream_t * p_bit_stream ) { - u32 i_result; + uint32_t i_result; if( p_bit_stream->fifo.i_available == 32 ) { diff --git a/include/input_ext-intf.h b/include/input_ext-intf.h index df7f103644..28be956d17 100644 --- a/include/input_ext-intf.h +++ b/include/input_ext-intf.h @@ -4,7 +4,7 @@ * control the pace of reading. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: input_ext-intf.h,v 1.77 2002/08/18 13:16:51 sigmunau Exp $ + * $Id: input_ext-intf.h,v 1.78 2002/11/11 14:39:11 sam Exp $ * * Authors: Christophe Massiot * @@ -45,10 +45,10 @@ *****************************************************************************/ struct es_descriptor_t { - u16 i_id; /* stream ID for PS, PID for TS */ - u8 i_stream_id; /* stream ID defined in the PES */ + uint16_t i_id; /* stream ID for PS, PID for TS */ + uint8_t i_stream_id; /* stream ID defined in the PES */ vlc_fourcc_t i_fourcc; /* stream type */ - u8 i_cat; /* stream category (audio, video, spu) */ + uint8_t i_cat; /* stream category (audio, video, spu) */ int i_demux_fd; /* used to store demux device file handle */ char psz_desc[20]; /* description of ES: audio language @@ -93,12 +93,12 @@ struct es_descriptor_t struct pgrm_descriptor_t { /* Program characteristics */ - u16 i_number; /* program number */ - u8 i_version; /* version number */ + uint16_t i_number; /* program number */ + uint8_t i_version; /* version number */ vlc_bool_t b_is_ok; /* Is the description up to date ? */ /* Service Descriptor (program name) - DVB extension */ - u8 i_srv_type; + uint8_t i_srv_type; char * psz_srv_name; /* Synchronization information */ @@ -208,7 +208,7 @@ struct input_info_category_t { *****************************************************************************/ struct stream_descriptor_t { - u16 i_stream_id; /* stream id */ + uint16_t i_stream_id; /* stream id */ vlc_bool_t b_changed; /* if stream has been changed, we have to inform the interface */ vlc_mutex_t stream_lock; /* to be taken every time you read @@ -228,7 +228,7 @@ struct stream_descriptor_t input_area_t * p_new_area; /* Newly selected area from * the interface */ - u32 i_mux_rate; /* the rate we read the stream (in + uint32_t i_mux_rate; /* the rate we read the stream (in * units of 50 bytes/s) ; 0 if undef */ /* New status and rate requested by the interface */ @@ -279,7 +279,7 @@ struct stream_position_t off_t i_tell; /* actual location in the area (in arbitrary units) */ off_t i_size; /* total size of the area (in arbitrary units) */ - u32 i_mux_rate; /* the rate we read the stream (in + uint32_t i_mux_rate; /* the rate we read the stream (in * units of 50 bytes/s) ; 0 if undef */ }; @@ -386,7 +386,7 @@ VLC_EXPORT( void, input_DumpStream, ( input_thread_t * ) ); VLC_EXPORT( char *, input_OffsetToTime, ( input_thread_t *, char *, off_t ) ); VLC_EXPORT( int, input_ToggleES, ( input_thread_t *, es_descriptor_t *, vlc_bool_t ) ); VLC_EXPORT( int, input_ChangeArea, ( input_thread_t *, input_area_t * ) ); -VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, u16 ) ); +VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, uint16_t ) ); int input_ToggleGrayscale( input_thread_t * ); int input_ToggleMute ( input_thread_t * ); diff --git a/include/input_ext-plugins.h b/include/input_ext-plugins.h index 1903f4b3d5..464c72df3f 100644 --- a/include/input_ext-plugins.h +++ b/include/input_ext-plugins.h @@ -3,7 +3,7 @@ * but exported to plug-ins ***************************************************************************** * Copyright (C) 1999-2002 VideoLAN - * $Id: input_ext-plugins.h,v 1.36 2002/10/27 16:58:14 gbazin Exp $ + * $Id: input_ext-plugins.h,v 1.37 2002/11/11 14:39:11 sam Exp $ * * Authors: Christophe Massiot * @@ -40,14 +40,14 @@ *****************************************************************************/ VLC_EXPORT( int, input_InitStream,( input_thread_t *, size_t ) ); VLC_EXPORT( void, input_EndStream, ( input_thread_t * ) ); -VLC_EXPORT( pgrm_descriptor_t *, input_FindProgram,( input_thread_t *, u16 ) ); -VLC_EXPORT( pgrm_descriptor_t *, input_AddProgram, ( input_thread_t *, u16, size_t ) ); +VLC_EXPORT( pgrm_descriptor_t *, input_FindProgram,( input_thread_t *, uint16_t ) ); +VLC_EXPORT( pgrm_descriptor_t *, input_AddProgram, ( input_thread_t *, uint16_t, size_t ) ); VLC_EXPORT( void, input_DelProgram,( input_thread_t *, pgrm_descriptor_t * ) ); VLC_EXPORT( int, input_SetProgram,( input_thread_t *, pgrm_descriptor_t * ) ); VLC_EXPORT( input_area_t *, input_AddArea,( input_thread_t * ) ); VLC_EXPORT( void, input_DelArea, ( input_thread_t *, input_area_t * ) ); -VLC_EXPORT( es_descriptor_t *, input_FindES,( input_thread_t *, u16 ) ); -VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, u16, size_t ) ); +VLC_EXPORT( es_descriptor_t *, input_FindES,( input_thread_t *, uint16_t ) ); +VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, uint16_t, size_t ) ); VLC_EXPORT( void, input_DelES, ( input_thread_t *, es_descriptor_t * ) ); VLC_EXPORT( int, input_SelectES, ( input_thread_t *, es_descriptor_t * ) ); VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) ); diff --git a/include/interface.h b/include/interface.h index e4c26ba3de..ad9f43cb16 100644 --- a/include/interface.h +++ b/include/interface.h @@ -4,7 +4,7 @@ * interface, such as message output. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: interface.h,v 1.36 2002/10/11 22:32:55 sam Exp $ + * $Id: interface.h,v 1.37 2002/11/11 14:39:11 sam Exp $ * * Authors: Vincent Seguin * @@ -62,7 +62,7 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); /***************************************************************************** * Macros *****************************************************************************/ -#ifdef WIN32 +#if defined( WIN32 ) && !defined( UNDER_CE ) # define CONSOLE_INTRO_MSG \ AllocConsole(); \ freopen( "CONOUT$", "w", stdout ); \ diff --git a/include/iso_lang.h b/include/iso_lang.h index b274d53bb7..89b1bc4102 100644 --- a/include/iso_lang.h +++ b/include/iso_lang.h @@ -2,7 +2,7 @@ * iso_lang.h: function to decode language code (in dvd or a52 for instance). ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: iso_lang.h,v 1.7 2002/07/20 18:01:41 sam Exp $ + * $Id: iso_lang.h,v 1.8 2002/11/11 14:39:11 sam Exp $ * * Author: Stéphane Borel * Arnaud de Bossoreille de Ribou @@ -34,5 +34,5 @@ struct iso639_lang_t VLC_EXPORT( const iso639_lang_t *, GetLang_1, ( const char * ) ); VLC_EXPORT( const iso639_lang_t *, GetLang_2T, ( const char * ) ); VLC_EXPORT( const iso639_lang_t *, GetLang_2B, ( const char * ) ); -VLC_EXPORT( const char *, DecodeLanguage, ( u16 ) ); +VLC_EXPORT( const char *, DecodeLanguage, ( uint16_t ) ); diff --git a/include/main.h b/include/main.h index 7f93dc96b1..5e67e90bba 100644 --- a/include/main.h +++ b/include/main.h @@ -3,7 +3,7 @@ * Declaration and extern access to global program object. ***************************************************************************** * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN - * $Id: main.h,v 1.50 2002/11/10 18:04:22 sam Exp $ + * $Id: main.h,v 1.51 2002/11/11 14:39:11 sam Exp $ * * Authors: Vincent Seguin * @@ -37,7 +37,7 @@ struct libvlc_t vlc_bool_t b_ready; /* CPU extensions */ - u32 i_cpu; + uint32_t i_cpu; /* Generic settings */ int i_verbose; /* info messages */ @@ -83,7 +83,7 @@ struct vlc_t /* Fast memcpy plugin used */ module_t * p_memcpy_module; -#if defined( WIN32 ) +#if defined( UNDER_CE ) void* ( __cdecl *pf_memcpy ) ( void *, const void *, size_t ); void* ( __cdecl *pf_memset ) ( void *, int, size_t ); #else diff --git a/include/mmx.h b/include/mmx.h index 67517bc9ad..194e1aaa3f 100644 --- a/include/mmx.h +++ b/include/mmx.h @@ -26,14 +26,14 @@ */ typedef union { - s64 q; /* Quadword (64-bit) value */ - u64 uq; /* Unsigned Quadword */ - s32 d[2]; /* 2 Doubleword (32-bit) values */ - u32 ud[2]; /* 2 Unsigned Doubleword */ - s16 w[4]; /* 4 Word (16-bit) values */ - u16 uw[4]; /* 4 Unsigned Word */ - s8 b[8]; /* 8 Byte (8-bit) values */ - u8 ub[8]; /* 8 Unsigned Byte */ + int64_t q; /* Quadword (64-bit) value */ + uint64_t uq; /* Unsigned Quadword */ + int32_t d[2]; /* 2 Doubleword (32-bit) values */ + uint32_t ud[2]; /* 2 Unsigned Doubleword */ + int16_t w[4]; /* 4 Word (16-bit) values */ + uint16_t uw[4]; /* 4 Unsigned Word */ + int8_t b[8]; /* 8 Byte (8-bit) values */ + uint8_t ub[8]; /* 8 Unsigned Byte */ float s[2]; /* Single-precision (32-bit) value */ } ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ diff --git a/include/modules.h b/include/modules.h index 7182d9b14d..01f66d8f67 100644 --- a/include/modules.h +++ b/include/modules.h @@ -2,7 +2,7 @@ * modules.h : Module management functions. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.h,v 1.61 2002/08/21 17:31:58 sam Exp $ + * $Id: modules.h,v 1.62 2002/11/11 14:39:11 sam Exp $ * * Authors: Samuel Hocevar * @@ -67,9 +67,9 @@ struct module_t char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; /* Shortcuts to the module */ - char *psz_capability; /* Capability */ - int i_score; /* Score for each capability */ - u32 i_cpu; /* Required CPU capabilities */ + char *psz_capability; /* Capability */ + int i_score; /* Score for each capability */ + uint32_t i_cpu; /* Required CPU capabilities */ vlc_bool_t b_unloadable; /* Can we be dlclosed? */ vlc_bool_t b_reentrant; /* Are we reentrant? */ diff --git a/include/mtime.h b/include/mtime.h index 8f779035aa..b7637237b7 100644 --- a/include/mtime.h +++ b/include/mtime.h @@ -9,7 +9,7 @@ * Functions prototyped are implemented in interface/mtime.c. ***************************************************************************** * Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN - * $Id: mtime.h,v 1.12 2002/06/01 12:31:57 sam Exp $ + * $Id: mtime.h,v 1.13 2002/11/11 14:39:11 sam Exp $ * * Authors: Vincent Seguin * @@ -36,7 +36,7 @@ * returning the date of the first image to be displayed. It can be used in * comparaison with other values: all existing dates will be earlier. *****************************************************************************/ -#define LAST_MDATE ((mtime_t)((u64)(-1)/2)) +#define LAST_MDATE ((mtime_t)((uint64_t)(-1)/2)) /***************************************************************************** * MSTRTIME_MAX_SIZE: maximum possible size of mstrtime diff --git a/include/os_specific.h b/include/os_specific.h index ae0a428857..c9f59aa2fb 100644 --- a/include/os_specific.h +++ b/include/os_specific.h @@ -2,7 +2,7 @@ * os_specific.h: OS specific features ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: os_specific.h,v 1.9 2002/06/02 14:26:15 gbazin Exp $ + * $Id: os_specific.h,v 1.10 2002/11/11 14:39:11 sam Exp $ * * Authors: Samuel Hocevar * Gildas Bazin @@ -30,7 +30,7 @@ # include "beos_specific.h" #elif defined( SYS_DARWIN ) # include "darwin_specific.h" -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) # include "win32_specific.h" #else # undef _NEED_OS_SPECIFIC_H diff --git a/include/variables.h b/include/variables.h index 7deddc1226..cb822d4427 100644 --- a/include/variables.h +++ b/include/variables.h @@ -2,7 +2,7 @@ * variables.h: variables handling ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: variables.h,v 1.7 2002/10/28 20:57:01 sam Exp $ + * $Id: variables.h,v 1.8 2002/11/11 14:39:11 sam Exp $ * * Authors: Samuel Hocevar * @@ -34,7 +34,7 @@ struct variable_t /* The variable unique name, (almost) unique hashed value, and type */ char * psz_name; - u32 i_hash; + uint32_t i_hash; int i_type; /* A pointer to a comparison function, a duplication function, and diff --git a/include/video.h b/include/video.h index 5d2fd3e463..be29e9be7e 100644 --- a/include/video.h +++ b/include/video.h @@ -4,7 +4,7 @@ * includes all common video types and constants. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video.h,v 1.57 2002/11/06 18:07:57 sam Exp $ + * $Id: video.h,v 1.58 2002/11/11 14:39:11 sam Exp $ * * Authors: Vincent Seguin * @@ -28,7 +28,7 @@ *****************************************************************************/ typedef struct plane_t { - u8 *p_pixels; /* Start of the plane's data */ + uint8_t *p_pixels; /* Start of the plane's data */ /* Variables used for fast memcpy operations */ int i_lines; /* Number of lines */ @@ -55,7 +55,7 @@ struct picture_t /* Picture data - data can always be freely modified, but p_data may * NEVER be modified. A direct buffer can be handled as the plugin * wishes, it can even swap p_pixels buffers. */ - u8 *p_data; + uint8_t *p_data; void *p_data_orig; /* pointer before memalign */ plane_t p[ VOUT_MAX_PLANES ]; /* description of the planes */ int i_planes; /* number of allocated planes */ @@ -109,14 +109,17 @@ struct picture_heap_t int i_bmask, i_rbshift, i_lbshift; /* Stuff used for palettized RGB planes */ - void (* pf_setpalette) ( vout_thread_t *, u16 *, u16 *, u16 * ); + void (* pf_setpalette) ( vout_thread_t *, uint16_t *, uint16_t *, uint16_t * ); }; -/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */ -#define RGB2PIXEL( p_vout, i_r, i_g, i_b ) \ - (((((u32)i_r) >> p_vout->output.i_rrshift) << p_vout->output.i_lrshift) | \ - ((((u32)i_g) >> p_vout->output.i_rgshift) << p_vout->output.i_lgshift) | \ - ((((u32)i_b) >> p_vout->output.i_rbshift) << p_vout->output.i_lbshift)) +/* RGB2PIXEL: assemble RGB components to a pixel value, returns a uint32_t */ +#define RGB2PIXEL( p_vout, i_r, i_g, i_b ) \ + (((((uint32_t)i_r) >> p_vout->output.i_rrshift) \ + << p_vout->output.i_lrshift) \ + | ((((uint32_t)i_g) >> p_vout->output.i_rgshift) \ + << p_vout->output.i_lgshift) \ + | ((((uint32_t)i_b) >> p_vout->output.i_rbshift) \ + << p_vout->output.i_lbshift)) /***************************************************************************** * Flags used to describe the status of a picture @@ -191,9 +194,9 @@ struct subpicture_t { vout_font_t * p_font; /* font, NULL for default */ int i_style; /* text style */ - u32 i_char_color; /* character color */ - u32 i_border_color; /* border color */ - u32 i_bg_color; /* background color */ + uint32_t i_char_color; /* character color */ + uint32_t i_border_color; /* border color */ + uint32_t i_bg_color; /* background color */ } text; } type; #endif diff --git a/include/video_output.h b/include/video_output.h index 22e10e7a07..1d38679554 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -5,7 +5,7 @@ * thread, and destroy a previously opened video output thread. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_output.h,v 1.85 2002/11/06 18:07:57 sam Exp $ + * $Id: video_output.h,v 1.86 2002/11/11 14:39:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -68,7 +68,7 @@ struct vout_thread_t vout_sys_t * p_sys; /* system output method */ /* Current display properties */ - u16 i_changes; /* changes made to the thread */ + uint16_t i_changes; /* changes made to the thread */ float f_gamma; /* gamma */ vlc_bool_t b_grayscale; /* color or grayscale display */ vlc_bool_t b_info; /* print additional information */ @@ -142,13 +142,13 @@ struct vout_thread_t * Prototypes *****************************************************************************/ #define vout_CreateThread(a,b,c,d,e) __vout_CreateThread(VLC_OBJECT(a),b,c,d,e) -VLC_EXPORT( vout_thread_t *, __vout_CreateThread, ( vlc_object_t *, int, int, u32, int ) ); +VLC_EXPORT( vout_thread_t *, __vout_CreateThread, ( vlc_object_t *, int, int, uint32_t, int ) ); VLC_EXPORT( void, vout_DestroyThread, ( vout_thread_t * ) ); -VLC_EXPORT( int, vout_ChromaCmp, ( u32, u32 ) ); +VLC_EXPORT( int, vout_ChromaCmp, ( uint32_t, uint32_t ) ); VLC_EXPORT( picture_t *, vout_CreatePicture, ( vout_thread_t *, vlc_bool_t, vlc_bool_t, vlc_bool_t ) ); -VLC_EXPORT( void, vout_AllocatePicture,( vout_thread_t *, picture_t *, int, int, u32 ) ); +VLC_EXPORT( void, vout_AllocatePicture,( vout_thread_t *, picture_t *, int, int, uint32_t ) ); VLC_EXPORT( void, vout_DestroyPicture, ( vout_thread_t *, picture_t * ) ); VLC_EXPORT( void, vout_DisplayPicture, ( vout_thread_t *, picture_t * ) ); VLC_EXPORT( void, vout_DatePicture, ( vout_thread_t *, picture_t *, mtime_t ) ); diff --git a/include/vlc_common.h b/include/vlc_common.h index d206019c66..91442dd327 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vlc_common.h,v 1.36 2002/11/10 23:41:53 sam Exp $ + * $Id: vlc_common.h,v 1.37 2002/11/11 14:39:11 sam Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -74,7 +74,9 @@ typedef signed short int16_t; typedef unsigned int uint32_t; typedef signed int int32_t; -# if defined( _MSC_VER ) || ( defined( WIN32 ) && !defined( __MINGW32__ ) ) +# if defined( _MSC_VER ) \ + || defined( UNDER_CE ) \ + || ( defined( WIN32 ) && !defined( __MINGW32__ ) ) typedef unsigned __int64 uint64_t; typedef signed __int64 int64_t; # else @@ -97,7 +99,7 @@ typedef int ptrdiff_t; # endif #endif -#if defined( WIN32 ) +#if defined( WIN32 ) || defined( UNDER_CE ) typedef int ssize_t; #endif @@ -272,7 +274,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ /***************************************************************************** * OS-specific headers and thread types *****************************************************************************/ -#if defined( WIN32 ) +#if defined( WIN32 ) || defined( UNDER_CE ) # define WIN32_LEAN_AND_MEAN # include #endif @@ -334,7 +336,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */ #ifdef NTOHL_IN_SYS_PARAM_H # include -#elif !defined(WIN32) /* NTOHL_IN_SYS_PARAM_H || WIN32 */ +#elif !defined(WIN32) && !defined( UNDER_CE ) # include #endif /* NTOHL_IN_SYS_PARAM_H || WIN32 */ @@ -503,7 +505,7 @@ static inline uint64_t U64_AT( void * _p ) #endif /* Format type specifiers for 64 bits numbers */ -#if !defined(WIN32) +#if !defined(WIN32) && !defined(UNDER_CE) # define I64Fd "%lld" # define I64Fi "%lli" # define I64Fo "%llo" @@ -517,16 +519,16 @@ static inline uint64_t U64_AT( void * _p ) # define I64Fu "%I64u" # define I64Fx "%I64x" # define I64FX "%I64X" -#endif /* defined(WIN32) */ +#endif /* defined(WIN32)||defined(UNDER_CE) */ /* 64 bits integer constant suffix */ -#if !defined(WIN32) +#if !defined(WIN32) && !defined(UNDER_CE) # define I64C(x) x##LL #else # define I64C(x) x##i64 -#endif /* defined(WIN32) */ +#endif /* defined(WIN32)||defined(UNDER_CE) */ -#ifdef WIN32 +#if defined(WIN32) && !defined(UNDER_CE) /* win32, cl and icl support */ # if defined( _MSC_VER ) || !defined( __MINGW32__ ) # define __attribute__(x) diff --git a/include/vlc_config.h b/include/vlc_config.h index 5b743c6063..dfde322fbe 100644 --- a/include/vlc_config.h +++ b/include/vlc_config.h @@ -50,7 +50,7 @@ /* The configuration file and directory */ #ifdef SYS_BEOS # define CONFIG_DIR "config/settings" -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) # define CONFIG_DIR "vlc" #else # define CONFIG_DIR ".vlc" @@ -108,7 +108,7 @@ #define DEFAULT_PTS_DELAY (mtime_t)(.3*CLOCK_FREQ) /* DVD and VCD devices */ -#ifndef WIN32 +#if !defined( WIN32 ) && !defined( UNDER_CE ) # define DVD_DEVICE "/dev/dvd" # define VCD_DEVICE "/dev/cdrom" #else diff --git a/include/vlc_cpu.h b/include/vlc_cpu.h index 9610fb6e79..f3a31c0cbf 100644 --- a/include/vlc_cpu.h +++ b/include/vlc_cpu.h @@ -2,7 +2,7 @@ * cpu.h: CPU type detection ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: vlc_cpu.h,v 1.4 2002/10/03 13:21:54 sam Exp $ + * $Id: vlc_cpu.h,v 1.5 2002/11/11 14:39:11 sam Exp $ * * Authors: Samuel Hocevar * @@ -21,5 +21,5 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -u32 CPUCapabilities( void ); +uint32_t CPUCapabilities( void ); diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 4a94093984..255eec6fc6 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -3,7 +3,7 @@ * This header provides portable declarations for mutexes & conditions ***************************************************************************** * Copyright (C) 1999, 2002 VideoLAN - * $Id: vlc_threads.h,v 1.17 2002/11/10 18:04:22 sam Exp $ + * $Id: vlc_threads.h,v 1.18 2002/11/11 14:39:11 sam Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -39,12 +39,10 @@ #elif defined( ST_INIT_IN_ST_H ) /* State threads */ # include -#elif defined( WIN32 ) -# if defined( UNDER_CE ) +#elif defined( UNDER_CE ) /* WinCE API */ -# else -# include /* Win32 API */ -# endif +#elif defined( WIN32 ) +# include /* Win32 API */ #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */ # include @@ -80,7 +78,7 @@ # define VLC_THREAD_PRIORITY_VIDEO 31 # define VLC_THREAD_PRIORITY_OUTPUT 31 -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) # define VLC_THREAD_PRIORITY_LOW 0 # define VLC_THREAD_PRIORITY_INPUT THREAD_PRIORITY_TIME_CRITICAL # define VLC_THREAD_PRIORITY_AUDIO THREAD_PRIORITY_HIGHEST @@ -126,7 +124,7 @@ typedef struct vlc_object_t * p_this; } vlc_cond_t; -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) typedef HANDLE vlc_thread_t; typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT) ( HANDLE, HANDLE, DWORD, BOOL ); typedef unsigned (__stdcall *PTHREAD_START) (void *); diff --git a/include/vlc_threads_funcs.h b/include/vlc_threads_funcs.h index b2d6213c40..86b81f2f16 100644 --- a/include/vlc_threads_funcs.h +++ b/include/vlc_threads_funcs.h @@ -3,7 +3,7 @@ * This header provides a portable threads implementation. ***************************************************************************** * Copyright (C) 1999, 2002 VideoLAN - * $Id: vlc_threads_funcs.h,v 1.8 2002/11/10 18:04:22 sam Exp $ + * $Id: vlc_threads_funcs.h,v 1.9 2002/11/11 14:39:11 sam Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -76,6 +76,10 @@ static inline int __vlc_mutex_lock( char * psz_file, int i_line, #elif defined( ST_INIT_IN_ST_H ) i_result = st_mutex_lock( p_mutex->mutex ); +#elif defined( UNDER_CE ) + EnterCriticalSection( &p_mutex->csection ); + return 0; + #elif defined( WIN32 ) if( p_mutex->mutex ) { @@ -143,6 +147,10 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line, #elif defined( ST_INIT_IN_ST_H ) i_result = st_mutex_unlock( p_mutex->mutex ); +#elif defined( UNDER_CE ) + LeaveCriticalSection( &p_mutex->csection ); + return 0; + #elif defined( WIN32 ) if( p_mutex->mutex ) { @@ -224,6 +232,10 @@ static inline int __vlc_cond_signal( char * psz_file, int i_line, #elif defined( ST_INIT_IN_ST_H ) i_result = st_cond_signal( p_condvar->cond ); +#elif defined( UNDER_CE ) + PulseEvent( p_condvar->event ); + return 0; + #elif defined( WIN32 ) /* Release one waiting thread if one is available. */ /* For this trick to work properly, the vlc_cond_signal must be surrounded @@ -232,7 +244,6 @@ static inline int __vlc_cond_signal( char * psz_file, int i_line, { PulseEvent( p_condvar->event ); } -# ifndef UNDER_CE else if( p_condvar->i_win9x_cv == 1 ) { /* Wait for the gate to be open */ @@ -264,7 +275,6 @@ static inline int __vlc_cond_signal( char * psz_file, int i_line, WaitForSingleObject( p_condvar->event, INFINITE ); } } -# endif return 0; #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) @@ -357,6 +367,16 @@ static inline int __vlc_cond_broadcast( char * psz_file, int i_line, #elif defined( ST_INIT_IN_ST_H ) i_result = st_cond_broadcast( p_condvar->cond ); +#elif defined( UNDER_CE ) + int i; + + /* Release all waiting threads. */ + for( i = p_condvar->i_waiting_threads; i > 0; i-- ) + { + PulseEvent( p_condvar->event ); + } + return 0; + #elif defined( WIN32 ) int i; @@ -368,7 +388,6 @@ static inline int __vlc_cond_broadcast( char * psz_file, int i_line, PulseEvent( p_condvar->event ); } } -# ifndef UNDER_CE else if( p_condvar->i_win9x_cv == 1 ) { /* Wait for the gate to be open */ @@ -402,7 +421,6 @@ static inline int __vlc_cond_broadcast( char * psz_file, int i_line, WaitForSingleObject( p_condvar->event, INFINITE ); } } -# endif return 0; #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) @@ -491,6 +509,17 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line, i_result = st_cond_wait( p_condvar->cond ); st_mutex_lock( p_mutex->mutex ); +#elif defined( UNDER_CE ) + p_condvar->i_waiting_threads++; + LeaveCriticalSection( &p_mutex->csection ); + WaitForSingleObject( p_condvar->event, INFINITE ); + p_condvar->i_waiting_threads--; + + /* Reacquire the mutex before returning. */ + vlc_mutex_lock( p_mutex ); + + return 0; + #elif defined( WIN32 ) if( !p_condvar->semaphore ) { diff --git a/src/extras/dirent.c b/src/extras/dirent.c index 0ef479604d..7150101b97 100644 --- a/src/extras/dirent.c +++ b/src/extras/dirent.c @@ -9,9 +9,9 @@ * Significantly revised and rewinddir, seekdir and telldir added by Colin * Peters * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * $Author: sam $ - * $Date: 2002/11/10 23:41:53 $ + * $Date: 2002/11/11 14:39:12 $ * */ @@ -94,7 +94,7 @@ opendir (const CHAR *szPath) } else { - /* FIXME: if I wasn't lazy, I'dcheck for overflows here. */ + /* FIXME: if I wasn't lazy, I'd check for overflows here. */ sprintf (szFullPath, MAX_PATH, "\\%s", szPath ); } #else diff --git a/src/extras/getopt.c b/src/extras/getopt.c index 3462a3e0ab..60b0b172a9 100644 --- a/src/extras/getopt.c +++ b/src/extras/getopt.c @@ -81,7 +81,7 @@ #endif #endif -#if defined (WIN32) && !defined (__CYGWIN32__) +#if defined (WIN32) && !defined (__CYGWIN32__) || defined(UNDER_CE) /* It's not Unix, really. See? Capital letters. */ #include #define getpid() GetCurrentProcessId() diff --git a/src/input/input.c b/src/input/input.c index 3e3604cfbc..25252d8185 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -4,7 +4,7 @@ * decoders. ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: input.c,v 1.214 2002/11/10 18:04:23 sam Exp $ + * $Id: input.c,v 1.215 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -30,16 +30,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#endif - #include #ifdef HAVE_SYS_TIMES_H @@ -388,11 +378,11 @@ static int InitThread( input_thread_t * p_input ) { psz_parser++; } -#ifdef WIN32 +#if defined( WIN32 ) || defined( UNDER_CE ) if( psz_parser - p_input->psz_source == 1 ) { msg_Warn( p_input, "drive letter %c: found in source string", - p_input->psz_source ) ; + p_input->psz_source[0] ) ; psz_parser = ""; } #endif diff --git a/src/input/input_clock.c b/src/input/input_clock.c index 7c4acb6309..1b9f7e2647 100644 --- a/src/input/input_clock.c +++ b/src/input/input_clock.c @@ -2,7 +2,7 @@ * input_clock.c: Clock/System date convertions, stream management ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_clock.c,v 1.33 2002/11/10 18:04:23 sam Exp $ + * $Id: input_clock.c,v 1.34 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -28,10 +28,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-intf.h" #include "input_ext-dec.h" diff --git a/src/input/input_dec.c b/src/input/input_dec.c index bb323965c3..e9c4c1fb6f 100644 --- a/src/input/input_dec.c +++ b/src/input/input_dec.c @@ -2,7 +2,7 @@ * input_dec.c: Functions for the management of decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_dec.c,v 1.50 2002/11/10 18:04:23 sam Exp $ + * $Id: input_dec.c,v 1.51 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -29,10 +29,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-dec.h" #include "input_ext-intf.h" diff --git a/src/input/input_ext-dec.c b/src/input/input_ext-dec.c index 454ab584b3..79037f3dd8 100644 --- a/src/input/input_ext-dec.c +++ b/src/input/input_ext-dec.c @@ -2,7 +2,7 @@ * input_ext-dec.c: services to the decoders ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_ext-dec.c,v 1.40 2002/11/10 18:04:23 sam Exp $ + * $Id: input_ext-dec.c,v 1.41 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -28,10 +28,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-dec.h" #include "input_ext-intf.h" diff --git a/src/input/input_ext-intf.c b/src/input/input_ext-intf.c index 176df15ed0..bf410feef2 100644 --- a/src/input/input_ext-intf.c +++ b/src/input/input_ext-intf.c @@ -2,7 +2,7 @@ * input_ext-intf.c: services to the interface ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_ext-intf.c,v 1.42 2002/11/10 18:04:23 sam Exp $ + * $Id: input_ext-intf.c,v 1.43 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -28,10 +28,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-dec.h" #include "input_ext-intf.h" diff --git a/src/input/input_ext-plugins.c b/src/input/input_ext-plugins.c index c262704274..d42c348165 100644 --- a/src/input/input_ext-plugins.c +++ b/src/input/input_ext-plugins.c @@ -2,7 +2,7 @@ * input_ext-plugins.c: useful functions for access and demux plug-ins ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: input_ext-plugins.c,v 1.21 2002/11/10 23:41:53 sam Exp $ + * $Id: input_ext-plugins.c,v 1.22 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -52,7 +52,7 @@ #endif #ifdef UNDER_CE - /* No network support */ + /* No network support (FIXME: use winsock1?) */ #elif defined( WIN32 ) # include # include diff --git a/src/input/input_info.c b/src/input/input_info.c index 9ed0100965..1e7ffe6ce5 100644 --- a/src/input/input_info.c +++ b/src/input/input_info.c @@ -2,7 +2,7 @@ * input_info.c: Convenient functions to handle the input info structures ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: input_info.c,v 1.8 2002/11/10 18:04:23 sam Exp $ + * $Id: input_info.c,v 1.9 2002/11/11 14:39:12 sam Exp $ * * Authors: Sigmund Augdal * @@ -29,10 +29,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-intf.h" #include "interface.h" diff --git a/src/input/input_programs.c b/src/input/input_programs.c index a14ccc8ec6..90f855a27d 100644 --- a/src/input/input_programs.c +++ b/src/input/input_programs.c @@ -2,7 +2,7 @@ * input_programs.c: es_descriptor_t, pgrm_descriptor_t management ***************************************************************************** * Copyright (C) 1999-2002 VideoLAN - * $Id: input_programs.c,v 1.97 2002/11/10 18:04:23 sam Exp $ + * $Id: input_programs.c,v 1.98 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -29,10 +29,6 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include /* off_t */ -#endif - #include "stream_control.h" #include "input_ext-intf.h" #include "input_ext-dec.h" @@ -637,7 +633,7 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es ) i_index++; } - /* XXX: no need to memmove, we have unordered data */ + /* XXX: no need to memmove, we have unsorted data */ REMOVE_ELEM( p_input->stream.pp_selected_es, p_input->stream.i_selected_es_number, i_index ); diff --git a/src/interface/intf_eject.c b/src/interface/intf_eject.c index 6244e3f064..615808998a 100644 --- a/src/interface/intf_eject.c +++ b/src/interface/intf_eject.c @@ -2,7 +2,7 @@ * intf_eject.c: CD/DVD-ROM ejection handling functions ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: intf_eject.c,v 1.16 2002/11/10 18:04:23 sam Exp $ + * $Id: intf_eject.c,v 1.17 2002/11/11 14:39:12 sam Exp $ * * Author: Julien Blache for the Linux part * with code taken from the Linux "eject" command @@ -154,13 +154,11 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) return 1; -#elif defined(WIN32) - -#if defined(UNDER_CE) +#elif defined(UNDER_CE) msg_Warn( p_this, "CD-Rom ejection unsupported on this platform" ); - i_ret = -1; - -#else + return 1; + +#elif defined(WIN32) HANDLE h_drive ; TCHAR psz_drive_id[8] ; DWORD dw_access_flags = GENERIC_READ ; @@ -220,7 +218,6 @@ int __intf_Eject( vlc_object_t *p_this, const char *psz_device ) CloseHandle (h_drive) ; return (i_ret) ; } -#endif /* UNDER_CE */ #else /* WIN32 */ diff --git a/src/misc/configuration.c b/src/misc/configuration.c index b1163474e3..c39db6b2cd 100644 --- a/src/misc/configuration.c +++ b/src/misc/configuration.c @@ -2,7 +2,7 @@ * configuration.c management of the modules configuration ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: configuration.c,v 1.44 2002/11/10 23:41:53 sam Exp $ + * $Id: configuration.c,v 1.45 2002/11/11 14:39:12 sam Exp $ * * Authors: Gildas Bazin * @@ -1216,7 +1216,7 @@ char *config_GetHomeDir( void ) struct passwd *p_pw = NULL; #endif -#ifdef WIN32 +#if defined(WIN32) || defined(UNDER_CE) typedef HRESULT (WINAPI *SHGETFOLDERPATH)( HWND, int, HANDLE, DWORD, LPTSTR ); # define CSIDL_FLAG_CREATE 0x8000 diff --git a/src/misc/cpu.c b/src/misc/cpu.c index 8247674001..c73ba7f42c 100644 --- a/src/misc/cpu.c +++ b/src/misc/cpu.c @@ -2,7 +2,7 @@ * cpu.c: CPU detection code ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: cpu.c,v 1.8 2002/11/10 18:04:24 sam Exp $ + * $Id: cpu.c,v 1.9 2002/11/11 14:39:12 sam Exp $ * * Authors: Samuel Hocevar * Christophe Massiot @@ -65,9 +65,9 @@ static char *psz_capability; ***************************************************************************** * This function is called to list extensions the CPU may have. *****************************************************************************/ -u32 CPUCapabilities( void ) +uint32_t CPUCapabilities( void ) { - volatile u32 i_capabilities = CPU_CAPABILITY_NONE; + volatile uint32_t i_capabilities = CPU_CAPABILITY_NONE; #if defined( SYS_DARWIN ) struct host_basic_info hi; diff --git a/src/misc/messages.c b/src/misc/messages.c index 228252bfc3..8cbdf377fc 100644 --- a/src/misc/messages.c +++ b/src/misc/messages.c @@ -4,7 +4,7 @@ * modules, especially intf modules. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: messages.c,v 1.21 2002/11/10 18:04:24 sam Exp $ + * $Id: messages.c,v 1.22 2002/11/11 14:39:12 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -454,7 +454,7 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) p_item->psz_msg ); } -#if defined(WIN32) +#if defined(WIN32) || defined(UNDER_CE) fflush( stderr ); #endif } diff --git a/src/misc/modules.c b/src/misc/modules.c index 872664d31e..7483523b7c 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,7 +2,7 @@ * modules.c : Builtin and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.102 2002/11/10 18:04:24 sam Exp $ + * $Id: modules.c,v 1.103 2002/11/11 14:39:12 sam Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge @@ -57,6 +57,8 @@ #elif defined(HAVE_IMAGE_H) /* BeOS */ # include # define HAVE_DYNAMIC_PLUGINS +#elif defined(UNDER_CE) +# define HAVE_DYNAMIC_PLUGINS #elif defined(WIN32) # define HAVE_DYNAMIC_PLUGINS #else diff --git a/src/misc/modules_plugin.h.in b/src/misc/modules_plugin.h.in index 8d16a59934..05a9676a70 100644 --- a/src/misc/modules_plugin.h.in +++ b/src/misc/modules_plugin.h.in @@ -2,7 +2,7 @@ * modules_plugin.h : Plugin management functions used by the core application. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_plugin.h.in,v 1.5 2002/10/31 11:16:30 sam Exp $ + * $Id: modules_plugin.h.in,v 1.6 2002/11/11 14:39:12 sam Exp $ * * Authors: Samuel Hocevar * @@ -37,7 +37,7 @@ static int module_load( const char * psz_filename, module_handle_t * handle ) *handle = load_add_on( psz_filename ); return( *handle < 0 ); -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) *handle = LoadLibrary( psz_filename ); return( *handle == NULL ); @@ -74,7 +74,7 @@ static void module_unload( module_handle_t handle ) #ifdef SYS_BEOS unload_add_on( handle ); -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) FreeLibrary( handle ); #else @@ -106,7 +106,7 @@ static void * _module_getsymbol( module_handle_t handle, return( NULL ); } -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) return( (void *)GetProcAddress( handle, psz_function ) ); #else @@ -149,7 +149,7 @@ static const char * module_error( char *psz_buffer ) #if defined(SYS_BEOS) return( "failed" ); -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) int i, i_error = GetLastError(); FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, diff --git a/src/misc/mtime.c b/src/misc/mtime.c index f084941f89..6dfa582c1e 100644 --- a/src/misc/mtime.c +++ b/src/misc/mtime.c @@ -3,7 +3,7 @@ * Functions are prototyped in mtime.h. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: mtime.c,v 1.34 2002/08/08 00:35:11 sam Exp $ + * $Id: mtime.c,v 1.35 2002/11/11 14:39:12 sam Exp $ * * Authors: Vincent Seguin * @@ -46,7 +46,7 @@ # include #endif -#if defined( WIN32 ) +#if defined( WIN32 ) || defined( UNDER_CE ) # include #else # include @@ -95,7 +95,7 @@ mtime_t mdate( void ) #if defined( HAVE_KERNEL_OS_H ) return( real_time_clock_usecs() ); -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) /* 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 */ @@ -142,7 +142,7 @@ void mwait( mtime_t date ) } snooze( delay ); -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) mtime_t usec_time, delay; usec_time = mdate(); @@ -218,7 +218,7 @@ void msleep( mtime_t delay ) #elif defined( ST_INIT_IN_ST_H ) st_usleep( delay ); -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) Sleep( (int) (delay / 1000) ); #elif defined( HAVE_NANOSLEEP ) diff --git a/src/misc/netutils.c b/src/misc/netutils.c index 26a7f5302f..e539514dcf 100644 --- a/src/misc/netutils.c +++ b/src/misc/netutils.c @@ -2,7 +2,7 @@ * netutils.c: various network functions ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: netutils.c,v 1.75 2002/11/10 18:04:24 sam Exp $ + * $Id: netutils.c,v 1.76 2002/11/11 14:39:12 sam Exp $ * * Authors: Vincent Seguin * Benoit Steiner @@ -50,7 +50,7 @@ #endif #if defined( UNDER_CE ) - /* No real network support */ + /* No real network support (FIXME: use winsock1?) */ #elif defined( WIN32 ) # include #else diff --git a/src/misc/threads.c b/src/misc/threads.c index 68d556414f..cc130d1744 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -2,7 +2,7 @@ * threads.c : threads implementation for the VideoLAN client ***************************************************************************** * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN - * $Id: threads.c,v 1.25 2002/11/10 23:41:53 sam Exp $ + * $Id: threads.c,v 1.26 2002/11/11 14:39:12 sam Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -39,6 +39,7 @@ static volatile int i_initializations = 0; #if defined( PTH_INIT_IN_PTH_H ) #elif defined( ST_INIT_IN_ST_H ) +#elif defined( UNDER_CE ) #elif defined( WIN32 ) #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -151,6 +152,8 @@ int __vlc_threads_init( vlc_object_t *p_this ) while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP ); #elif defined( ST_INIT_IN_ST_H ) while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP ); +#elif defined( UNDER_CE ) + while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP ); #elif defined( WIN32 ) while( i_status == VLC_THREADS_PENDING ) msleep( THREAD_SLEEP ); #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) @@ -187,6 +190,9 @@ int __vlc_threads_end( vlc_object_t *p_this ) #elif defined( ST_INIT_IN_ST_H ) i_initializations--; +#elif defined( UNDER_CE ) + i_initializations--; + #elif defined( WIN32 ) i_initializations--; @@ -212,7 +218,7 @@ int __vlc_threads_end( vlc_object_t *p_this ) /* Wrapper function for profiling */ static void * vlc_thread_wrapper ( void *p_wrapper ); -# ifdef WIN32 +# if defined( WIN32 ) && !defined( UNDER_CE ) # define ITIMER_REAL 1 # define ITIMER_PROF 2 @@ -224,7 +230,7 @@ struct itimerval }; int setitimer(int kind, const struct itimerval* itnew, struct itimerval* itold); -# endif /* WIN32 */ +# endif /* WIN32 && !UNDER_CE */ typedef struct wrapper_t { @@ -257,12 +263,15 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex ) p_mutex->mutex = st_mutex_new(); return ( p_mutex->mutex == NULL ) ? errno : 0; +#elif defined( UNDER_CE ) + InitializeCriticalSection( &p_mutex->csection ); + return 0; + #elif defined( WIN32 ) /* We use mutexes on WinNT/2K/XP because we can use the SignalObjectAndWait * function and have a 100% correct vlc_cond_wait() implementation. * As this function is not available on Win9x, we can use the faster * CriticalSections */ -# if !defined( UNDER_CE ) if( p_this->p_libvlc->SignalObjectAndWait && !p_this->p_libvlc->b_fast_mutex ) { @@ -271,7 +280,6 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex ) return ( p_mutex->mutex != NULL ? 0 : 1 ); } else -# endif { p_mutex->mutex = NULL; InitializeCriticalSection( &p_mutex->csection ); @@ -338,6 +346,10 @@ int __vlc_mutex_destroy( char * psz_file, int i_line, vlc_mutex_t *p_mutex ) #elif defined( ST_INIT_IN_ST_H ) i_result = st_mutex_destroy( p_mutex->mutex ); +#elif defined( UNDER_CE ) + DeleteCriticalSection( &p_mutex->csection ); + return 0; + #elif defined( WIN32 ) if( p_mutex->mutex ) { @@ -393,11 +405,21 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar ) p_condvar->cond = st_cond_new(); return ( p_condvar->cond == NULL ) ? errno : 0; +#elif defined( UNDER_CE ) + /* Initialize counter */ + p_condvar->i_waiting_threads = 0; + + /* Create an auto-reset event. */ + p_condvar->event = CreateEvent( NULL, /* no security */ + FALSE, /* auto-reset event */ + FALSE, /* start non-signaled */ + NULL ); /* unnamed */ + return !p_condvar->event; + #elif defined( WIN32 ) /* Initialize counter */ p_condvar->i_waiting_threads = 0; -# if !defined( UNDER_CE ) /* Misc init */ p_condvar->i_win9x_cv = p_this->p_libvlc->i_win9x_cv; p_condvar->SignalObjectAndWait = p_this->p_libvlc->SignalObjectAndWait; @@ -405,7 +427,6 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar ) if( (p_condvar->SignalObjectAndWait && !p_this->p_libvlc->b_fast_mutex) || p_condvar->i_win9x_cv == 0 ) { -# endif /* Create an auto-reset event. */ p_condvar->event = CreateEvent( NULL, /* no security */ FALSE, /* auto-reset event */ @@ -414,7 +435,6 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar ) p_condvar->semaphore = NULL; return !p_condvar->event; -# if !defined( UNDER_CE ) } else { @@ -434,7 +454,6 @@ int __vlc_cond_init( vlc_object_t *p_this, vlc_cond_t *p_condvar ) return !p_condvar->semaphore || !p_condvar->event; } -# endif #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) return pthread_cond_init( &p_condvar->cond, NULL ); @@ -481,6 +500,9 @@ int __vlc_cond_destroy( char * psz_file, int i_line, vlc_cond_t *p_condvar ) #elif defined( ST_INIT_IN_ST_H ) i_result = st_cond_destroy( p_condvar->cond ); +#elif defined( UNDER_CE ) + i_result = !CloseHandle( p_condvar->event ); + #elif defined( WIN32 ) if( !p_condvar->semaphore ) i_result = !CloseHandle( p_condvar->event ); @@ -552,7 +574,7 @@ int __vlc_thread_create( vlc_object_t *p_this, char * psz_file, int i_line, p_this->thread_id = st_thread_create( func, (void *)p_this, 1, 0 ); i_ret = 0; -#elif defined( WIN32 ) +#elif defined( WIN32 ) || defined( UNDER_CE ) { unsigned threadID; /* When using the MSVCRT C library you have to use the _beginthreadex @@ -671,6 +693,9 @@ void __vlc_thread_join( vlc_object_t *p_this, char * psz_file, int i_line ) #elif defined( ST_INIT_IN_ST_H ) i_ret = st_thread_join( p_this->thread_id, NULL ); +#elif defined( UNDER_CE ) + WaitForSingleObject( p_this->thread_id, INFINITE ); + #elif defined( WIN32 ) WaitForSingleObject( p_this->thread_id, INFINITE ); diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c index 07319c27a5..21bfd720c1 100644 --- a/src/stream_output/stream_output.c +++ b/src/stream_output/stream_output.c @@ -2,7 +2,7 @@ * stream_output.c : stream output module ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: stream_output.c,v 1.4 2002/11/10 18:04:24 sam Exp $ + * $Id: stream_output.c,v 1.5 2002/11/11 14:39:12 sam Exp $ * * Authors: Christophe Massiot * @@ -77,7 +77,7 @@ static int InitInstance( sout_instance_t * p_sout ) { psz_parser++; } -#ifdef WIN32 +#if defined( WIN32 ) || defined( UNDER_CE ) if( psz_parser - p_sout->psz_dest == 1 ) { msg_Warn( p_sout, "drive letter %c: found in source string", -- 2.39.2