X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_threads.h;h=657f057e3674b532721a3244d58e6a10a5708ddf;hb=a5dcac2826c1f55cd4ebd610632cbd3ddf3b707b;hp=c0de539dbb07b6e35af3762825a7a156a7652841;hpb=1e666bc25b9479cc3c07d18cc7d3ad93e7567066;p=vlc diff --git a/include/vlc_threads.h b/include/vlc_threads.h index c0de539dbb..657f057e36 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.12 2002/09/01 21:20:29 massiot Exp $ + * $Id: vlc_threads.h,v 1.32 2003/06/14 00:49:58 titer Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -28,7 +28,9 @@ #include #if defined(GPROF) || defined(DEBUG) -# include +# ifdef HAVE_SYS_TIME_H +# include +# endif #endif #if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */ @@ -37,8 +39,10 @@ #elif defined( ST_INIT_IN_ST_H ) /* State threads */ # include -#elif defined( WIN32 ) /* Win32 API */ -# include +#elif defined( UNDER_CE ) + /* WinCE API */ +#elif defined( WIN32 ) +# include /* Win32 API */ #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */ # include @@ -68,18 +72,32 @@ /* Thread priorities */ #ifdef SYS_DARWIN -# define VLC_THREAD_PRIORITY_LOW 0 +# define VLC_THREAD_PRIORITY_LOW (-47) # define VLC_THREAD_PRIORITY_INPUT 37 -# define VLC_THREAD_PRIORITY_AUDIO 38 -# define VLC_THREAD_PRIORITY_VIDEO 36 -# define VLC_THREAD_PRIORITY_OUTPUT 38 +# define VLC_THREAD_PRIORITY_AUDIO 37 +# define VLC_THREAD_PRIORITY_VIDEO (-47) +# define VLC_THREAD_PRIORITY_OUTPUT 37 -#elif defined(WIN32) +#elif defined(WIN32) || defined(UNDER_CE) +/* Define different priorities for WinNT/2K/XP and Win9x/Me */ # define VLC_THREAD_PRIORITY_LOW 0 -# define VLC_THREAD_PRIORITY_INPUT THREAD_PRIORITY_ABOVE_NORMAL -# define VLC_THREAD_PRIORITY_AUDIO THREAD_PRIORITY_ABOVE_NORMAL -# define VLC_THREAD_PRIORITY_VIDEO 0 -# define VLC_THREAD_PRIORITY_OUTPUT THREAD_PRIORITY_ABOVE_NORMAL +# define VLC_THREAD_PRIORITY_INPUT \ + (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0) +# define VLC_THREAD_PRIORITY_AUDIO \ + (IS_WINNT ? THREAD_PRIORITY_HIGHEST : 0) +# define VLC_THREAD_PRIORITY_VIDEO \ + (IS_WINNT ? 0 : THREAD_PRIORITY_BELOW_NORMAL ) +# define VLC_THREAD_PRIORITY_OUTPUT \ + (IS_WINNT ? THREAD_PRIORITY_ABOVE_NORMAL : 0) +# define VLC_THREAD_PRIORITY_HIGHEST \ + (IS_WINNT ? THREAD_PRIORITY_TIME_CRITICAL : 0) + +#elif defined(SYS_BEOS) +# define VLC_THREAD_PRIORITY_LOW 5 +# define VLC_THREAD_PRIORITY_INPUT 10 +# define VLC_THREAD_PRIORITY_AUDIO 10 +# define VLC_THREAD_PRIORITY_VIDEO 5 +# define VLC_THREAD_PRIORITY_OUTPUT 15 #else # define VLC_THREAD_PRIORITY_LOW 0 @@ -120,7 +138,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 *);