# Audio output settings
AUDIO = dsp
-# Not yet supported
#AUDIO += esd
+# Not yet supported
+#AUDIO += alsa
# Fallback method that should always work
AUDIO += dummy
# Target operating system
SYS=LINUX
+#SYS=GNU
#SYS=BSD
#SYS=BEOS
# For x86 architecture, choose MMX support
MMX=YES
#MMX=NO
+# For x86 architecture, optimize for Pentium Pro
+# (choose NO if you get `Invalid instruction' errors)
+PPRO=YES
+#PPRO=NO
# Decoder choice - ?? old decoder will be removed soon
#DECODER=old
# Optimizations for x86 familiy
ifeq ($(ARCH),X86)
CCFLAGS += -malign-double
-CCFLAGS += -march=pentiumpro
#CCFLAGS += -march=pentium
+ifeq ($(PPRO), YES)
+CCFLAGS += -march=pentiumpro
+endif
+# Eventual MMX optimizations for x86
+ifeq ($(MMX), YES)
+CFLAGS += -DHAVE_MMX
+endif
endif
# Optimizations for PowerPC
LCFLAGS += -Wall
#LCFLAGS += -s
-#
-# C compiler flags: common flags
-#
-
-# Eventual MMX optimizations for x86
-ifeq ($(ARCH),X86)
-ifeq ($(MMX), YES)
-CFLAGS += -DHAVE_MMX
-endif
-endif
-
#
# Additionnal debugging flags
#
audio_plugin = $(audio:%=audio_output/aout_%.so)
video_plugin = $(video:%=video_output/vout_%.so)
-PLUGIN_OBJ = $(interface_plugin) \
- $(audio_plugin) \
- $(video_plugin) \
+PLUGIN_OBJ = $(interface_plugin) $(audio_plugin) $(video_plugin)
#
# Other lists of files
$(PLUGIN_OBJ): %.so: dep/%.d
# audio plugins
-audio_output/aout_dummy.so \
- audio_output/aout_dsp.so: %.so: %.c
+audio_output/aout_dummy.so audio_output/aout_dsp.so: %.so: %.c
@echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
@$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
# video plugins
-interface/intf_dummy.so \
- video_output/vout_dummy.so \
- interface/intf_fb.so \
- video_output/vout_fb.so: %.so: %.c
+interface/intf_dummy.so video_output/vout_dummy.so \
+ interface/intf_fb.so video_output/vout_fb.so: %.so: %.c
@echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
-interface/intf_x11.so \
- video_output/vout_x11.so: %.so: %.c
+interface/intf_x11.so video_output/vout_x11.so: %.so: %.c
@echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
-interface/intf_glide.so \
- video_output/vout_glide.so: %.so: %.c
+interface/intf_glide.so video_output/vout_glide.so: %.so: %.c
@echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
-interface/intf_ggi.so \
- video_output/vout_ggi.so: %.so: %.c
+interface/intf_ggi.so video_output/vout_ggi.so: %.so: %.c
@echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
/* Boolean type */
typedef int boolean_t;
+#ifdef SYS_GNU
+#define _MACH_I386_BOOLEAN_H_
+#endif
/* Counter for statistics and profiling */
typedef unsigned long count_t;
* (c)1999 VideoLAN
*****************************************************************************
* This header is supposed to provide a portable threads implementation.
- * Currently, it is a wrapper to the POSIX pthreads library.
+ * Currently, it is a wrapper to either the POSIX pthreads library, or
+ * the Mach cthreads (for the GNU/Hurd).
*****************************************************************************/
+#ifdef SYS_GNU
+#include <cthreads.h>
+#else
#include <pthread.h>
+#endif
/*****************************************************************************
* Constants
/*****************************************************************************
* Types definition
*****************************************************************************/
+
+#ifdef SYS_GNU
+
+typedef cthread_t vlc_thread_t;
+
+/* those structs are the ones defined in /include/cthreads.h but we need
+ * * to handle *foo where foo is a mutex_t */
+typedef struct s_mutex {
+ spin_lock_t held;
+ spin_lock_t lock;
+ char *name;
+ struct cthread_queue queue;
+} vlc_mutex_t;
+
+typedef struct s_condition {
+ spin_lock_t lock;
+ struct cthread_queue queue;
+ char *name;
+ struct cond_imp *implications;
+} vlc_cond_t;
+
+#else /* SYS_GNU */
+
typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t;
+#endif /* SYS_GNU */
+
typedef void *(*vlc_thread_func_t)(void *p_data);
/*****************************************************************************
char *psz_name, vlc_thread_func_t func,
void *p_data)
{
+#ifdef SYS_GNU
+ *p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
+ return( 0 );
+#else
return pthread_create( p_thread, NULL, func, p_data );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ void vlc_thread_exit( void )
{
+#ifdef SYS_GNU
+ int result;
+ cthread_exit( &result );
+#else
pthread_exit( 0 );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread )
{
+#ifdef SYS_GNU
+ cthread_join( thread );
+#else
pthread_join( thread, NULL );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{
+#ifdef SYS_GNU
+ mutex_init( p_mutex );
+ return( 0 );
+#else
return pthread_mutex_init( p_mutex, NULL );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{
+#ifdef SYS_GNU
+ mutex_lock( p_mutex );
+ return( 0 );
+#else
return pthread_mutex_lock( p_mutex );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{
+#ifdef SYS_GNU
+ mutex_unlock( p_mutex );
+ return( 0 );
+#else
return pthread_mutex_unlock( p_mutex );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{
+#ifdef SYS_GNU
+ /* condition_init() */
+ spin_lock_init( &p_condvar->lock );
+ cthread_queue_init( &p_condvar->queue );
+ p_condvar->name = 0;
+ p_condvar->implications = 0;
+
+ return( 0 );
+#else
return pthread_cond_init( p_condvar, NULL );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{
+#ifdef SYS_GNU
+ /* condition_signal() */
+ if ( p_condvar->queue.head || p_condvar->implications )
+ {
+ cond_signal( (condition_t)p_condvar );
+ }
+ return( 0 );
+#else
return pthread_cond_signal( p_condvar );
+#endif
}
/*****************************************************************************
*****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{
+#ifdef SYS_GNU
+ condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
+ return( 0 );
+#else
return pthread_cond_wait( p_condvar, p_mutex );
+#endif
}
+
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* malloc(), free() */
-#include <sys/soundcard.h> /* "audio_output.h" */
#include <sys/uio.h> /* "input.h" */
#include "common.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* ntohl() */
-#include <sys/soundcard.h> /* "audio_output.h" */
#include <sys/uio.h> /* "input.h" */
#include "common.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* ntohl() */
-#include <sys/soundcard.h> /* "audio_output.h" */
#include <sys/uio.h>
#include "config.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h>
-#include <sys/uio.h>
-#include <string.h>
+#include <errno.h> /* errno */
+#include <sys/uio.h> /* required */
+#include <string.h> /* strerror() */
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
+#include <stdlib.h> /* free() */
+#include <netinet/in.h> /* ntohs() */
#include "common.h"
#include "config.h"
#include "input_file.h"
#include "input_network.h"
-#include "audio_output.h"
-#include "audio_decoder.h"
-
-#include "video.h"
-#include "video_output.h"
-#include "vdec_idct.h"
-#include "vdec_motion.h"
-#include "video_decoder.h"
-#include "vpar_blocks.h"
-#include "vpar_headers.h"
-#include "vpar_synchro.h"
-#include "video_parser.h"
-
-#include "ac3_decoder.h"
-#include "ac3_decoder_thread.h"
-#include "spu_decoder.h"
+#include "audio_output.h" /* aout_thread_t */
+#include "audio_decoder.h" /* adec_thread_t */
+
+#include "video.h" /* picture_t (for video_output.h) */
+#include "video_output.h" /* vout_thread_t */
+
+#include "vdec_idct.h" /* dctelem_t (for video_parser.h) */
+#include "vdec_motion.h" /* f_motion_t (for video_parser.h) */
+#include "vpar_blocks.h" /* macroblock_t (for video_parser.h) */
+#include "vpar_headers.h" /* sequence_t (for video_parser.h) */
+#include "vpar_synchro.h" /* video_synchro_t (for video_parser.h) */
+#include "video_parser.h" /* vpar_thread_t */
+
+#include "ac3_decoder.h" /* ac3dec_t (for ac3_decoder_thread.h) */
+#include "ac3_decoder_thread.h" /* ac3dec_thread_t */
+
+#include "spu_decoder.h" /* spudec_thread_t */
#include "main.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h>
-#include <pthread.h>
-#include <errno.h>
-#include <stdio.h>
#include <sys/uio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <netinet/in.h>
-#include <sys/soundcard.h>
+#include <stdlib.h> /* free(), realloc() */
+#include <string.h> /* bzero() */
+#include <netinet/in.h> /* ntohs() */
#include "common.h"
#include "config.h"
#include "input.h"
#include "input_ctrl.h"
#include "input_psi.h"
-#include "input_vlan.h"
-
-#include "audio_output.h"
-#include "video.h"
-#include "video_output.h"
-#include "interface.h"
#include "main.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <sys/ioctl.h>
+#include <errno.h> /* ENOMEM */
+#include <stdio.h> /* sprintf() */
+#include <unistd.h> /* close() */
+#include <string.h> /* strerror(), bzero() */
+#include <stdlib.h> /* free() */
+
+#include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
+#include <sys/ioctl.h> /* ioctl() */
+
+#ifdef SYS_LINUX
+#include <net/if.h> /* interface (arch-dependent) */
+#endif
#include "config.h"
#include "common.h"
static int ZeTrucMucheFunction( int Channel)
{
+#ifdef SYS_LINUX
int i_socket;
char * ipaddr;
struct ifreq interface;
/*Close the socket */
close( i_socket );
+#endif
return 0;
}
* (c)1999 VideoLAN
*****************************************************************************
* XXX??
- *****************************************************************************
- * Required headers:
- * <netinet/in.h>
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <net/if.h>
+#include <netdb.h> /* gethostbyname() */
+#include <stdlib.h> /* free(), realloc(), atoi() */
+#include <errno.h> /* errno() */
+#include <string.h> /* bzero(), bcopy() */
+#include <sys/ioctl.h> /* ioctl() */
+#include <arpa/inet.h> /* htons(), htonl() */
+
+#ifdef SYS_LINUX
+#include <net/if.h> /* interface (arch-dependent) */
+#endif
#include "config.h"
#include "common.h"
*****************************************************************************/
int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
{
- struct ifreq ifr_config;
int i_rc = 0;
+#ifdef SYS_LINUX
+ struct ifreq ifr_config;
ASSERT(p_ifdescr);
ASSERT(psz_name);
psz_name, strerror(errno));
return -1;
}
+#endif /* SYS_LINUX */
return i_rc;
}
*****************************************************************************/
int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
{
+#ifdef SYS_LINUX
struct ifreq* a_ifr_ifconf = NULL;
struct ifreq* p_ifr_current_if;
struct ifconf ifc_netconf;
int i_if_number;
int i_remaining;
+#endif /* SYS_LINUX */
int i_rc = 0;
+#ifdef SYS_LINUX
ASSERT(p_net_descr);
/* Start by assuming we have few than 3 interfaces (i_if_number will
/* Don't need the a_ifr_ifconf anymore */
free( a_ifr_ifconf );
+#endif /* SYS_LINUX */
+
return i_rc;
}