#
# All possible plugin directories, needed for make clean
#
-PLUGINS_DIR := alsa beos darwin directx dsp dummy \
- dvd esd fb ggi glide gtk \
- downmix idct imdct \
- macosx mga \
- motion \
- mpeg qt sdl \
- text x11 yuv
+PLUGINS_DIR := alsa beos darwin directx dsp dummy dvd esd fb ggi glide gtk downmix idct imdct macosx mga motion mpeg qt sdl text x11 yuv
#
# All possible plugin objects
#
-PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx \
- dsp/dsp dummy/dummy dummy/null dvd/dvd esd/esd fb/fb \
- ggi/ggi glide/glide gtk/gnome gtk/gtk \
- downmix/downmix downmix/downmixsse downmix/downmix3dn \
- idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
- imdct/imdct imdct/imdct3dn imdct/imdctsse \
- macosx/macosx mga/mga \
- motion/motion motion/motionmmx motion/motionmmxext \
- mpeg/es mpeg/ps mpeg/ts qt/qt sdl/sdl \
- text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
+PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx dsp/dsp dummy/dummy dummy/null dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gtk/gnome gtk/gtk downmix/downmix downmix/downmixsse downmix/downmix3dn idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext imdct/imdct imdct/imdct3dn imdct/imdctsse macosx/macosx mga/mga motion/motion motion/motionmmx motion/motionmmxext mpeg/es mpeg/ps mpeg/ts qt/qt sdl/sdl text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
#
# C Objects
#
-INTERFACE := src/interface/main.o \
- src/interface/interface.o \
- src/interface/intf_msg.o \
- src/interface/intf_playlist.o \
- src/interface/intf_channels.o
-
-INPUT := src/input/input.o \
- src/input/input_ext-dec.o \
- src/input/input_ext-intf.o \
- src/input/input_dec.o \
- src/input/input_programs.o \
- src/input/input_netlist.o \
- src/input/input_clock.o \
- src/input/mpeg_system.o
-
-AUDIO_OUTPUT := src/audio_output/audio_output.o \
- src/audio_output/aout_ext-dec.o \
- src/audio_output/aout_u8.o \
- src/audio_output/aout_s8.o \
- src/audio_output/aout_u16.o \
- src/audio_output/aout_s16.o \
- src/audio_output/aout_spdif.o
-
-VIDEO_OUTPUT := src/video_output/video_output.o \
- src/video_output/video_text.o \
- src/video_output/video_spu.o \
- src/video_output/video_yuv.o
-
-AC3_DECODER := src/ac3_decoder/ac3_decoder_thread.o \
- src/ac3_decoder/ac3_decoder.o \
- src/ac3_decoder/ac3_parse.o \
- src/ac3_decoder/ac3_exponent.o \
- src/ac3_decoder/ac3_bit_allocate.o \
- src/ac3_decoder/ac3_mantissa.o \
- src/ac3_decoder/ac3_rematrix.o \
- src/ac3_decoder/ac3_imdct.o
-
-AC3_SPDIF := src/ac3_spdif/ac3_spdif.o \
- src/ac3_spdif/ac3_iec958.o
-
-LPCM_DECODER := src/lpcm_decoder/lpcm_decoder_thread.o \
-
-AUDIO_DECODER := src/audio_decoder/audio_decoder.o \
- src/audio_decoder/adec_generic.o \
- src/audio_decoder/adec_layer1.o \
- src/audio_decoder/adec_layer2.o \
- src/audio_decoder/adec_math.o
-
-SPU_DECODER := src/spu_decoder/spu_decoder.o
-
-#GEN_DECODER := src/generic_decoder/generic_decoder.o
-
-VIDEO_PARSER := src/video_parser/video_parser.o \
- src/video_parser/vpar_headers.o \
- src/video_parser/vpar_blocks.o \
- src/video_parser/vpar_synchro.o \
- src/video_parser/video_fifo.o
-
-VIDEO_DECODER := src/video_decoder/video_decoder.o
-
-MISC := src/misc/mtime.o \
- src/misc/tests.o \
- src/misc/modules.o \
- src/misc/netutils.o
-
-C_OBJ := $(INTERFACE) \
- $(INPUT) \
- $(VIDEO_OUTPUT) \
- $(AUDIO_OUTPUT) \
- $(AC3_DECODER) \
- $(AC3_SPDIF) \
- $(LPCM_DECODER) \
- $(AUDIO_DECODER) \
- $(SPU_DECODER) \
- $(GEN_DECODER) \
- $(VIDEO_PARSER) \
- $(VIDEO_DECODER) \
- $(MISC)
+INTERFACE := main interface intf_msg intf_playlist intf_channels
+INPUT := input input_ext-dec input_ext-intf input_dec input_programs input_netlist input_clock mpeg_system
+VIDEO_OUTPUT := video_output video_text video_spu video_yuv
+AUDIO_OUTPUT := audio_output aout_ext-dec aout_u8 aout_s8 aout_u16 aout_s16 aout_spdif
+AC3_DECODER := ac3_decoder_thread ac3_decoder ac3_parse ac3_exponent ac3_bit_allocate ac3_mantissa ac3_rematrix ac3_imdct
+AC3_SPDIF := ac3_spdif ac3_iec958
+LPCM_DECODER := lpcm_decoder_thread
+AUDIO_DECODER := audio_decoder adec_generic adec_layer1 adec_layer2 adec_math
+SPU_DECODER := spu_decoder
+#GEN_DECODER := generic_decoder
+VIDEO_PARSER := video_parser vpar_headers vpar_blocks vpar_synchro video_fifo
+VIDEO_DECODER := video_decoder
+MISC := mtime tests modules netutils
+
+C_OBJ := $(INTERFACE:%=src/interface/%.o) \
+ $(INPUT:%=src/input/%.o) \
+ $(VIDEO_OUTPUT:%=src/video_output/%.o) \
+ $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
+ $(AC3_DECODER:%=src/ac3_decoder/%.o) \
+ $(AC3_SPDIF:%=src/ac3_spdif/%.o) \
+ $(LPCM_DECODER:%=src/lpcm_decoder/%.o) \
+ $(AUDIO_DECODER:%=src/audio_decoder/%.o) \
+ $(SPU_DECODER:%=src/spu_decoder/%.o) \
+ $(GEN_DECODER:%=src/generic_decoder/%.o) \
+ $(VIDEO_PARSER:%=src/video_parser/%.o) \
+ $(VIDEO_DECODER:%=src/video_decoder/%.o) \
+ $(MISC:%=src/misc/%.o)
#
# Misc Objects
#
all: vlc ${ALIASES} plugins vlc.app
-clean:
+clean: libdvdcss-clean plugins-clean vlc-clean
+ rm -f src/*/*.o extras/*/*.o
+ rm -f lib/*.so lib/*.so.* lib/*.a
+
+libdvdcss-clean:
+ cd extras/libdvdcss && $(MAKE) clean
+
+plugins-clean:
for dir in $(PLUGINS_DIR) ; do \
( cd plugins/$${dir} && $(MAKE) clean ) ; done
rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
+
+vlc-clean:
rm -f $(C_OBJ) $(CPP_OBJ)
- rm -f src/*/*.o extras/*/*.o
- rm -f lib/*.so lib/*.a vlc gnome-vlc gvlc kvlc qvlc
+ rm -f vlc gnome-vlc gvlc kvlc qvlc
rm -Rf vlc.app
distclean: clean
rm -Rf .dep
rm -f .gdb_history
-install:
+install: libdvdcss-install vlc-install plugins-install
+
+vlc-install:
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) vlc $(DESTDIR)$(bindir)
ifneq (,$(ALIASES))
for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
-endif
- mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
-ifneq (,$(PLUGINS))
- $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
endif
mkdir -p $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
$(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
+plugins-install:
+ mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
+ifneq (,$(PLUGINS))
+ $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
+endif
+
+libdvdcss-install:
+ cd extras/libdvdcss && $(MAKE) install
+
show:
@echo CC: $(CC)
@echo CFLAGS: $(CFLAGS)
bindir = @bindir@
datadir = @datadir@
libdir = @libdir@
+includedir = @includedir@
#
# Libraries for special cases
CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@
+#
+# Other special cases
+#
+LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
+
###############################################################################
# Configuration pre-processing
###############################################################################
INCLUDE += @INCLUDE@
INCLUDE += -Iinclude -Iextras -I/usr/local/include
+#
+# Libraries needed by built-in modules
+#
+ifneq (,$(BUILTINS))
+LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
+LIB += $(LIB_BUILTINS)
+endif
+
#
# Libraries
#
-LIB += @LIB@ -L/usr/local/lib
+ifeq (1,$(LOCAL_LIBDVDCSS))
+ifneq (,$(findstring dvd,$(BUILTINS)))
+LIB += lib/libdvdcss.a
+endif
+endif
ifneq (,$(findstring mingw32,$(SYS)))
LIB += -lws2_32 -lnetapi32
endif
-#
-# Libraries needed by built-in modules
-#
-ifneq (,$(BUILTINS))
-LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
-LIB += $(LIB_BUILTINS)
-endif
+LIB += -L/usr/local/lib @LIB@
#
# C compiler flags: mainstream compilation
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
- --disable-dummy dummy module (default enabled)"
-ac_help="$ac_help
- --disable-null Null module (default enabled)"
-ac_help="$ac_help
- --disable-rc rc module (default enabled)"
+ --enable-pth Enable GNU Pth support (default disabled)"
ac_help="$ac_help
--disable-ppro Disable PentiumPro optimizations (default enabled for x86)"
ac_help="$ac_help
--enable-trace Enable trace mode (default disabled)"
ac_help="$ac_help
--disable-optimizations Disable compiler optimizations (default enabled)"
+ac_help="$ac_help
+ --disable-dummy dummy module (default enabled)"
+ac_help="$ac_help
+ --disable-null Null module (default enabled)"
+ac_help="$ac_help
+ --disable-rc rc module (default enabled)"
ac_help="$ac_help
--disable-dsp Linux /dev/dsp support (default enabled)"
ac_help="$ac_help
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:609: checking host system type" >&5
+echo "configure:611: checking host system type" >&5
host_alias=$host
case "$host_alias" in
save_CFLAGS="${CFLAGS}"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:638: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:640: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:667: checking for $ac_word" >&5
+echo "configure:669: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:697: checking for $ac_word" >&5
+echo "configure:699: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:748: checking for $ac_word" >&5
+echo "configure:750: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:780: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:782: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 791 "configure"
+#line 793 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:822: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:824: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:827: checking whether we are using GNU C" >&5
+echo "configure:829: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:855: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:857: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:887: checking how to run the C preprocessor" >&5
+echo "configure:889: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 902 "configure"
+#line 904 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 919 "configure"
+#line 921 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 936 "configure"
+#line 938 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:969: checking for $ac_word" >&5
+echo "configure:971: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1009: checking for a BSD compatible install" >&5
+echo "configure:1011: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1063: checking for working const" >&5
+echo "configure:1065: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1068 "configure"
+#line 1070 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
if test x${cross_compiling} != xyes; then
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:1140: checking whether byte ordering is bigendian" >&5
+echo "configure:1142: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 1147 "configure"
+#line 1149 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:1158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 1162 "configure"
+#line 1164 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
#endif
; return 0; }
EOF
-if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1193 "configure"
+#line 1195 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
for ac_func in gettimeofday select strerror strtod strtol
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1234: checking for $ac_func" >&5
+echo "configure:1236: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1239 "configure"
+#line 1241 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in setenv putenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1289: checking for $ac_func" >&5
+echo "configure:1291: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1296 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:1342: checking for connect" >&5
+echo "configure:1344: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1347 "configure"
+#line 1349 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
; return 0; }
EOF
-if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:1389: checking for connect in -lsocket" >&5
+echo "configure:1391: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1397 "configure"
+#line 1399 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
connect()
; return 0; }
EOF
-if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1432: checking for gethostbyname" >&5
+echo "configure:1434: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1437 "configure"
+#line 1439 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
; return 0; }
EOF
-if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1479: checking for gethostbyname in -lnsl" >&5
+echo "configure:1481: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1487 "configure"
+#line 1489 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:1522: checking for nanosleep" >&5
+echo "configure:1524: checking for nanosleep" >&5
if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1527 "configure"
+#line 1529 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char nanosleep(); below. */
; return 0; }
EOF
-if { (eval echo configure:1550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_nanosleep=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:1569: checking for nanosleep in -lrt" >&5
+echo "configure:1571: checking for nanosleep in -lrt" >&5
ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1577 "configure"
+#line 1579 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
nanosleep()
; return 0; }
EOF
-if { (eval echo configure:1588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:1608: checking for nanosleep in -lposix4" >&5
+echo "configure:1610: checking for nanosleep in -lposix4" >&5
ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1616 "configure"
+#line 1618 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
nanosleep()
; return 0; }
EOF
-if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1656: checking for $ac_func" >&5
+echo "configure:1658: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1661 "configure"
+#line 1663 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:1709: checking for inet_aton" >&5
+echo "configure:1711: checking for inet_aton" >&5
if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1714 "configure"
+#line 1716 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char inet_aton(); below. */
; return 0; }
EOF
-if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_inet_aton=yes"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:1756: checking for inet_aton in -lresolv" >&5
+echo "configure:1758: checking for inet_aton in -lresolv" >&5
ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1764 "configure"
+#line 1766 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
inet_aton()
; return 0; }
EOF
-if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in vasprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1801: checking for $ac_func" >&5
+echo "configure:1803: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1806 "configure"
+#line 1808 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in swab
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1856: checking for $ac_func" >&5
+echo "configure:1858: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1863 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_func in sigrelse
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1914: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1861 "configure"
+#line 1919 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:1910: checking for getopt_long" >&5
+echo "configure:1968: checking for getopt_long" >&5
if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1915 "configure"
+#line 1973 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long(); below. */
; return 0; }
EOF
-if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_getopt_long=yes"
else
echo "$ac_t""no" 1>&6
# FreeBSD has a gnugetopt library for this:
echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:1960: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:2018: checking for getopt_long in -lgnugetopt" >&5
ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgnugetopt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1968 "configure"
+#line 2026 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getopt_long()
; return 0; }
EOF
-if { (eval echo configure:1979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2011: checking for $ac_hdr" >&5
+echo "configure:2069: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2016 "configure"
+#line 2074 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2050: checking for $ac_func" >&5
+echo "configure:2108: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2055 "configure"
+#line 2113 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2103: checking for working mmap" >&5
+echo "configure:2161: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2111 "configure"
+#line 2169 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
}
EOF
-if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2274: checking return type of signal handlers" >&5
+echo "configure:2332: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2279 "configure"
+#line 2337 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:2296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2315: checking for dlopen in -ldl" >&5
+echo "configure:2373: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2323 "configure"
+#line 2381 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dlopen()
; return 0; }
EOF
-if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:2355: checking for pow in -lm" >&5
+echo "configure:2413: checking for pow in -lm" >&5
ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2363 "configure"
+#line 2421 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pow()
; return 0; }
EOF
-if { (eval echo configure:2374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
PTHREAD_LIBS=error
echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
-echo "configure:2400: checking for pthread_attr_init in -lpthread" >&5
+echo "configure:2458: checking for pthread_attr_init in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2408 "configure"
+#line 2466 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_attr_init()
; return 0; }
EOF
-if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- PTHREAD_LIBS="-lpthread"
+ THREAD_LIB="-lpthread"
else
echo "$ac_t""no" 1>&6
fi
-if test "x${PTHREAD_LIBS}" = xerror; then
+if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:2441: checking for pthread_attr_init in -lpthreads" >&5
+echo "configure:2499: checking for pthread_attr_init in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2449 "configure"
+#line 2507 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_attr_init()
; return 0; }
EOF
-if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- PTHREAD_LIBS="-lpthreads"
+ THREAD_LIB="-lpthreads"
else
echo "$ac_t""no" 1>&6
fi
fi
-if test "x${PTHREAD_LIBS}" = xerror; then
+if test "x${THREAD_LIB}" = xerror; then
echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:2483: checking for pthread_attr_init in -lc_r" >&5
+echo "configure:2541: checking for pthread_attr_init in -lc_r" >&5
ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lc_r $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2491 "configure"
+#line 2549 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_attr_init()
; return 0; }
EOF
-if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- PTHREAD_LIBS="-lc_r"
+ THREAD_LIB="-lc_r"
else
echo "$ac_t""no" 1>&6
fi
fi
-if test "x${PTHREAD_LIBS}" = xerror; then
- PTHREAD_LIBS=""
+if test "x${THREAD_LIB}" = xerror; then
+ THREAD_LIBS=""
echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
-echo "configure:2526: checking for pthread_attr_init" >&5
+echo "configure:2584: checking for pthread_attr_init" >&5
if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2531 "configure"
+#line 2589 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char pthread_attr_init(); below. */
; return 0; }
EOF
-if { (eval echo configure:2554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_pthread_attr_init=yes"
else
fi
fi
-LIB="${LIB} ${PTHREAD_LIBS}"
cat > conftest.$ac_ext <<EOF
-#line 2577 "configure"
+#line 2634 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
#define PTHREAD_COND_T_IN_PTHREAD_H 1
EOF
-
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2594 "configure"
+#line 2650 "configure"
#include "confdefs.h"
#include <strings.h>
EOF
#define STRNCASECMP_IN_STRINGS_H 1
EOF
-
fi
rm -f conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2615: checking for $ac_hdr" >&5
+echo "configure:2670: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2620 "configure"
+#line 2675 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2655: checking for $ac_hdr" >&5
+echo "configure:2710: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2660 "configure"
+#line 2715 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2695: checking for $ac_hdr" >&5
+echo "configure:2750: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2700 "configure"
+#line 2755 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2735: checking for $ac_hdr" >&5
+echo "configure:2790: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2740 "configure"
+#line 2795 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2775: checking for $ac_hdr" >&5
+echo "configure:2830: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2780 "configure"
+#line 2835 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2815: checking for $ac_hdr" >&5
+echo "configure:2870: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2820 "configure"
+#line 2875 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2856: checking for $ac_hdr" >&5
+echo "configure:2911: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2861 "configure"
+#line 2916 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CFLAGS="${save_CFLAGS} -Wall -Werror"
echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:2895: checking for ntohl in sys/param.h" >&5
+echo "configure:2950: checking for ntohl in sys/param.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2897 "configure"
+#line 2952 "configure"
#include "confdefs.h"
#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }
; return 0; }
EOF
-if { (eval echo configure:2905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define NTOHL_IN_SYS_PARAM_H 1
CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
echo $ac_n "checking if \$CC compiles plugins with -bundle -undefined suppress""... $ac_c" 1>&6
-echo "configure:2922: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5
+echo "configure:2977: checking if \$CC compiles plugins with -bundle -undefined suppress" >&5
cat > conftest.$ac_ext <<EOF
-#line 2924 "configure"
+#line 2979 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2986: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; echo "$ac_t""yes" 1>&6
else
CFLAGS="${save_CFLAGS} -shared"
echo $ac_n "checking if \$CC compiles plugins with -shared""... $ac_c" 1>&6
-echo "configure:2944: checking if \$CC compiles plugins with -shared" >&5
+echo "configure:2999: checking if \$CC compiles plugins with -shared" >&5
cat > conftest.$ac_ext <<EOF
-#line 2946 "configure"
+#line 3001 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
PLCFLAGS="${PLCFLAGS} -shared"; echo "$ac_t""yes" 1>&6
else
CFLAGS="${save_CFLAGS}"
echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2967: checking for boolean_t in sys/types.h" >&5
+echo "configure:3022: checking for boolean_t in sys/types.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2969 "configure"
+#line 3024 "configure"
#include "confdefs.h"
#include <sys/types.h>
void quux() { boolean_t foo; }
; return 0; }
EOF
-if { (eval echo configure:2977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_SYS_TYPES_H 1
fi
rm -f conftest*
echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:2992: checking for boolean_t in pthread.h" >&5
+echo "configure:3047: checking for boolean_t in pthread.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2994 "configure"
+#line 3049 "configure"
#include "confdefs.h"
#include <pthread.h>
void quux() { boolean_t foo; }
; return 0; }
EOF
-if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_PTHREAD_H 1
rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3018: checking for working const" >&5
+echo "configure:3073: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3023 "configure"
+#line 3078 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3093: checking for ANSI C header files" >&5
+echo "configure:3148: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3098 "configure"
+#line 3153 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3123 "configure"
+#line 3178 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3141 "configure"
+#line 3196 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 3162 "configure"
+#line 3217 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:3173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3197: checking for size_t" >&5
+echo "configure:3252: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3202 "configure"
+#line 3257 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3230: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3285: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3290 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:3244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
esac
echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:3282: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:3337: checking if \$CC groks MMX inline assembly" >&5
cat > conftest.$ac_ext <<EOF
-#line 3284 "configure"
+#line 3339 "configure"
#include "confdefs.h"
void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
int main() {
; return 0; }
EOF
-if { (eval echo configure:3291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
echo "$ac_t""yes" 1>&6
rm -f conftest*
echo $ac_n "checking if \$CC groks MMX EXT or SSE inline assembly""... $ac_c" 1>&6
-echo "configure:3304: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
+echo "configure:3359: checking if \$CC groks MMX EXT or SSE inline assembly" >&5
cat > conftest.$ac_ext <<EOF
-#line 3306 "configure"
+#line 3361 "configure"
#include "confdefs.h"
void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
int main() {
; return 0; }
EOF
-if { (eval echo configure:3313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
echo "$ac_t""yes" 1>&6
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3329: checking for $ac_hdr" >&5
+echo "configure:3384: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3334 "configure"
+#line 3389 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3394: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
#define $ac_tr_hdr 1
EOF
- BUILTINS="${BUILTINS} dvd"
- LIB_DVD="${LIB_DVD} -Llib -L../../lib -ldvdcss"
- CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+ LIBDVDCSS=1
for ac_hdr in sys/cdio.h sys/dvdio.h linux/cdrom.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3367: checking for $ac_hdr" >&5
+echo "configure:3420: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3372 "configure"
+#line 3425 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
BSD_DVD_STRUCT=0
cat > conftest.$ac_ext <<EOF
-#line 3405 "configure"
+#line 3458 "configure"
#include "confdefs.h"
#include <sys/dvdio.h>
EOF
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3423 "configure"
+#line 3476 "configure"
#include "confdefs.h"
#include <sys/cdio.h>
EOF
fi
cat > conftest.$ac_ext <<EOF
-#line 3447 "configure"
+#line 3500 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
done
-# Check whether --enable-dummy or --disable-dummy was given.
-if test "${enable_dummy+set}" = set; then
- enableval="$enable_dummy"
- :
+# Check whether --enable-pth or --disable-pth was given.
+if test "${enable_pth+set}" = set; then
+ enableval="$enable_pth"
+ if test x$enableval = xyes; then
+ echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
+echo "configure:3528: checking for pth_init in -lpth" >&5
+ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpth $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3536 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pth_init();
+
+int main() {
+pth_init()
+; return 0; }
+EOF
+if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
-if test x$enable_dummy != xno; then
- BUILTINS="${BUILTINS} dummy"; fi
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo pth | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
-# Check whether --enable-null or --disable-null was given.
-if test "${enable_null+set}" = set; then
- enableval="$enable_null"
- :
+ LIBS="-lpth $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
fi
-if test x$enable_null != xno; then
- BUILTINS="${BUILTINS} null"; fi
+ cat > conftest.$ac_ext <<EOF
+#line 3575 "configure"
+#include "confdefs.h"
+#include <pth.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "pth_init" >/dev/null 2>&1; then
+ rm -rf conftest*
+
+ cat >> confdefs.h <<\EOF
+#define PTH_INIT_IN_PTH_H 1
+EOF
-# Check whether --enable-rc or --disable-rc was given.
-if test "${enable_rc+set}" = set; then
- enableval="$enable_rc"
- :
+ THREAD_LIB="-lpth"
+ fi
fi
+rm -f conftest*
-if test x$enable_rc != xno; then
- BUILTINS="${BUILTINS} rc"; fi
+
+fi
+
+
+LIB="${LIB} ${THREAD_LIB}"
# Check whether --enable-ppro or --disable-ppro was given.
if test "${enable_ppro+set}" = set; then
fi
+for ac_hdr in videolan/dvdcss.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3676: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3681 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+ # installed libdvdcss
+ BUILTINS="${BUILTINS} dvd"
+ LIB_DVD="${LIB_DVD} -ldvdcss"
+else
+ echo "$ac_t""no" 1>&6
+if test x${LIBDVDCSS} = x1; then
+ # local libdvdcss
+ LOCAL_LIBDVDCSS=1
+ BUILTINS="${BUILTINS} dvd"
+ CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+ fi
+fi
+done
+
+
+# Check whether --enable-dummy or --disable-dummy was given.
+if test "${enable_dummy+set}" = set; then
+ enableval="$enable_dummy"
+ :
+fi
+
+if test x$enable_dummy != xno; then
+ BUILTINS="${BUILTINS} dummy"; fi
+
+# Check whether --enable-null or --disable-null was given.
+if test "${enable_null+set}" = set; then
+ enableval="$enable_null"
+ :
+fi
+
+if test x$enable_null != xno; then
+ BUILTINS="${BUILTINS} null"; fi
+
+# Check whether --enable-rc or --disable-rc was given.
+if test "${enable_rc+set}" = set; then
+ enableval="$enable_rc"
+ :
+fi
+
+if test x$enable_rc != xno; then
+ BUILTINS="${BUILTINS} rc"; fi
+
SYS=${host_os}
if test x$host_os = xbeos; then
# Extract the first word of "esd-config", so it can be a program name with args.
set dummy esd-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3599: checking for $ac_word" >&5
+echo "configure:3777: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3664: checking for $ac_hdr" >&5
+echo "configure:3842: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3669 "configure"
+#line 3847 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3745: checking for $ac_hdr" >&5
+echo "configure:3923: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3750 "configure"
+#line 3928 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3933: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3793: checking for $ac_hdr" >&5
+echo "configure:3971: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3798 "configure"
+#line 3976 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
PLUGINS="${PLUGINS} directx";
if test "x$withval" != "xyes";
then
- LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound"
+ LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
INCLUDE="${INCLUDE} -I"$withval"/include"
else
for ac_hdr in directx.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3847: checking for $ac_hdr" >&5
+echo "configure:4025: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3852 "configure"
+#line 4030 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
fi
done
- LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"
+ LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
fi
fi
fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3895: checking for $ac_hdr" >&5
+echo "configure:4073: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3900 "configure"
+#line 4078 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
#define $ac_tr_hdr 1
EOF
PLUGINS="${PLUGINS} directx"
- LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"
+ LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4005: checking for $ac_word" >&5
+echo "configure:4183: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4065: checking for $ac_hdr" >&5
+echo "configure:4243: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4070 "configure"
+#line 4248 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4253: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4127: checking for $ac_hdr" >&5
+echo "configure:4305: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4132 "configure"
+#line 4310 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:4175: checking for sys/asoundlib.h" >&5
+echo "configure:4353: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4180 "configure"
+#line 4358 "configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:4202: checking for main in -lasound" >&5
+echo "configure:4380: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4210 "configure"
+#line 4388 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:4217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
+
+
+
s%@INCLUDE@%$INCLUDE%g
s%@DEBUG@%$DEBUG%g
s%@STATS@%$STATS%g
+s%@ASM@%$ASM%g
s%@TRACE@%$TRACE%g
s%@OPTIMS@%$OPTIMS%g
s%@CSS@%$CSS%g
s%@CFLAGS_GTK@%$CFLAGS_GTK%g
s%@CFLAGS_SDL@%$CFLAGS_SDL%g
s%@CFLAGS_X11@%$CFLAGS_X11%g
+s%@LOCAL_LIBDVDCSS@%$LOCAL_LIBDVDCSS%g
CEOF
EOF
system : ${SYS}
architecture : ${ARCH}
optimizations : ${OPTIMS}
+inline assembly : ${ASM}
vlc configuration
-----------------
AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNCS(swab)
+AC_CHECK_FUNCS(sigrelse)
+
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long],
dnl Check for pthreads - borrowed from XMMS
PTHREAD_LIBS=error
-AC_CHECK_LIB(pthread,pthread_attr_init,PTHREAD_LIBS="-lpthread")
-if test "x${PTHREAD_LIBS}" = xerror; then
- AC_CHECK_LIB(pthreads,pthread_attr_init,PTHREAD_LIBS="-lpthreads")
+AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
+if test "x${THREAD_LIB}" = xerror; then
+ AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
fi
-if test "x${PTHREAD_LIBS}" = xerror; then
- AC_CHECK_LIB(c_r,pthread_attr_init,PTHREAD_LIBS="-lc_r")
+if test "x${THREAD_LIB}" = xerror; then
+ AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
fi
-if test "x${PTHREAD_LIBS}" = xerror; then
- PTHREAD_LIBS=""
+if test "x${THREAD_LIB}" = xerror; then
+ THREAD_LIBS=""
AC_CHECK_FUNC(pthread_attr_init)
fi
-LIB="${LIB} ${PTHREAD_LIBS}"
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.)
-])
+ 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.)
-])
+ Define if <strings.h> defines strncasecmp.)])
dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl
-dnl DVD module: check for DVD ioctls
+dnl libdvdcss: check for DVD ioctls
dnl
AC_CHECK_HEADERS(sys/ioctl.h,[
- BUILTINS="${BUILTINS} dvd"
- LIB_DVD="${LIB_DVD} -Llib -L../../lib -ldvdcss"
- CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+ LIBDVDCSS=1
AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h)
BSD_DVD_STRUCT=0
dnl
])
dnl
-dnl dummy plugin
-dnl
-AC_ARG_ENABLE(dummy,
- [ --disable-dummy dummy module (default enabled)])
-if test x$enable_dummy != xno; then
- BUILTINS="${BUILTINS} dummy"; fi
-
-dnl
-dnl null plugin
+dnl GNU portable threads
dnl
-AC_ARG_ENABLE(null,
- [ --disable-null Null module (default enabled)])
-if test x$enable_null != xno; then
- BUILTINS="${BUILTINS} null"; fi
+AC_ARG_ENABLE(pth,
+ [ --enable-pth Enable GNU Pth support (default disabled)],
+ [ if test x$enableval = xyes; then
+ AC_CHECK_LIB(pth,pth_init)
+ AC_EGREP_HEADER(pth_init,pth.h,[
+ AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
+ Define if <pth.h> defines pth_init)
+ THREAD_LIB="-lpth"
+ fi])
+])
-dnl
-dnl rc plugin
-dnl
-AC_ARG_ENABLE(rc,
- [ --disable-rc rc module (default enabled)])
-if test x$enable_rc != xno; then
- BUILTINS="${BUILTINS} rc"; fi
+LIB="${LIB} ${THREAD_LIB}"
dnl
dnl PentiumPro acceleration
dnl
AC_ARG_ENABLE(ppro,
-[ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
+ [ --disable-ppro Disable PentiumPro optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
+dnl
+dnl DVD module: check for installed libdvdcss or local libdvdcss
+dnl TODO: use user-provided --with-dvdcss flag
+dnl
+AC_CHECK_HEADERS(videolan/dvdcss.h,[
+ # installed libdvdcss
+ BUILTINS="${BUILTINS} dvd"
+ LIB_DVD="${LIB_DVD} -ldvdcss"],
+ [if test x${LIBDVDCSS} = x1; then
+ # local libdvdcss
+ LOCAL_LIBDVDCSS=1
+ BUILTINS="${BUILTINS} dvd"
+ CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
+ fi])
+
+dnl
+dnl dummy plugin
+dnl
+AC_ARG_ENABLE(dummy,
+ [ --disable-dummy dummy module (default enabled)])
+if test x$enable_dummy != xno; then
+ BUILTINS="${BUILTINS} dummy"; fi
+
+dnl
+dnl null plugin
+dnl
+AC_ARG_ENABLE(null,
+ [ --disable-null Null module (default enabled)])
+if test x$enable_null != xno; then
+ BUILTINS="${BUILTINS} null"; fi
+
+dnl
+dnl rc plugin
+dnl
+AC_ARG_ENABLE(rc,
+ [ --disable-rc rc module (default enabled)])
+if test x$enable_rc != xno; then
+ BUILTINS="${BUILTINS} rc"; fi
+
SYS=${host_os}
dnl special case for BeOS
PLUGINS="${PLUGINS} directx";
if test "x$withval" != "xyes";
then
- LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lddraw -ldsound"
+ LIB_DIRECTX="${LIB_DIRECTX} -L"$withval"/lib -lgdi32 -ldxguid"
INCLUDE="${INCLUDE} -I"$withval"/include"
else
AC_CHECK_HEADERS(directx.h, , [echo "Cannot find DirectX headers !"; exit])
- LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"
+ LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"
fi
fi ])
if test "x$withval" = "x";
then
AC_CHECK_HEADERS(directx.h,
[PLUGINS="${PLUGINS} directx"
- LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lddraw -ldsound"])
+ LIB_DIRECTX="${LIB_DIRECTX} -L/usr/lib -lgdi32 -ldxguid"])
fi
dnl
AC_SUBST(INCLUDE)
AC_SUBST(DEBUG)
AC_SUBST(STATS)
+AC_SUBST(ASM)
AC_SUBST(TRACE)
AC_SUBST(OPTIMS)
AC_SUBST(CSS)
AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11)
+AC_SUBST(LOCAL_LIBDVDCSS)
+
AC_OUTPUT([Makefile.opts include/config.h])
echo "
system : ${SYS}
architecture : ${ARCH}
optimizations : ${OPTIMS}
+inline assembly : ${ASM}
vlc configuration
-----------------
Section: graphics
Priority: optional
Maintainer: Samuel Hocevar <sam@zoy.org>
-Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libggi2-dev, libglide-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev
+Build-Depends: debhelper (>=2.2.0), xlib6g-dev, libgnome-dev, libggi2-dev, libglide3-dev [i386], libesd0-dev, libsdl1.2-dev, libqt-dev, libasound2-dev
Standards-Version: 3.0.1
Package: vlc
include ../../Makefile.opts
+LIBDVDCSS_VERSION = 0.0.1
+LIBDVDCSS_MAJOR = 0
+
#
# Objects
#
$(LIBDVDCSS_O): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
-../../lib/libdvdcss.so: $(LIBDVDCSS_O)
+../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION): $(LIBDVDCSS_O)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
+ rm -f ../../lib/libdvdcss.so && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.so
+ rm -f ../../lib/libdvdcss.so.$(LIBDVDCSS_MAJOR) && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.so.$(LIBDVDCSS_MAJOR)
../../lib/libdvdcss.a: $(LIBDVDCSS_O)
ar r $@ $^
$(RANLIB) $@
-#all: ../../lib/libdvdcss.so ../../lib/libdvdcss.a
-all: ../../lib/libdvdcss.a
+all: ../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION) ../../lib/libdvdcss.a
+
+install:
+ mkdir -p $(DESTDIR)$(includedir)/videolan
+ $(INSTALL) -m 644 videolan/dvdcss.h $(DESTDIR)$(includedir)/videolan
+ mkdir -p $(DESTDIR)$(libdir)
+ $(INSTALL) -m 644 ../../lib/libdvdcss.a $(DESTDIR)$(libdir)
+ $(INSTALL) -m 644 ../../lib/libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)
+ rm -f $(DESTDIR)$(libdir)/libdvdcss.so && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)/libdvdcss.so
+ rm -f $(DESTDIR)$(libdir)/libdvdcss.so.$(LIBDVDCSS_MAJOR) && ln -s libdvdcss.so.$(LIBDVDCSS_VERSION) $(DESTDIR)$(libdir)/libdvdcss.so.$(LIBDVDCSS_MAJOR)
* libdvdcss.c: DVD reading library.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.c,v 1.1 2001/06/12 22:14:44 sam Exp $
+ * $Id: libdvdcss.c,v 1.2 2001/06/14 01:49:44 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
static int _dvdcss_readv ( dvdcss_handle, struct iovec *p_iovec, int i_blocks );
/*****************************************************************************
- * dvdcss_init: initialize libdvdcss
+ * dvdcss_open: initialize library, open a DVD device, crack CSS key
*****************************************************************************/
-extern dvdcss_handle dvdcss_init ( int i_flags )
+extern dvdcss_handle dvdcss_open ( char *psz_target, int i_flags )
{
+ int i_ret;
+
dvdcss_handle dvdcss;
/* Allocate the library structure */
}
/* Initialize structure */
- dvdcss->i_status = DVDCSS_STATUS_NONE;
-
dvdcss->b_debug = i_flags & DVDCSS_INIT_DEBUG;
dvdcss->b_errors = !(i_flags & DVDCSS_INIT_QUIET);
dvdcss->psz_error = "no error";
- /* XXX: additional initialization stuff might come here */
-
- dvdcss->i_status |= DVDCSS_STATUS_INIT;
-
- return dvdcss;
-}
-
-/*****************************************************************************
- * dvdcss_error: return the last libdvdcss error message
- *****************************************************************************/
-extern char * dvdcss_error ( dvdcss_handle dvdcss )
-{
- return dvdcss->psz_error;
-}
-
-/*****************************************************************************
- * dvdcss_open: open a DVD device, crack CSS key if disc is encrypted
- *****************************************************************************/
-extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
-{
- int i_ret;
-
- if( ! (dvdcss->i_status & DVDCSS_STATUS_INIT) )
- {
- _dvdcss_error( dvdcss, "library not initialized" );
- return -1;
- }
-
- if( dvdcss->i_status & DVDCSS_STATUS_OPEN )
- {
- _dvdcss_error( dvdcss, "a device is already opened" );
- return -1;
- }
-
i_ret = _dvdcss_open( dvdcss, psz_target );
if( i_ret < 0 )
{
- return i_ret;
+ free( dvdcss );
+ return NULL;
}
i_ret = CSSTest( dvdcss );
{
_dvdcss_error( dvdcss, "css test failed" );
_dvdcss_close( dvdcss );
- return i_ret;
+ free( dvdcss );
+ return NULL;
}
dvdcss->b_encrypted = i_ret;
if( i_ret < 0 )
{
_dvdcss_close( dvdcss );
- return i_ret;
+ free( dvdcss );
+ return NULL;
}
}
- dvdcss->i_status |= DVDCSS_STATUS_OPEN;
+ return dvdcss;
+}
- return 0;
+/*****************************************************************************
+ * dvdcss_error: return the last libdvdcss error message
+ *****************************************************************************/
+extern char * dvdcss_error ( dvdcss_handle dvdcss )
+{
+ return dvdcss->psz_error;
}
/*****************************************************************************
*****************************************************************************/
extern int dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks )
{
- if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
- {
- _dvdcss_error( dvdcss, "no device opened" );
- return -1;
- }
-
return _dvdcss_seek( dvdcss, i_blocks );
}
{
int i_ret;
- if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
- {
- _dvdcss_error( dvdcss, "no device opened" );
- return -1;
- }
-
if( ! dvdcss->b_encrypted )
{
return 0;
{
int i_ret;
- if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
- {
- _dvdcss_error( dvdcss, "no device opened" );
- return -1;
- }
-
i_ret = _dvdcss_read( dvdcss, p_buffer, i_blocks );
if( i_ret != i_blocks
void *iov_base;
size_t iov_len;
- if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
- {
- _dvdcss_error( dvdcss, "no device opened" );
- return -1;
- }
-
i_ret = _dvdcss_readv( dvdcss, P_IOVEC, i_blocks );
if( i_ret != i_blocks
}
/*****************************************************************************
- * dvdcss_close: close the DVD device
+ * dvdcss_close: close the DVD device and clean up the library
*****************************************************************************/
extern int dvdcss_close ( dvdcss_handle dvdcss )
{
int i_ret;
- if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
- {
- _dvdcss_error( dvdcss, "no device opened" );
- return -1;
- }
-
i_ret = _dvdcss_close( dvdcss );
if( i_ret < 0 )
return i_ret;
}
- dvdcss->i_status &= ~DVDCSS_STATUS_OPEN;
-
- return 0;
-}
-
-/*****************************************************************************
- * dvdcss_end: clean up the library
- *****************************************************************************/
-extern int dvdcss_end ( dvdcss_handle dvdcss )
-{
- if( dvdcss->i_status & DVDCSS_STATUS_OPEN )
- {
- _dvdcss_error( dvdcss, "a device is still open" );
- return -1;
- }
-
free( dvdcss );
return 0;
* private.h: private DVD reading library data
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: libdvdcss.h,v 1.1 2001/06/12 22:14:44 sam Exp $
+ * $Id: libdvdcss.h,v 1.2 2001/06/14 01:49:44 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
struct dvdcss_s
{
- /* Status */
- int i_status;
-
/* File descriptor */
int i_fd;
};
-/*****************************************************************************
- * Flags
- *****************************************************************************/
-#define DVDCSS_STATUS_NONE 0
-#define DVDCSS_STATUS_INIT 1 << 0
-#define DVDCSS_STATUS_OPEN 1 << 1
-
/*****************************************************************************
* Error management
*****************************************************************************/
* libdvdcss.h: DVD reading library, exported functions.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: dvdcss.h,v 1.1 2001/06/12 22:14:44 sam Exp $
+ * $Id: dvdcss.h,v 1.2 2001/06/14 01:49:44 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
-extern dvdcss_handle dvdcss_init ( int i_flags );
-extern int dvdcss_end ( dvdcss_handle );
-extern int dvdcss_open ( dvdcss_handle,
- char *psz_target );
+extern dvdcss_handle dvdcss_open ( char *psz_target,
+ int i_flags );
extern int dvdcss_close ( dvdcss_handle );
extern int dvdcss_crack ( dvdcss_handle,
int i_title,
/* Define if you have the setenv function. */
#undef HAVE_SETENV
+/* Define if you have the sigrelse function. */
+#undef HAVE_SIGRELSE
+
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define if you have the <cthreads.h> header file. */
#undef HAVE_CTHREADS_H
+/* Define if you have the <directx.h> header file. */
+#undef HAVE_DIRECTX_H
+
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define if you have the <videolan/dvdcss.h> header file. */
+#undef HAVE_VIDEOLAN_DVDCSS_H
+
+/* Define if you have the pth library (-lpth). */
+#undef HAVE_LIBPTH
+
/* long getopt support */
#undef HAVE_GETOPT_LONG
/* Define if <linux/cdrom.h> defines DVD_STRUCT. */
#undef DVD_STRUCT_IN_LINUX_CDROM_H
+/* Define if <pth.h> defines pth_init */
+#undef PTH_INIT_IN_PTH_H
+
/* Define if you want DVD CSS decryption. */
#undef HAVE_CSS
* This header provides a portable threads implementation.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: threads.h,v 1.17 2001/04/28 03:36:25 sam Exp $
+ * $Id: threads.h,v 1.18 2001/06/14 01:49:44 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
#include <stdio.h>
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H) /* pthreads (like Linux & BSD) */
-#include <pthread.h>
+#if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */
+# include <pth.h>
-#elif defined(HAVE_CTHREADS_H) /* GNUMach */
-#include <cthreads.h>
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */
+# include <pthread.h>
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) /* BeOS */
-#undef MAX
-#undef MIN
-#include <kernel/OS.h>
-#include <kernel/scheduler.h>
-#include <byteorder.h>
+#elif defined( HAVE_CTHREADS_H ) /* GNUMach */
+# include <cthreads.h>
-#elif defined(WIN32) /* Win32 with MinGW32 compiler */
-#include <windows.h>
-#include <process.h>
+#elif defined( HAVE_KERNEL_SCHEDULER_H ) /* BeOS */
+# undef MAX
+# undef MIN
+# include <kernel/OS.h>
+# include <kernel/scheduler.h>
+# include <byteorder.h>
+
+#elif defined( WIN32 ) /* Win32 with MinGW32 compiler */
+# include <windows.h>
+# include <process.h>
#else
-#error no threads available on your system !
+# error no threads available on your system !
+
#endif
/*****************************************************************************
* Types definition
*****************************************************************************/
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+typedef pth_t vlc_thread_t;
+typedef pth_mutex_t vlc_mutex_t;
+typedef pth_cond_t vlc_cond_t;
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
typedef pthread_t vlc_thread_t;
typedef pthread_mutex_t vlc_mutex_t;
typedef pthread_cond_t vlc_cond_t;
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
typedef cthread_t vlc_thread_t;
/* Those structs are the ones defined in /include/cthreads.h but we need
struct cond_imp *implications;
} vlc_cond_t;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
/* This is the BeOS implementation of the vlc threads, note that the mutex is
* not a real mutex and the cond_var is not like a pthread cond_var but it is
* enough for what wee need */
thread_id thread;
} vlc_cond_t;
-#elif defined(WIN32)
+#elif defined( WIN32 )
typedef HANDLE vlc_thread_t;
typedef HANDLE vlc_mutex_t;
typedef HANDLE vlc_cond_t;
*****************************************************************************/
static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
char *psz_name, vlc_thread_func_t func,
- void *p_data)
+ void *p_data )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ *p_thread = pth_spawn( PTH_ATTR_DEFAULT, func, p_data );
+ return ( p_thread == NULL );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_create( p_thread, NULL, func, p_data );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
*p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
*p_thread = spawn_thread( (thread_func)func, psz_name,
B_NORMAL_PRIORITY, p_data );
return resume_thread( *p_thread );
-#elif defined(WIN32)
+#elif defined( WIN32 )
#if 0
DWORD threadID;
/* This method is not recommended when using the MSVCRT C library,
*****************************************************************************/
static __inline__ void vlc_thread_exit( void )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ pth_exit( 0 );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_exit( 0 );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
int result;
cthread_exit( &result );
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
exit_thread( 0 );
-#elif defined(WIN32)
+#elif defined( WIN32 )
#if 0
ExitThread( 0 );
#endif
*****************************************************************************/
static __inline__ void vlc_thread_join( vlc_thread_t thread )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ pth_join( thread, NULL );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
pthread_join( thread, NULL );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
cthread_join( thread );
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
int32 exit_value;
wait_for_thread( thread, &exit_value );
-#elif defined(WIN32)
+#elif defined( WIN32 )
WaitForSingleObject( thread, INFINITE);
#endif
*****************************************************************************/
static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_mutex_init( p_mutex );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_init( p_mutex, NULL );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
mutex_init( p_mutex );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
/* check the arguments and whether it's already been initialized */
if( p_mutex == NULL )
p_mutex->init = 9999;
return B_OK;
-#elif defined(WIN32)
+#elif defined( WIN32 )
*p_mutex = CreateMutex(0,FALSE,0);
return (*p_mutex?0:1);
*****************************************************************************/
static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_mutex_acquire( p_mutex, TRUE, NULL );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_lock( p_mutex );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
mutex_lock( p_mutex );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
status_t err;
if( !p_mutex )
err = acquire_sem( p_mutex->lock );
return err;
-#elif defined(WIN32)
+#elif defined( WIN32 )
WaitForSingleObject( *p_mutex, INFINITE );
return 0;
*****************************************************************************/
static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_mutex_release( p_mutex );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_unlock( p_mutex );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
mutex_unlock( p_mutex );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_mutex)
{
return B_BAD_VALUE;
release_sem( p_mutex->lock );
return B_OK;
-#elif defined(WIN32)
+#elif defined( WIN32 )
ReleaseMutex( *p_mutex );
return 0;
*****************************************************************************/
static __inline__ int vlc_mutex_destroy( vlc_mutex_t *p_mutex )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return 0;
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_mutex_destroy( p_mutex );
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
if( p_mutex->init == 9999 )
{
delete_sem( p_mutex->lock );
p_mutex->init = 0;
return B_OK;
-#elif defined(WIN32)
+#elif defined( WIN32 )
CloseHandle(*p_mutex);
return 0;
*****************************************************************************/
static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_cond_init( p_condvar );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_init( p_condvar, NULL );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
/* condition_init() */
spin_lock_init( &p_condvar->lock );
cthread_queue_init( &p_condvar->queue );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar )
{
return B_BAD_VALUE;
p_condvar->init = 9999;
return 0;
-#elif defined(WIN32)
+#elif defined( WIN32 )
/* Create an auto-reset event. */
*p_condvar = CreateEvent( NULL, /* no security */
FALSE, /* auto-reset event */
*****************************************************************************/
static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_cond_notify( p_condvar, FALSE );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_signal( p_condvar );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
/* condition_signal() */
if ( p_condvar->queue.head || p_condvar->implications )
{
}
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar )
{
return B_BAD_VALUE;
}
return 0;
-#elif defined(WIN32)
+#elif defined( WIN32 )
/* Try to release one waiting thread. */
PulseEvent ( *p_condvar );
return 0;
*****************************************************************************/
static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return pth_cond_await( p_condvar, p_mutex, NULL );
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_wait( p_condvar, p_mutex );
-#elif defined(HAVE_CTHREADS_H)
+#elif defined( HAVE_CTHREADS_H )
condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
return 0;
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
if( !p_condvar )
{
return B_BAD_VALUE;
vlc_mutex_lock( p_mutex );
return 0;
-#elif defined(WIN32)
+#elif defined( WIN32 )
/* Release the <external_mutex> here and wait for the event
* to become signaled, due to <pthread_cond_signal> being
* called. */
*****************************************************************************/
static __inline__ int vlc_cond_destroy( vlc_cond_t *p_condvar )
{
-#if defined(PTHREAD_COND_T_IN_PTHREAD_H)
+#if defined( PTH_INIT_IN_PTH_H )
+ return 0;
+
+#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
return pthread_cond_destroy( p_condvar );
-#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
+#elif defined( HAVE_KERNEL_SCHEDULER_H )
p_condvar->init = 0;
return 0;
-#elif defined(WIN32)
+#elif defined( WIN32 )
CloseHandle( *p_condvar );
return 0;
* aout_directx.c: Windows DirectX audio output method
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: aout_directx.c,v 1.2 2001/06/03 12:47:21 sam Exp $
+ * $Id: aout_directx.c,v 1.3 2001/06/14 01:49:44 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#define MODULE_NAME directx
#include "modules_inner.h"
-/* The most important this to do for now is to fix the audio bug we've got
+/* The most important thing to do for now is to fix the audio bug we've got
* on startup: the audio will start later than the video (sometimes) and
* is trying to catching up with it.
* At first sight it seems to be a scheduling problem
* takes care of mixing all the
* secondary buffers into the primary) */
+ HINSTANCE hdsound_dll; /* handle of the opened dsound dll */
+
long l_buffer_size; /* secondary sound buffer size */
long l_write_position; /* next write position for the buffer */
static void aout_Close ( aout_thread_t *p_aout );
/* local function */
-static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout );
+static int DirectxCreateSecondaryBuffer( aout_thread_t *p_aout );
+static int DirectxInitDSound( aout_thread_t *p_aout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
-#if 0
HRESULT dsresult;
DSBUFFERDESC dsbuffer_desc;
WAVEFORMATEX waveformat;
-#endif
+
+ intf_WarnMsg( 3, "aout: DirectX aout_Open ");
/* Allocate structure */
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
AOUT_RATE_DEFAULT );
- /* Create the direct sound object */
- if( DirectSoundCreate(NULL, &p_aout->p_sys->p_dsobject, NULL) != DS_OK )
+ /* Initialise DirectSound */
+ if( DirectxInitDSound( p_aout ) )
{
- intf_WarnMsg( 3, "aout: can't create a direct sound device ");
- p_aout->p_sys->p_dsobject = NULL;
+ intf_WarnMsg( 3, "aout: can't initialise DirectSound ");
return( 1 );
}
- /* Set DirectSound Cooperative level, ie what control we want over Windows
- * sound device. In our case, DSSCL_EXCLUSIVE means that we can modify the
- * settings of the primary buffer, but also that only the sound of our
- * application will be hearable when it will have the focus.
- * !!! (this is not really working as intended yet because to set the
- * cooperative level you need the window handle of your application, and
- * I don't know of any easy way to get it. Especially since we might play
- * sound without any video, and so what window handle should we use ???
- * The hack for now is to use the Desktop window handle - it seems to be
- * working */
- if( IDirectSound_SetCooperativeLevel(p_aout->p_sys->p_dsobject,
- GetDesktopWindow(),
- DSSCL_EXCLUSIVE) )
- {
- intf_WarnMsg( 3, "aout: can't set direct sound cooperative level ");
- }
-
-#if 0
/* Obtain (not create) Direct Sound primary buffer */
memset( &dsbuffer_desc, 0, sizeof(DSBUFFERDESC) );
dsbuffer_desc.dwSize = sizeof(DSBUFFERDESC);
p_aout->p_sys->p_dsbuffer_primary = NULL;
return( 1 );
}
-#endif
-
- /* Now create the buffer that we'll actually use: the secondary buffer */
- if( windx_CreateSecondaryBuffer( p_aout ) )
- {
- intf_WarnMsg( 3, "aout: can't create direct sound secondary buffer ");
-#if 0
- IDirectSound_Release( p_aout->p_sys->p_dsbuffer_primary );
-#endif
- IDirectSound_Release( p_aout->p_sys->p_dsobject );
- p_aout->p_sys->p_dsobject = NULL;
- p_aout->p_sys->p_dsbuffer_primary = NULL;
- p_aout->p_sys->p_dsbuffer = NULL;
- return( 1 );
- }
return( 0 );
}
{
HRESULT dsresult;
+ intf_WarnMsg( 3, "aout: DirectX aout_SetFormat ");
+
/* first release the current secondary buffer */
if( p_aout->p_sys->p_dsbuffer != NULL )
{
}
/* then create a new secondary buffer */
- dsresult = windx_CreateSecondaryBuffer( p_aout );
+ dsresult = DirectxCreateSecondaryBuffer( p_aout );
if( dsresult != DS_OK )
{
- intf_WarnMsg( 3, "aout: WinDX aout_SetFormat cannot create buffer");
+ intf_WarnMsg( 3, "aout: DirectX aout_SetFormat cannot create buffer");
return( 1 );
}
}
if( dsresult != DS_OK )
{
- intf_WarnMsg( 3, "aout: WinDX aout_GetBufInfo cannot get current pos");
+ intf_WarnMsg(3,"aout: DirectX aout_GetBufInfo cannot get current pos");
return( l_buffer_limit );
}
- l_result = ((p_aout->p_sys->l_write_position >= l_play_position) ?
- (p_aout->p_sys->l_write_position - l_play_position)/2
- : (p_aout->p_sys->l_buffer_size - l_play_position
- + p_aout->p_sys->l_write_position)/2 );
+ /* temporary hack. When you start playing a new file, the play position
+ * doesn't start changing immediatly, even though sound is already
+ * playing from the sound card */
+ if( l_play_position == 0 )
+ {
+ intf_WarnMsg( 5, "aout: DirectX aout_GetBufInfo: %li", l_buffer_limit);
+ return( l_buffer_limit );
+ }
+
+ l_result = (p_aout->p_sys->l_write_position >= l_play_position) ?
+ (p_aout->p_sys->l_write_position - l_play_position) /2
+ : (p_aout->p_sys->l_buffer_size - l_play_position
+ + p_aout->p_sys->l_write_position) /2 ;
- intf_WarnMsg( 5, "aout: WinDX aout_GetBufInfo: %li", l_result);
+ intf_WarnMsg( 5, "aout: DirectX aout_GetBufInfo: %li", l_result);
return l_result;
}
long l_play_position, l_notused, l_buffer_free_length;
HRESULT dsresult;
- /* We want to copy data to the circular sound buffer, so first we need to
+ /* We want to copy data to the circular sound buffer, so we first need to
* find out were in the buffer we can write our data */
dsresult = IDirectSoundBuffer_GetCurrentPosition(p_aout->p_sys->p_dsbuffer,
&l_play_position,
}
if( dsresult != DS_OK )
{
- intf_WarnMsg( 3, "aout: WinDX aout_Play can'get buffer position");
+ intf_WarnMsg( 3, "aout: DirectX aout_Play can'get buffer position");
}
/* check that we are not overflowing the circular buffer (everything should
* be alright but just in case) */
l_buffer_free_length = l_play_position - p_aout->p_sys->l_write_position;
if( l_buffer_free_length <= 0 )
- l_buffer_free_length += p_aout->p_sys->l_buffer_size ;
+ l_buffer_free_length += p_aout->p_sys->l_buffer_size;
if( i_size > l_buffer_free_length )
{
- intf_WarnMsg( 3, "aout: WinDX aout_Play buffer overflow: size %i, free %i !!!", i_size, l_buffer_free_length);
- intf_WarnMsg( 3, "aout: WinDX aout_Play buffer overflow: writepos %i, readpos %i !!!", l_play_position, p_aout->p_sys->l_write_position);
+ intf_WarnMsg( 3, "aout: DirectX aout_Play buffer overflow: size %i, free %i !!!", i_size, l_buffer_free_length);
+ intf_WarnMsg( 3, "aout: DirectX aout_Play buffer overflow: writepos %i, readpos %i !!!", p_aout->p_sys->l_write_position, l_play_position);
/*i_size = l_buffer_free_length;*/
+
+ /* Update the write pointer */
+ p_aout->p_sys->l_write_position = l_notused;
+
+ }
+ else
+ {
+ intf_WarnMsg( 4, "aout: DirectX aout_Play buffer: size %i, free %i !!!"
+ , i_size, l_buffer_free_length);
+ intf_WarnMsg( 4, "aout: DirectX aout_Play buffer: writepos %i, readpos %i !!!", p_aout->p_sys->l_write_position, l_play_position);
+
}
/* Before copying anything, we have to lock the buffer */
}
if( dsresult != DS_OK )
{
- intf_WarnMsg( 3, "aout: WinDX aout_Play can't lock buffer");
+ intf_WarnMsg( 3, "aout: DirectX aout_Play can't lock buffer");
return;
}
}
if( dsresult != DS_OK )
{
- intf_WarnMsg( 3, "aout: WinDX aout_Play can't play buffer");
+ intf_WarnMsg( 3, "aout: DirectX aout_Play can't play buffer");
return;
}
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
{
+
+ intf_WarnMsg( 3, "aout: DirectX aout_Close ");
+
/* make sure the buffer isn't playing */
if( p_aout->p_sys->p_dsbuffer != NULL )
{
p_aout->p_sys->p_dsobject = NULL;
}
+ /* free DSOUND.DLL */
+ if( p_aout->p_sys->hdsound_dll != NULL )
+ {
+ FreeLibrary( p_aout->p_sys->hdsound_dll );
+ p_aout->p_sys->hdsound_dll = NULL;
+ }
+
/* Close the Output. */
if ( p_aout->p_sys != NULL )
{
}
/*****************************************************************************
- * windx_CreateSecondaryBuffer
+ * DirectxInitDSound
+ *****************************************************************************
+ *****************************************************************************/
+static int DirectxInitDSound( aout_thread_t *p_aout )
+{
+ HRESULT (WINAPI *OurDirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
+
+ p_aout->p_sys->hdsound_dll = LoadLibrary("DSOUND.DLL");
+ if( p_aout->p_sys->hdsound_dll == NULL )
+ {
+ intf_WarnMsg( 3, "aout: can't open DSOUND.DLL ");
+ return( 1 );
+ }
+
+ OurDirectSoundCreate = (void *)GetProcAddress( p_aout->p_sys->hdsound_dll,
+ "DirectSoundCreate" );
+
+ if( OurDirectSoundCreate == NULL )
+ {
+ intf_WarnMsg( 3, "aout: GetProcAddress FAILED ");
+ FreeLibrary( p_aout->p_sys->hdsound_dll );
+ p_aout->p_sys->hdsound_dll = NULL;
+ return( 1 );
+ }
+
+ /* Create the direct sound object */
+ if( OurDirectSoundCreate(NULL, &p_aout->p_sys->p_dsobject, NULL) != DS_OK )
+ {
+ intf_WarnMsg( 3, "aout: can't create a direct sound device ");
+ p_aout->p_sys->p_dsobject = NULL;
+ FreeLibrary( p_aout->p_sys->hdsound_dll );
+ p_aout->p_sys->hdsound_dll = NULL;
+ return( 1 );
+ }
+
+ /* Set DirectSound Cooperative level, ie what control we want over Windows
+ * sound device. In our case, DSSCL_EXCLUSIVE means that we can modify the
+ * settings of the primary buffer, but also that only the sound of our
+ * application will be hearable when it will have the focus.
+ * !!! (this is not really working as intended yet because to set the
+ * cooperative level you need the window handle of your application, and
+ * I don't know of any easy way to get it. Especially since we might play
+ * sound without any video, and so what window handle should we use ???
+ * The hack for now is to use the Desktop window handle - it seems to be
+ * working */
+ if( IDirectSound_SetCooperativeLevel(p_aout->p_sys->p_dsobject,
+ GetDesktopWindow(),
+ DSSCL_EXCLUSIVE) )
+ {
+ intf_WarnMsg( 3, "aout: can't set direct sound cooperative level ");
+ }
+
+ return( 0 );
+}
+
+/*****************************************************************************
+ * DirectxCreateSecondaryBuffer
*****************************************************************************
* This function creates the buffer we'll use to play audio.
* In DirectSound there are two kinds of buffers:
* Once you create a secondary buffer, you cannot change its format anymore so
* you have to release the current and create another one.
*****************************************************************************/
-static int windx_CreateSecondaryBuffer( aout_thread_t *p_aout )
+static int DirectxCreateSecondaryBuffer( aout_thread_t *p_aout )
{
WAVEFORMATEX waveformat;
DSBUFFERDESC dsbdesc;
dsbdesc.dwSize = sizeof(DSBUFFERDESC);
dsbdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2/* Better position accuracy */
| DSBCAPS_GLOBALFOCUS; /* Allows background playing */
- /* | DSBCAPS_CTRLPAN
- | DSBCAPS_CTRLVOLUME
- | DSBCAPS_CTRLFREQUENCY;
- */
dsbdesc.dwBufferBytes = waveformat.nAvgBytesPerSec * 4; /* 4 sec buffer */
dsbdesc.lpwfxFormat = &waveformat;
/* backup the size of the secondary sound buffer */
memset(&dsbcaps, 0, sizeof(DSBCAPS));
- dsbcaps.dwSize = sizeof(DSBCAPS);
+ dsbcaps.dwSize = sizeof(DSBCAPS);
IDirectSoundBuffer_GetCaps( p_aout->p_sys->p_dsbuffer, &dsbcaps );
p_aout->p_sys->l_buffer_size = dsbcaps.dwBufferBytes;
p_aout->p_sys->l_write_position = 0;
- intf_WarnMsg( 3, "aout: WinDX WinDX_CreateSecondaryBuffer: %li",
+ intf_WarnMsg( 3, "aout: DirectX DirectxCreateSecondaryBuffer: %li",
p_aout->p_sys->l_buffer_size);
- /* make sure the buffer isn't playing */
- IDirectSoundBuffer_Stop( p_aout->p_sys->p_dsbuffer );
-
- /* reset play position, just to be sure (and after some tests it seems
- * indeed necessary */
- dsresult = IDirectSoundBuffer_SetCurrentPosition(p_aout->p_sys->p_dsbuffer,
- 0 );
- if( dsresult == DSERR_BUFFERLOST )
- {
- IDirectSoundBuffer_Restore( p_aout->p_sys->p_dsbuffer );
- dsresult = IDirectSoundBuffer_SetCurrentPosition(
- p_aout->p_sys->p_dsbuffer,
- 0 );
- }
- if( dsresult != DS_OK )
- {
- intf_WarnMsg( 3, "aout: WinDX CreateSecondary cannot wet current pos");
- }
-
return( 0 );
}
-
* vout_directx.c: Windows DirectX video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vout_directx.c,v 1.3 2001/06/08 20:03:15 sam Exp $
+ * $Id: vout_directx.c,v 1.4 2001/06/14 01:49:44 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
typedef struct vout_sys_s
{
- LPDIRECTDRAW p_ddobject; /* DirectDraw object */
- LPDIRECTDRAWSURFACE p_display; /* display device */
- LPDIRECTDRAWSURFACE p_overlay; /* overlay device */
- LPDIRECTDRAWCLIPPER p_clipper; /* clipper */
+ LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */
+ LPDIRECTDRAWSURFACE3 p_display; /* Display device */
+ LPDIRECTDRAWSURFACE3 p_surface; /* surface where we display the video */
+ LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */
+ HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */
HBRUSH hbrush; /* window backgound brush (color) */
HWND hwnd; /* Handle of the main window */
boolean_t b_cursor_autohidden;
mtime_t i_lastmoved;
- char *p_windx_buf[2]; /* Buffer information */
+ char *p_directx_buf[2]; /* Buffer information */
} vout_sys_t;
static void vout_SetPalette( p_vout_thread_t p_vout, u16 *red, u16 *green,
u16 *blue, u16 *transp );
-static int WinDXCreateWindow ( vout_thread_t *p_vout );
-static int WinDXInitDDraw ( vout_thread_t *p_vout );
-static int WinDXCreateDisplay ( vout_thread_t *p_vout );
-static int WinDXCreateYUVOverlay ( vout_thread_t *p_vout );
-static int WinDXUpdateOverlay ( vout_thread_t *p_vout );
-static void WinDXCloseDDraw ( vout_thread_t *p_vout );
-static void WinDXCloseWindow ( vout_thread_t *p_vout );
-static void WinDXCloseDisplay ( vout_thread_t *p_vout );
-static void WinDXCloseYUVOverlay ( vout_thread_t *p_vout );
+static int DirectXCreateWindow ( vout_thread_t *p_vout );
+static int DirectXInitDDraw ( vout_thread_t *p_vout );
+static int DirectXCreateDisplay ( vout_thread_t *p_vout );
+static int DirectXCreateSurface ( vout_thread_t *p_vout );
+static int DirectXCreateClipper ( vout_thread_t *p_vout );
+static int DirectXUpdateOverlay ( vout_thread_t *p_vout );
+static void DirectXCloseDDraw ( vout_thread_t *p_vout );
+static void DirectXCloseWindow ( vout_thread_t *p_vout );
+static void DirectXCloseDisplay ( vout_thread_t *p_vout );
+static void DirectXCloseSurface ( vout_thread_t *p_vout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
+
if( TestMethod( VOUT_METHOD_VAR, "directx" ) )
{
return( 999 );
}
+ /* Check that at least DirectX5 is installed on the computer */
+ /* Fixme */
+
return( 400 );
}
/* Initialisations */
p_vout->p_sys->p_ddobject = NULL;
p_vout->p_sys->p_display = NULL;
- p_vout->p_sys->p_overlay = NULL;
+ p_vout->p_sys->p_surface = NULL;
p_vout->p_sys->p_clipper = NULL;
- p_vout->p_sys->hbrush = INVALID_HANDLE_VALUE;
- p_vout->p_sys->hwnd = INVALID_HANDLE_VALUE;
+ p_vout->p_sys->hbrush = NULL;
+ p_vout->p_sys->hwnd = NULL;
+ p_vout->p_sys->b_display_enabled = 0;
+ p_vout->b_need_render = 0; /* by default try an YUV overlay display */
p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */
p_vout->p_sys->b_cursor_autohidden = 0;
- p_vout->p_sys->b_display_enabled = 0;
p_vout->p_sys->i_lastmoved = mdate();
p_vout->b_fullscreen = main_GetIntVariable( VOUT_FULLSCREEN_VAR,
/* Create a window for the video */
/* Creating a window under Windows also initializes the thread's event
* message qeue */
- if( WinDXCreateWindow( p_vout ) )
+ if( DirectXCreateWindow( p_vout ) )
{
intf_ErrMsg( "vout error: can't create window" );
free( p_vout->p_sys );
}
/* Initialise DirectDraw */
- if( WinDXInitDDraw( p_vout ) )
+ if( DirectXInitDDraw( p_vout ) )
{
intf_ErrMsg( "vout error: can't initialise DirectDraw" );
- WinDXCloseWindow( p_vout );
+ DirectXCloseWindow( p_vout );
free( p_vout->p_sys );
return ( 1 );
}
- /* create the directx display */
- if( WinDXCreateDisplay( p_vout ) )
+ /* Create the directx display */
+ if( DirectXCreateDisplay( p_vout ) )
{
intf_ErrMsg( "vout error: can't initialise DirectDraw" );
- WinDXCloseDDraw( p_vout );
- WinDXCloseWindow( p_vout );
+ DirectXCloseDDraw( p_vout );
+ DirectXCloseWindow( p_vout );
free( p_vout->p_sys );
return ( 1 );
}
static void vout_Destroy( vout_thread_t *p_vout )
{
intf_WarnMsg( 3, "vout: vout_Destroy" );
- WinDXCloseDisplay( p_vout );
- WinDXCloseDDraw( p_vout );
- WinDXCloseWindow( p_vout );
+ DirectXCloseDisplay( p_vout );
+ DirectXCloseDDraw( p_vout );
+ DirectXCloseWindow( p_vout );
if( p_vout->p_sys != NULL )
{
{
case WM_CLOSE:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_CLOSE" );
+ intf_WarnMsg( 4, "vout: vout_Manage WM_CLOSE" );
p_vout->b_die = 1;
break;
case WM_QUIT:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_QUIT" );
+ intf_WarnMsg( 4, "vout: vout_Manage WM_QUIT" );
p_main->p_intf->b_die = 1;
break;
case WM_MOVE:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_MOVE" );
+ intf_WarnMsg( 3, "vout: vout_Manage WM_MOVE" );
if( !p_vout->b_need_render )
{
p_vout->i_changes |= VOUT_SIZE_CHANGE;
break;
case WM_APP:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_APP" );
+ intf_WarnMsg( 3, "vout: vout_Manage WM_APP" );
if( !p_vout->b_need_render )
{
p_vout->i_changes |= VOUT_SIZE_CHANGE;
break;
case WM_PAINT:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_PAINT" );
+ intf_WarnMsg( 4, "vout: vout_Manage WM_PAINT" );
break;
case WM_ERASEBKGND:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_ERASEBKGND" );
+ intf_WarnMsg( 4, "vout: vout_Manage WM_ERASEBKGND" );
break;
case WM_MOUSEMOVE:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_MOUSEMOVE" );
+ intf_WarnMsg( 4, "vout: vout_Manage WM_MOUSEMOVE" );
if( p_vout->p_sys->b_cursor )
{
- if( p_vout->p_sys->b_cursor_autohidden )
+ if( p_vout->p_sys->b_cursor_autohidden )
{
p_vout->p_sys->b_cursor_autohidden = 0;
p_vout->p_sys->i_lastmoved = mdate();
/* the key events are first processed here. The next
* message processed by this main message loop will be the
* char translation of the key event */
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_KEYDOWN" );
+ intf_WarnMsg( 3, "vout: vout_Manage WM_KEYDOWN" );
switch( msg.wParam )
{
case VK_ESCAPE:
break;
case WM_CHAR:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM_CHAR" );
+ intf_WarnMsg( 3, "vout: vout_Manage WM_CHAR" );
switch( msg.wParam )
{
case 'q':
p_main->p_intf->b_die = 1;
break;
- case 'f':
+ case 'f': /* switch to fullscreen */
case 'F':
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
+ case 'y': /* switch to hard YUV */
+ case 'Y':
+ p_vout->i_changes |= VOUT_YUV_CHANGE;
+ break;
+
+ case 'c': /* toggle grayscale */
+ case 'C':
+ p_vout->b_grayscale = ! p_vout->b_grayscale;
+ p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
+ break;
+
+ case 'i': /* toggle info */
+ case 'I':
+ p_vout->b_info = ! p_vout->b_info;
+ p_vout->i_changes |= VOUT_INFO_CHANGE;
+ break;
+
+ case 's': /* toggle scaling */
+ case 'S':
+ p_vout->b_scale = ! p_vout->b_scale;
+ p_vout->i_changes |= VOUT_SCALE_CHANGE;
+ break;
+
+ case ' ': /* toggle interface */
+ p_vout->b_interface = ! p_vout->b_interface;
+ p_vout->i_changes |= VOUT_INTF_CHANGE;
+ break;
+
case '0': network_ChannelJoin( 0 ); break;
case '1': network_ChannelJoin( 1 ); break;
case '2': network_ChannelJoin( 2 ); break;
}
default:
- intf_WarnMsg( 3, "vout: WinDX vout_Manage WM Default %i",
+ intf_WarnMsg( 4, "vout: vout_Manage WM Default %i",
msg.message );
break;
}
}
+ /*
+ * Scale Change
+ */
+ if( p_vout->i_changes & VOUT_SCALE_CHANGE )
+ {
+ intf_WarnMsg( 3, "vout: vout_Manage Scale Change" );
+ DirectXUpdateOverlay( p_vout );
+ p_vout->i_changes &= ~VOUT_SCALE_CHANGE;
+ }
+
/*
* Size Change
*/
if( p_vout->i_changes & VOUT_SIZE_CHANGE )
{
- intf_WarnMsg( 3, "vout: WinDX vout_Manage Size Change" );
- WinDXUpdateOverlay( p_vout );
+ intf_WarnMsg( 3, "vout: vout_Manage Size Change" );
+ DirectXUpdateOverlay( p_vout );
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
}
+ /*
+ * YUV Change
+ */
+ if( p_vout->i_changes & VOUT_YUV_CHANGE )
+ {
+ p_vout->b_need_render = ! p_vout->b_need_render;
+
+ /* Need to reopen display */
+ DirectXCloseSurface( p_vout );
+ if( DirectXCreateSurface( p_vout ) )
+ {
+ intf_ErrMsg( "error: can't reopen display after YUV change" );
+ return( 1 );
+ }
+
+ /* Repaint the window background (needed by the overlay surface) */
+ if( !p_vout->b_need_render )
+ {
+ InvalidateRect( p_vout->p_sys->hwnd, NULL, TRUE );
+ p_vout->p_sys->b_display_enabled = 1;
+ DirectXUpdateOverlay( p_vout );
+ }
+
+ p_vout->i_changes &= ~VOUT_YUV_CHANGE;
+ }
+
/*
* Fullscreen change
*/
}
SetWindowPlacement( p_vout->p_sys->hwnd, &window_placement );
- /*WinDXUpdateOverlay( p_vout );*/
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
}
* Pointer change
*/
if( ! p_vout->p_sys->b_cursor_autohidden &&
- ( mdate() - p_vout->p_sys->i_lastmoved > 2000000 ) )
+ ( mdate() - p_vout->p_sys->i_lastmoved > 5000000 ) )
{
/* Hide the mouse automatically */
p_vout->p_sys->b_cursor_autohidden = 1;
DDSURFACEDESC ddsd;
HRESULT dxresult;
int i;
- int i_image_width = p_vout->p_rendered_pic->i_width;
- int i_image_height = p_vout->p_rendered_pic->i_height;
+ int i_image_width;
+ int i_image_height;
+ intf_WarnMsg( 5, "vout: vout_Display" );
+
if( (p_vout->p_sys->p_display == NULL) )
{
- intf_WarnMsg( 3, "vout error: WinDX no display!!" );
+ intf_WarnMsg( 3, "vout error: vout_Display no display!!" );
return;
}
/* The first time this function is called it enables the display */
p_vout->p_sys->b_display_enabled = 1;
+ /* if the size of the decoded pictures has changed then we close the
+ * video surface (which doesn't have the right size anymore). */
+ i_image_width = ( p_vout->p_rendered_pic ) ?
+ p_vout->p_rendered_pic->i_width : p_vout->p_sys->i_image_width;
+ i_image_height = ( p_vout->p_rendered_pic ) ?
+ p_vout->p_rendered_pic->i_height : p_vout->p_sys->i_image_height;
+
+ if( p_vout->p_sys->i_image_width != i_image_width
+ || p_vout->p_sys->i_image_height != i_image_height )
+ {
+ intf_WarnMsg( 3, "vout: video surface size changed" );
+ p_vout->p_sys->i_image_width = i_image_width;
+ p_vout->p_sys->i_image_height = i_image_height;
+ DirectXCloseSurface( p_vout );
+ }
+
if( p_vout->b_need_render )
{
+ RECT rect_window;
+ POINT point_window;
+
/* Nothing yet */
+ if( p_vout->p_sys->p_surface == NULL )
+ {
+ intf_WarnMsg( 3, "vout: no video surface, open one..." );
+ if( DirectXCreateSurface( p_vout ) )
+ {
+ intf_WarnMsg( 3, "vout: cannot open a new video surface !!" );
+ return;
+ }
+ /* Display the surface */
+ p_vout->p_sys->b_display_enabled = 1;
+ }
+
+ /* Now get the coordinates of the window. We don't actually want the
+ * window coordinates but these of the usable surface inside the window
+ * By specification GetClientRect will always set rect_window.left and
+ * rect_window.top to 0 because the Client area is always relative to
+ * the container window */
+ GetClientRect(p_vout->p_sys->hwnd, &rect_window);
+
+ point_window.x = 0;
+ point_window.y = 0;
+ ClientToScreen(p_vout->p_sys->hwnd, &point_window);
+ rect_window.left = point_window.x;
+ rect_window.top = point_window.y;
+
+ point_window.x = rect_window.right;
+ point_window.y = rect_window.bottom;
+ ClientToScreen(p_vout->p_sys->hwnd, &point_window);
+ rect_window.right = point_window.x;
+ rect_window.bottom = point_window.y;
+
+ /* Blit video surface to display */
+ dxresult = IDirectDrawSurface3_Blt(p_vout->p_sys->p_display,
+ &rect_window,
+ p_vout->p_sys->p_surface,
+ NULL,
+ 0, NULL );
+ if( dxresult != DD_OK )
+ {
+ intf_WarnMsg( 3, "vout: could not Blit the surface" );
+ return;
+ }
+
}
else
{
*/
/* TODO: support for streams other than 4:2:0 */
- /* if the size of the decoded pictures has changed then we close the
- * YUVOverlay (which doesn't have the right size anymore). */
- if( p_vout->p_sys->i_image_width != i_image_width
- || p_vout->p_sys->i_image_height != i_image_height )
- {
- intf_WarnMsg( 3, "vout: WinDX overlay size changed" );
- p_vout->p_sys->i_image_width = i_image_width;
- p_vout->p_sys->i_image_height = i_image_height;
- WinDXCloseYUVOverlay( p_vout );
- }
-
- if( p_vout->p_sys->p_overlay == NULL )
+ if( p_vout->p_sys->p_surface == NULL )
{
- intf_WarnMsg( 3, "vout: WinDX no overlay, open one..." );
- if( WinDXCreateYUVOverlay( p_vout ) )
+ intf_WarnMsg( 3, "vout: no video surface, open one..." );
+ if( DirectXCreateSurface( p_vout ) )
{
- intf_WarnMsg( 3, "vout: WinDX cannot open a new overlay !!" );
+ intf_WarnMsg( 3, "vout: cannot open a new video surface !!" );
return;
}
/* Display the Overlay */
p_vout->p_sys->b_display_enabled = 1;
- WinDXUpdateOverlay( p_vout );
+ DirectXUpdateOverlay( p_vout );
}
/* Lock the overlay surface */
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
- dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_overlay, NULL,
- &ddsd, DDLOCK_NOSYSLOCK, NULL);
+ dxresult = IDirectDrawSurface3_Lock(p_vout->p_sys->p_surface, NULL,
+ &ddsd, DDLOCK_NOSYSLOCK, NULL);
if ( dxresult == DDERR_SURFACELOST )
{
/* Your surface can be lost (thanks to windows) so be sure
* to check this and restore it if needed */
- dxresult = IDirectDrawSurface_Restore( p_vout->p_sys->p_overlay );
- dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_overlay,
- NULL, &ddsd, DDLOCK_NOSYSLOCK
- | DDLOCK_WAIT, NULL);
+ dxresult = IDirectDrawSurface3_Restore( p_vout->p_sys->p_surface );
+ dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface,
+ NULL, &ddsd, DDLOCK_NOSYSLOCK
+ | DDLOCK_WAIT, NULL);
}
if( dxresult != DD_OK )
{
- intf_WarnMsg( 3, "vout: WinDX could not lock the surface" );
+ intf_WarnMsg( 3, "vout: could not lock the surface" );
return;
}
}
/* Unlock the Surface */
- dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_overlay,
- ddsd.lpSurface );
+ dxresult = IDirectDrawSurface3_Unlock(p_vout->p_sys->p_surface,
+ ddsd.lpSurface );
}
/*****************************************************************************
- * WinDXEventProc: This is the window event processing function.
+ * DirectXEventProc: This is the window event processing function.
*****************************************************************************
* On Windows, when you create a window you have to attach an event processing
* function to it. The aim of this function is to manage "Queued Messages" and
* Nonqueued Messages are those that Windows will send directly to this
* function (like WM_DESTROY, WM_WINDOWPOSCHANGED...)
*****************************************************************************/
-long FAR PASCAL WinDXEventProc( HWND hwnd, UINT message,
- WPARAM wParam, LPARAM lParam )
+long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
+ WPARAM wParam, LPARAM lParam )
{
switch( message )
{
+#if 0
case WM_ACTIVATE:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_ACTIVED" );
+ intf_WarnMsg( 4, "vout: WinProc WM_ACTIVED" );
break;
case WM_CREATE:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_CREATE" );
+ intf_WarnMsg( 4, "vout: WinProc WM_CREATE" );
break;
/* the user wants to close the window */
case WM_CLOSE:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_CLOSE" );
+ intf_WarnMsg( 4, "vout: WinProc WM_CLOSE" );
break;
+#endif
/* the window has been closed so shut down everything now */
case WM_DESTROY:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_DESTROY" );
+ intf_WarnMsg( 4, "vout: WinProc WM_DESTROY" );
PostQuitMessage( 0 );
break;
{
case SC_SCREENSAVE: /* catch the screensaver */
case SC_MONITORPOWER: /* catch the monitor turn-off */
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_SYSCOMMAND" );
+ intf_WarnMsg( 3, "vout: WinProc WM_SYSCOMMAND" );
return 0; /* this stops them from happening */
}
break;
+#if 0
case WM_MOVE:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_MOVE" );
+ intf_WarnMsg( 4, "vout: WinProc WM_MOVE" );
break;
case WM_SIZE:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_SIZE" );
+ intf_WarnMsg( 4, "vout: WinProc WM_SIZE" );
break;
case WM_MOVING:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_MOVING" );
+ intf_WarnMsg( 4, "vout: WinProc WM_MOVING" );
break;
case WM_SIZING:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_SIZING" );
+ intf_WarnMsg( 4, "vout: WinProc WM_SIZING" );
break;
+#endif
case WM_WINDOWPOSCHANGED:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_WINDOWPOSCHANGED" );
+ intf_WarnMsg( 3, "vout: WinProc WM_WINDOWPOSCHANGED" );
PostMessage( NULL, WM_APP, 0, 0);
break;
+#if 0
case WM_WINDOWPOSCHANGING:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_WINDOWPOSCHANGING" );
+ intf_WarnMsg( 3, "vout: WinProc WM_WINDOWPOSCHANGING" );
break;
case WM_PAINT:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_PAINT" );
+ intf_WarnMsg( 4, "vout: WinProc WM_PAINT" );
break;
case WM_ERASEBKGND:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM_ERASEBKGND" );
+ intf_WarnMsg( 4, "vout: WinProc WM_ERASEBKGND" );
break;
default:
- intf_WarnMsg( 3, "vout: WinDX WinProc WM Default %i", message );
+ intf_WarnMsg( 4, "vout: WinProc WM Default %i", message );
break;
+#endif
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
/*****************************************************************************
- * WinDXCreateWindow: create a windows window where the video will play.
+ * DirectXCreateWindow: create a windows window where the video will play.
*****************************************************************************
* Before creating a direct draw surface, we need to create a window in which
* the video will be displayed. This window will also allow us to capture the
* events.
*****************************************************************************/
-static int WinDXCreateWindow( vout_thread_t *p_vout )
+static int DirectXCreateWindow( vout_thread_t *p_vout )
{
HINSTANCE hInstance;
WNDCLASS wc; /* window class components */
if( colorkey == GetNearestColor( hdc, colorkey ) )
break;
}
- intf_WarnMsg( 3, "vout: WinDXCreateWindow background color:%i", colorkey );
+ intf_WarnMsg(3,"vout: DirectXCreateWindow background color:%i", colorkey);
ReleaseDC( p_vout->p_sys->hwnd, hdc );
/* create the actual brush */
/* fill in the window class structure */
wc.style = 0; /* no special styles */
- wc.lpfnWndProc = (WNDPROC)WinDXEventProc; /* event handler */
+ wc.lpfnWndProc = (WNDPROC)DirectXEventProc; /* event handler */
wc.cbClsExtra = 0; /* no extra class data */
wc.cbWndExtra = 0; /* no extra window data */
wc.hInstance = hInstance; /* instance */
/* register the window class */
if (!RegisterClass(&wc)) {
- intf_WarnMsg( 3, "vout: WinDX register window FAILED" );
+ intf_WarnMsg( 3, "vout: DirectXCreateWindow register window FAILED" );
return (1);
}
NULL); /* no additional arguments */
if (p_vout->p_sys->hwnd == NULL) {
- intf_WarnMsg( 3, "vout: WinDX create window FAILED" );
+ intf_WarnMsg( 3, "vout: DirectXCreateWindow create window FAILED" );
return (1);
}
}
/*****************************************************************************
- * WinDXInitDDraw: Takes care of all the DirectDraw initialisations
+ * DirectXInitDDraw: Takes care of all the DirectDraw initialisations
*****************************************************************************
* This function initialise and allocate resources for DirectDraw.
*****************************************************************************/
-static int WinDXInitDDraw( vout_thread_t *p_vout )
+static int DirectXInitDDraw( vout_thread_t *p_vout )
{
- HRESULT dxresult;
- DWORD flags;
+ HRESULT dxresult;
+ HRESULT (WINAPI *OurDirectDrawCreate)(GUID *,LPDIRECTDRAW *,IUnknown *);
+ LPDIRECTDRAW p_ddobject;
- intf_WarnMsg( 3, "vout: WinDX WinDXInitDDraw" );
+ intf_WarnMsg( 3, "vout: DirectXInitDDraw" );
- /* Initialize DirectDraw */
- dxresult = DirectDrawCreate( NULL, &p_vout->p_sys->p_ddobject, NULL );
- if( dxresult != DD_OK )
+ /* load direct draw DLL */
+ p_vout->p_sys->hddraw_dll = LoadLibrary("DDRAW.DLL");
+ if( p_vout->p_sys->hddraw_dll == NULL )
{
- intf_ErrMsg( "vout error: can't initialize Direct Draw" );
+ intf_WarnMsg( 3, "vout: DirectXInitDDraw failed loading ddraw.dll" );
return( 1 );
}
-
- /* Set DirectDraw Cooperative level, ie what control we want over Windows
- display */
- if( p_vout->b_fullscreen )
+
+ OurDirectDrawCreate =
+ (void *)GetProcAddress(p_vout->p_sys->hddraw_dll, "DirectDrawCreate");
+ if ( OurDirectDrawCreate == NULL )
{
- flags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN;
+ intf_ErrMsg( "vout error: DirectXInitDDraw failed GetProcAddress" );
+ FreeLibrary( p_vout->p_sys->hddraw_dll );
+ p_vout->p_sys->hddraw_dll = NULL;
+ return( 1 );
}
- else
+
+ /* Initialize DirectDraw now */
+ dxresult = OurDirectDrawCreate( NULL, &p_ddobject, NULL );
+ if( dxresult != DD_OK )
{
- flags = DDSCL_NORMAL;
+ intf_ErrMsg( "vout error: DirectXInitDDraw can't initialize DDraw" );
+ p_vout->p_sys->p_ddobject = NULL;
+ FreeLibrary( p_vout->p_sys->hddraw_dll );
+ p_vout->p_sys->hddraw_dll = NULL;
+ return( 1 );
}
- dxresult = IDirectDraw_SetCooperativeLevel( p_vout->p_sys->p_ddobject,
- p_vout->p_sys->hwnd, flags );
+ /* Set DirectDraw Cooperative level, ie what control we want over Windows
+ * display */
+ dxresult = IDirectDraw_SetCooperativeLevel( p_ddobject,
+ p_vout->p_sys->hwnd, DDSCL_NORMAL );
if( dxresult != DD_OK )
{
intf_ErrMsg( "vout error: can't set direct draw cooperative level." );
- IDirectDraw_Release(p_vout->p_sys->p_ddobject);
+ IDirectDraw_Release( p_ddobject );
p_vout->p_sys->p_ddobject = NULL;
+ FreeLibrary( p_vout->p_sys->hddraw_dll );
+ p_vout->p_sys->hddraw_dll = NULL;
return( 1 );
}
+ /* Get the IDirectDraw2 interface */
+ dxresult = IDirectDraw_QueryInterface( p_ddobject, &IID_IDirectDraw2,
+ (LPVOID *)&p_vout->p_sys->p_ddobject );
+ if( dxresult != DD_OK )
+ {
+ intf_ErrMsg( "vout error: can't get IDirectDraw2 interface." );
+ IDirectDraw_Release( p_ddobject );
+ p_vout->p_sys->p_ddobject = NULL;
+ FreeLibrary( p_vout->p_sys->hddraw_dll );
+ p_vout->p_sys->hddraw_dll = NULL;
+ return( 1 );
+ }
+ else
+ {
+ /* Release the unused interface */
+ IDirectDraw_Release( p_ddobject );
+ }
+
return( 0 );
}
/*****************************************************************************
- * WinDXCreateDisplay: create the DirectDraw display.
+ * DirectXCreateDisplay: create the DirectDraw display.
*****************************************************************************
* Create and initialize display according to preferences specified in the vout
* thread fields.
*****************************************************************************/
-static int WinDXCreateDisplay( vout_thread_t *p_vout )
+static int DirectXCreateDisplay( vout_thread_t *p_vout )
{
- DDCAPS ddcaps;
- HRESULT dxresult;
- DDSURFACEDESC ddsd;
- BOOL bHasOverlay, bHasColorKey, bCanStretch;
+ HRESULT dxresult;
+ DDSURFACEDESC ddsd;
+ LPDIRECTDRAWSURFACE p_display;
+ DDPIXELFORMAT ddpfPixelFormat;
+
+ intf_WarnMsg( 3, "vout: DirectXCreateDisplay" );
- /* Now create the primary surface. This surface is the displayed surface */
- /* The following two steps are important! */
+ /* Now create the primary surface. This surface is what you actually see
+ * on your screen */
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
- dxresult = IDirectDraw_CreateSurface( p_vout->p_sys->p_ddobject,
- &ddsd,
- &p_vout->p_sys->p_display, NULL );
+ dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
+ &ddsd,
+ &p_display, NULL );
if( dxresult != DD_OK )
{
intf_ErrMsg( "vout error: can't create direct draw primary surface." );
return( 1 );
}
-#if 0
- /* Now create a clipper for our window.
- * This clipper prevents us to modify by mistake anything on the screen
- * (primary surface) which doesn't belong to our window */
- dxresult = IDirectDraw_CreateClipper(p_vout->p_sys->p_ddobject, 0,
- &p_vout->p_sys->p_clipper, NULL);
- if( dxresult != DD_OK )
+ dxresult = IDirectDrawSurface_QueryInterface( p_display,
+ &IID_IDirectDrawSurface3,
+ (LPVOID *)&p_vout->p_sys->p_display );
+ if ( dxresult != DD_OK )
{
- intf_ErrMsg( "vout error: can't create clipper." );
- IDirectDrawSurface_Release( p_vout->p_sys->p_display );
+ intf_ErrMsg( "vout error: can't get IDirectDrawSurface3 interface." );
+ IDirectDrawSurface_Release( p_display );
p_vout->p_sys->p_display = NULL;
return( 1 );
}
-
- dxresult = IDirectDrawClipper_SetHWnd(p_vout->p_sys->p_clipper, 0,
- p_vout->p_sys->hwnd);
- if( dxresult != DD_OK )
+ else
{
- intf_ErrMsg( "vout error: can't attach clipper to window." );
- IDirectDrawSurface_Release( p_vout->p_sys->p_display );
- p_vout->p_sys->p_display = NULL;
- return( 1 );
+ /* Release the old interface */
+ IDirectDrawSurface_Release( p_display );
}
- dxresult = IDirectDrawSurface_SetClipper(p_vout->p_sys->p_display,
- p_vout->p_sys->p_clipper);
- if( dxresult != DD_OK )
+
+ /* We need to fill in some information for the video output thread.
+ * We do this here because it must be done before the video_output
+ * thread enters its main loop - and DirectXCreateSurface can be called
+ * after that ! */
+ ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
+ IDirectDrawSurface3_GetPixelFormat( p_vout->p_sys->p_display,
+ &ddpfPixelFormat );
+#ifdef NONAMELESSUNION
+ p_vout->i_screen_depth = ddpfPixelFormat.u1.dwRGBBitCount;
+ p_vout->i_bytes_per_pixel = ddpfPixelFormat.u1.dwRGBBitCount/8;
+
+ p_vout->i_red_mask = ddpfPixelFormat.u2.dwRBitMask;
+ p_vout->i_green_mask = ddpfPixelFormat.u3.dwGBitMask;
+ p_vout->i_blue_mask = ddpfPixelFormat.u4.dwBBitMask;
+#else
+ p_vout->i_screen_depth = ddpfPixelFormat.dwRGBBitCount;
+ p_vout->i_bytes_per_pixel = ddpfPixelFormat.dwRGBBitCount/8;
+
+ p_vout->i_red_mask = ddpfPixelFormat.dwRBitMask;
+ p_vout->i_green_mask = ddpfPixelFormat.dwGBitMask;
+ p_vout->i_blue_mask = ddpfPixelFormat.dwBBitMask;
+#endif /* NONAMELESSUNION */
+
+ /* Create a video surface. This function will try to create an
+ * YUV overlay first and if it can't it will create a simple RGB surface */
+ if( DirectXCreateSurface( p_vout ) )
{
- intf_ErrMsg( "vout error: can't attach clipper to surface." );
- IDirectDrawSurface_Release( p_vout->p_sys->p_display );
+ intf_ErrMsg( "vout error: can't create a video surface." );
+ IDirectDrawSurface3_Release( p_vout->p_sys->p_display );
p_vout->p_sys->p_display = NULL;
return( 1 );
}
-#endif
+
+ return( 0 );
+}
+/*****************************************************************************
+ * DirectXCreateSurface: create an YUV overlay or RGB surface for the video.
+ *****************************************************************************
+ * The best method of display is with an YUV overlay because the YUV->RGB
+ * conversion is done in hardware, so we'll try to create this surface first.
+ * If we fail, we'll try to create a plain RGB surface.
+ * ( Maybe we could also try an RGB overlay surface, which could have hardware
+ * scaling and which would also be faster in window mode because you don't
+ * need to do any blitting to the main display...)
+ *****************************************************************************/
+static int DirectXCreateSurface( vout_thread_t *p_vout )
+{
+ HRESULT dxresult;
+ DDSURFACEDESC ddsd;
+ LPDIRECTDRAWSURFACE p_surface;
+ DDCAPS ddcaps;
+
+ intf_WarnMsg( 3, "vout: DirectXCreateSurface" );
+
+ /* Disable display */
+ p_vout->p_sys->b_display_enabled = 0;
+
+#if 1
/* Probe the capabilities of the hardware */
- /* This is just an indication of whever or not we'll support overlay,
+ /* This is just an indication of whether or not we'll support overlay,
* but with this test we don't know if we support YUV overlay */
memset( &ddcaps, 0, sizeof( DDCAPS ));
ddcaps.dwSize = sizeof(DDCAPS);
- dxresult = IDirectDraw_GetCaps( p_vout->p_sys->p_ddobject,
- &ddcaps, NULL );
+ dxresult = IDirectDraw2_GetCaps( p_vout->p_sys->p_ddobject,
+ &ddcaps, NULL );
if(dxresult != DD_OK )
{
- intf_ErrMsg( "vout error: can't get caps." );
- bHasOverlay = FALSE;
- bHasColorKey = FALSE;
- bCanStretch = FALSE;
+ intf_WarnMsg( 3,"vout error: can't get caps." );
}
else
{
+ BOOL bHasOverlay, bHasColorKey, bCanStretch;
+
/* Determine if the hardware supports overlay surfaces */
bHasOverlay = ((ddcaps.dwCaps & DDCAPS_OVERLAY) ==
DDCAPS_OVERLAY) ? TRUE : FALSE;
/* Determine if the hardware supports scaling of the overlay surface */
bCanStretch = ((ddcaps.dwCaps & DDCAPS_OVERLAYSTRETCH) ==
DDCAPS_OVERLAYSTRETCH) ? TRUE : FALSE;
- intf_WarnMsg( 3, "vout: WinDX Caps: overlay=%i colorkey=%i stretch=%i",
+ intf_WarnMsg( 3, "vout: Dx Caps: overlay=%i colorkey=%i stretch=%i",
bHasOverlay, bHasColorKey, bCanStretch );
+
+ if( !bHasOverlay ) p_vout->b_need_render = 1;
}
+#endif
+
- p_vout->p_sys->p_overlay = NULL;
- if( bHasOverlay && bHasColorKey && bCanStretch )
+ /* Create the video surface */
+ if( !p_vout->b_need_render )
{
- if( !WinDXCreateYUVOverlay( p_vout ) )
+ /* Now try to create the YUV overlay surface.
+ * This overlay will be displayed on top of the primary surface.
+ * A color key is used to determine whether or not the overlay will be
+ * displayed, ie the overlay will be displayed in place of the primary
+ * surface wherever the primary surface will have this color.
+ * The video window has been created with a background of this color so
+ * the overlay will be only displayed on top of this window */
+
+ memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
+ ddsd.dwSize = sizeof(DDSURFACEDESC);
+ ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
+ ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
+ ddsd.ddpfPixelFormat.dwFourCC = mmioFOURCC('Y','V','1','2');
+#ifdef NONAMELESSUNION
+ ddsd.ddpfPixelFormat.u1.dwYUVBitCount = 16;
+#else
+ ddsd.ddpfPixelFormat.dwYUVBitCount = 16;
+#endif
+ ddsd.dwFlags = DDSD_CAPS |
+ DDSD_HEIGHT |
+ DDSD_WIDTH |
+ DDSD_PIXELFORMAT;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY;
+ ddsd.dwHeight = p_vout->p_sys->i_image_height;
+ ddsd.dwWidth = p_vout->p_sys->i_image_width;
+
+ dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
+ &ddsd, &p_surface, NULL );
+ if( dxresult == DD_OK )
+ {
+ intf_WarnMsg( 3,"vout: DirectX YUV overlay created successfully" );
+ }
+ else
{
- /* Overlay created successfully */
- p_vout->b_need_render = 0;
+ intf_ErrMsg( "vout error: can't create YUV overlay surface." );
+ p_vout->b_need_render = 1;
}
}
-
- /* Now do some initialisation for video_output */
if( p_vout->b_need_render )
{
- /* if we want a valid pointer to the surface memory, we must lock
- * the surface */
+ /* Now try to create a plain RGB surface. */
memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
ddsd.dwSize = sizeof(DDSURFACEDESC);
- dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_display,
- NULL, &ddsd,
- DDLOCK_NOSYSLOCK, NULL);
- if ( dxresult == DDERR_SURFACELOST )
+ ddsd.dwFlags = DDSD_HEIGHT |
+ DDSD_WIDTH |
+ DDSD_CAPS;
+ ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
+ ddsd.dwHeight = p_vout->p_sys->i_image_height;
+ ddsd.dwWidth = p_vout->p_sys->i_image_width;
+
+ dxresult = IDirectDraw2_CreateSurface( p_vout->p_sys->p_ddobject,
+ &ddsd, &p_surface, NULL );
+ if( dxresult == DD_OK )
{
- /* Your surface can be lost so be sure
- * to check this and restore it if needed */
- dxresult = IDirectDrawSurface_Restore( p_vout->p_sys->p_display );
- dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_display,
- NULL, &ddsd, DDLOCK_NOSYSLOCK
- | DDLOCK_WAIT, NULL);
+ intf_WarnMsg( 3,"vout: DirectX RGB surface created successfully" );
}
- if( dxresult != DD_OK )
+ else
{
- intf_WarnMsg( 3, "vout: WinDX could not lock the surface" );
+ intf_ErrMsg( "vout error: can't create RGB surface." );
+ p_vout->p_sys->p_surface = NULL;
return( 1 );
}
+ }
+
+ /* Now that the surface is created, try to get a newer DirectX interface */
+ dxresult = IDirectDrawSurface_QueryInterface( p_surface,
+ &IID_IDirectDrawSurface3,
+ (LPVOID *)&p_vout->p_sys->p_surface );
+ if ( dxresult != DD_OK )
+ {
+ intf_ErrMsg( "vout error: can't get IDirectDrawSurface3 interface." );
+ IDirectDrawSurface_Release( p_surface );
+ p_vout->p_sys->p_surface = NULL;
+ return( 1 );
+ }
+ else
+ {
+ /* Release the old interface */
+ IDirectDrawSurface_Release( p_surface );
+ }
+
+ if( !p_vout->b_need_render )
+ {
+ /* Hide the overlay for now */
+ IDirectDrawSurface3_UpdateOverlay(p_vout->p_sys->p_surface,
+ NULL,
+ p_vout->p_sys->p_display,
+ NULL,
+ DDOVER_HIDE,
+ NULL);
+ }
+ else
+ {
+ DirectXCreateClipper( p_vout );
+ }
- /* Set the pointer to the surface memory */
- p_vout->p_sys->p_windx_buf[ 0 ] = ddsd.lpSurface;
- /* back buffer, none for now */
- p_vout->p_sys->p_windx_buf[ 1 ] = ddsd.lpSurface;
+ /* From now on, do some initialisation for video_output */
- /* Set thread information */
- p_vout->i_width = ddsd.dwWidth;
- p_vout->i_height = ddsd.dwHeight;
+ /* if we want a valid pointer to the surface memory, we must lock
+ * the surface */
+ memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
+ ddsd.dwSize = sizeof(DDSURFACEDESC);
+ dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface, NULL, &ddsd,
+ DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL);
+ if ( dxresult == DDERR_SURFACELOST )
+ {
+ /* Your surface can be lost so be sure
+ * to check this and restore it if needed */
+ dxresult = IDirectDrawSurface3_Restore( p_vout->p_sys->p_surface );
+ dxresult = IDirectDrawSurface3_Lock( p_vout->p_sys->p_surface,
+ NULL, &ddsd, DDLOCK_NOSYSLOCK
+ | DDLOCK_WAIT, NULL);
+ }
+ if( dxresult != DD_OK )
+ {
+ intf_ErrMsg( "vout: DirectXCreateDisplay could not lock the surface" );
+ return( 1 );
+ }
+
+ /* Set the pointer to the surface memory */
+ p_vout->p_sys->p_directx_buf[ 0 ] = ddsd.lpSurface;
+ /* back buffer, none for now */
+ p_vout->p_sys->p_directx_buf[ 1 ] = ddsd.lpSurface;
+
+ /* Set thread information */
+ p_vout->i_width = ddsd.dwWidth;
+ p_vout->i_height = ddsd.dwHeight;
#ifdef NONAMELESSUNION
- p_vout->i_bytes_per_line = ddsd.u1.lPitch;
+ p_vout->i_bytes_per_line = ddsd.u1.lPitch;
+#else
+ p_vout->i_bytes_per_line = ddsd.lPitch;
+#endif /* NONAMELESSUNION */
+
+ if( p_vout->b_need_render )
+ {
+ /* For an RGB surface we need to fill in some more info */
+#ifdef NONAMELESSUNION
p_vout->i_screen_depth = ddsd.ddpfPixelFormat.u1.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.u1.dwRGBBitCount/8;
p_vout->i_green_mask = ddsd.ddpfPixelFormat.u3.dwGBitMask;
p_vout->i_blue_mask = ddsd.ddpfPixelFormat.u4.dwBBitMask;
#else
- p_vout->i_bytes_per_line = ddsd.lPitch;
-
p_vout->i_screen_depth = ddsd.ddpfPixelFormat.dwRGBBitCount;
p_vout->i_bytes_per_pixel = ddsd.ddpfPixelFormat.dwRGBBitCount/8;
p_vout->i_blue_mask = ddsd.ddpfPixelFormat.dwBBitMask;
#endif /* NONAMELESSUNION */
-
- /* Unlock the Surface */
- dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_display,
- ddsd.lpSurface );
- /* FIXME: palette in 8bpp ?? */
- /* Set and initialize buffers */
- p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_windx_buf[ 0 ],
- p_vout->p_sys->p_windx_buf[ 1 ] );
}
- else
- {
- /* Lock the surface */
- memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
- ddsd.dwSize = sizeof(DDSURFACEDESC);
- dxresult = IDirectDrawSurface_Lock(p_vout->p_sys->p_overlay,
- NULL, &ddsd, DDLOCK_NOSYSLOCK, NULL);
- if ( dxresult == DDERR_SURFACELOST )
- {
- /* Your surface can be lost (thanks to windows) so be sure
- * to check this every time you want to do something with
- * it */
- dxresult = IDirectDrawSurface_Restore(
- p_vout->p_sys->p_overlay );
- dxresult = IDirectDrawSurface_Lock( p_vout->p_sys->p_overlay
- , NULL, &ddsd,DDLOCK_NOSYSLOCK| DDLOCK_WAIT, NULL);
- }
- if( dxresult != DD_OK )
- {
- intf_WarnMsg( 3, "vout: WinDX could not lock the surface" );
- return( 1 );
- }
- p_vout->p_sys->p_windx_buf[ 0 ] = ddsd.lpSurface;
- p_vout->p_sys->p_windx_buf[ 1 ] = ddsd.lpSurface;
+ /* Unlock the Surface */
+ dxresult = IDirectDrawSurface3_Unlock(p_vout->p_sys->p_surface,
+ ddsd.lpSurface );
- /* Set thread information */
- p_vout->i_width = ddsd.dwWidth;
- p_vout->i_height = ddsd.dwHeight;
-#ifdef NONAMELESSUNION
- p_vout->i_bytes_per_line = ddsd.u1.lPitch;
-#else
- p_vout->i_bytes_per_line = ddsd.lPitch;
-#endif /* NONAMELESSUNION */
+ /* Set and initialize buffers */
+ p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_directx_buf[ 0 ],
+ p_vout->p_sys->p_directx_buf[ 1 ] );
- /* Unlock the Surface */
- dxresult = IDirectDrawSurface_Unlock(p_vout->p_sys->p_overlay,
- ddsd.lpSurface );
- p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_windx_buf[ 0 ],
- p_vout->p_sys->p_windx_buf[ 1 ] );
- }
-
- return( 0 );
+ return ( 0 );
}
+
/*****************************************************************************
- * WinDXCreateYUVOveraly: create an YUV overlay surface for the video.
+ * DirectXCreateClipper: Create a clipper that will be used when blitting the
+ * RGB surface to the main display.
*****************************************************************************
- * The best method of display is with an YUV overlay because the YUV->RGB
- * conversion is done in hardware.
- * This function will try to create an YUV overlay.
+ * This clipper prevents us to modify by mistake anything on the screen
+ * which doesn't belong to our window. For example when a part of our video
+ * window is hidden by another window.
*****************************************************************************/
-static int WinDXCreateYUVOverlay( vout_thread_t *p_vout )
+static int DirectXCreateClipper( vout_thread_t *p_vout )
{
HRESULT dxresult;
- DDSURFACEDESC ddsd;
- /* Now create the overlay surface. This overlay will be displayed on
- * top of the primary surface.
- * A color key is used to determine whether or not the overlay will be
- * displayed, ie the overlay will be displayed in place of the primary
- * surface wherever the primary surface will have this color.
- * The video window has been created with a background of this color so
- * the overlay will be only displayed on top of this window */
+ intf_WarnMsg( 3, "vout: DirectXCreateClipper" );
- memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
- ddsd.dwSize = sizeof(DDSURFACEDESC);
- ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
- ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
- ddsd.ddpfPixelFormat.dwFourCC = mmioFOURCC('Y','V','1','2');
-#ifdef NONAMELESSUNION
- ddsd.ddpfPixelFormat.u1.dwYUVBitCount = 16;
-#else
- ddsd.ddpfPixelFormat.dwYUVBitCount = 16;
-#endif
-
- ddsd.dwSize = sizeof(DDSURFACEDESC);
- ddsd.dwFlags = DDSD_CAPS |
- DDSD_HEIGHT |
- DDSD_WIDTH |
- DDSD_PIXELFORMAT;
- ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_VIDEOMEMORY;
- ddsd.dwHeight = p_vout->p_sys->i_image_height;
- ddsd.dwWidth = p_vout->p_sys->i_image_width;
-
- dxresult = IDirectDraw_CreateSurface( p_vout->p_sys->p_ddobject,
- &ddsd,
- &p_vout->p_sys->p_overlay, NULL );
+ /* Create the clipper */
+ dxresult = IDirectDraw2_CreateClipper( p_vout->p_sys->p_ddobject, 0,
+ &p_vout->p_sys->p_clipper, NULL );
if( dxresult != DD_OK )
{
- intf_ErrMsg( "vout error: can't create overlay surface." );
- p_vout->p_sys->p_overlay = NULL;
+ intf_WarnMsg( 3, "vout: DirectXCreateClipper can't create clipper." );
+ IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
+ p_vout->p_sys->p_clipper = NULL;
+ return( 1 );
}
- else
+
+ /* associate the clipper to the window */
+ dxresult = IDirectDrawClipper_SetHWnd(p_vout->p_sys->p_clipper, 0,
+ p_vout->p_sys->hwnd);
+ if( dxresult != DD_OK )
{
- intf_WarnMsg( 3, "vout: WinDX YUV overlay created successfully" );
+ intf_WarnMsg( 3,
+ "vout: DirectXCreateClipper can't attach clipper to window." );
+ IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
+ p_vout->p_sys->p_clipper = NULL;
+ return( 1 );
}
- /* Hide the overlay for now */
- IDirectDrawSurface_UpdateOverlay(p_vout->p_sys->p_overlay,
- NULL,
- p_vout->p_sys->p_display,
- NULL,
- DDOVER_HIDE,
- NULL);
-
- return ( 0 );
+
+ /* associate the clipper with the surface */
+ dxresult = IDirectDrawSurface_SetClipper(p_vout->p_sys->p_display,
+ p_vout->p_sys->p_clipper);
+ if( dxresult != DD_OK )
+ {
+ intf_WarnMsg( 3,
+ "vout: DirectXCreateClipper can't attach clipper to surface." );
+ IDirectDrawSurface_Release( p_vout->p_sys->p_clipper );
+ p_vout->p_sys->p_clipper = NULL;
+ return( 1 );
+ }
+
+ return( 0 );
}
+
/*****************************************************************************
- * WinDXUpdateOverlay: Move or resize overlay surface on video display.
+ * DirectXUpdateOverlay: Move or resize overlay surface on video display.
*****************************************************************************
* This function is used to move or resize an overlay surface on the screen.
* Ususally the overlay is moved by the user and thus, by a move or resize
* event (in vout_Manage).
*****************************************************************************/
-static int WinDXUpdateOverlay( vout_thread_t *p_vout )
+static int DirectXUpdateOverlay( vout_thread_t *p_vout )
{
DDOVERLAYFX ddofx;
- RECT rect_window, rect_image;
+ RECT rect_window, rect_window_backup, rect_image;
POINT point_window;
DWORD dwFlags;
HRESULT dxresult;
DWORD dw_colorkey;
DDPIXELFORMAT pixel_format;
+ DDSURFACEDESC ddsd;
- if( p_vout->p_sys->p_overlay == NULL || p_vout->b_need_render)
+ if( p_vout->p_sys->p_surface == NULL || p_vout->b_need_render )
{
- intf_WarnMsg( 3, "vout: WinDX no overlay !!" );
+ intf_WarnMsg( 3, "vout: DirectXUpdateOverlay no overlay !!" );
return( 0 );
}
/* It seems we can't feed the UpdateOverlay directdraw function with
* negative values so we have to clip the computed rectangles */
- /* FIXME */
-
+ memset( &ddsd, 0, sizeof( DDSURFACEDESC ));
+ ddsd.dwSize = sizeof(DDSURFACEDESC);
+ ddsd.dwFlags = DDSD_HEIGHT | DDSD_WIDTH;
+ IDirectDraw2_GetDisplayMode( p_vout->p_sys->p_ddobject, &ddsd );
+
+ rect_window_backup = rect_window;
+
+ /* Clip the destination window */
+ rect_window.left = (rect_window.left < 0) ? 0 : rect_window.left;
+ rect_window.right = (rect_window.right < 0) ? 0 : rect_window.right;
+ rect_window.top = (rect_window.top < 0) ? 0 : rect_window.top;
+ rect_window.bottom = (rect_window.bottom < 0) ? 0 : rect_window.bottom;
+
+ rect_window.left = (rect_window.left > ddsd.dwWidth) ? ddsd.dwWidth
+ : rect_window.left;
+ rect_window.right = (rect_window.right > ddsd.dwWidth) ? ddsd.dwWidth
+ : rect_window.right;
+ rect_window.top = (rect_window.top > ddsd.dwHeight) ? ddsd.dwHeight
+ : rect_window.top;
+ rect_window.bottom = (rect_window.bottom > ddsd.dwHeight) ? ddsd.dwHeight
+ : rect_window.bottom;
+
+ intf_WarnMsg( 3, "vout: DirectXUpdateOverlay window coords: %i,%i,%i,%i",
+ rect_window.left, rect_window.top,
+ rect_window.right, rect_window.bottom);
+
+ /* Clip the source image */
+ rect_image.left = ( rect_window.left == rect_window_backup.left ) ? 0
+ : labs(rect_window_backup.left - rect_window.left) *
+ p_vout->p_rendered_pic->i_width /
+ (rect_window_backup.right - rect_window_backup.left);
+ rect_image.right = ( rect_window.right == rect_window_backup.right ) ?
+ p_vout->p_rendered_pic->i_width
+ : p_vout->p_rendered_pic->i_width -
+ labs(rect_window_backup.right - rect_window.right) *
+ p_vout->p_rendered_pic->i_width /
+ (rect_window_backup.right - rect_window_backup.left);
+ rect_image.top = ( rect_window.top == rect_window_backup.top ) ? 0
+ : labs(rect_window_backup.top - rect_window.top) *
+ p_vout->p_rendered_pic->i_height /
+ (rect_window_backup.bottom - rect_window_backup.top);
+ rect_image.bottom = ( rect_window.bottom == rect_window_backup.bottom ) ?
+ p_vout->p_rendered_pic->i_height
+ : p_vout->p_rendered_pic->i_height -
+ labs(rect_window_backup.bottom - rect_window.bottom) *
+ p_vout->p_rendered_pic->i_height /
+ (rect_window_backup.bottom - rect_window_backup.top);
+
+ intf_WarnMsg( 3, "vout: DirectXUpdateOverlay image coords: %i,%i,%i,%i",
+ rect_image.left, rect_image.top,
+ rect_image.right, rect_image.bottom);
/* compute the colorkey pixel value from the RGB value we've got */
memset( &pixel_format, 0, sizeof( DDPIXELFORMAT ));
pixel_format.dwSize = sizeof( DDPIXELFORMAT );
- dxresult = IDirectDrawSurface_GetPixelFormat( p_vout->p_sys->p_display,
- &pixel_format );
+ dxresult = IDirectDrawSurface3_GetPixelFormat( p_vout->p_sys->p_display,
+ &pixel_format );
if( dxresult != DD_OK )
- intf_WarnMsg( 3, "vout: WinDX GetPixelFormat failed !!" );
+ intf_WarnMsg( 3, "vout: DirectXUpdateOverlay GetPixelFormat failed" );
dw_colorkey = (DWORD)p_vout->p_sys->i_colorkey;
#ifdef NONAMELESSUNION
dw_colorkey = (DWORD)((( dw_colorkey * pixel_format.u2.dwRBitMask) / 255)
dwFlags = DDOVER_KEYDESTOVERRIDE | DDOVER_SHOW;
- dxresult = IDirectDrawSurface_UpdateOverlay(p_vout->p_sys->p_overlay,
- NULL, /*&rect_image,*/
- p_vout->p_sys->p_display,
- &rect_window,
- dwFlags,
- &ddofx);
+ dxresult = IDirectDrawSurface3_UpdateOverlay(p_vout->p_sys->p_surface,
+ &rect_image,
+ p_vout->p_sys->p_display,
+ &rect_window,
+ dwFlags,
+ &ddofx);
if(dxresult != DD_OK)
{
- intf_WarnMsg( 3, "vout: WinDX can't move or resize overlay" );
+ intf_WarnMsg( 3,
+ "vout: DirectXUpdateOverlay can't move or resize overlay" );
}
return ( 0 );
}
/*****************************************************************************
- * WinDXCloseWindow: close the window created by WinDXCreateWindow
+ * DirectXCloseWindow: close the window created by DirectXCreateWindow
*****************************************************************************
- * This function returns all resources allocated by WinDXCreateWindow.
+ * This function returns all resources allocated by DirectXCreateWindow.
*****************************************************************************/
-static void WinDXCloseWindow( vout_thread_t *p_vout )
+static void DirectXCloseWindow( vout_thread_t *p_vout )
{
HINSTANCE hInstance;
- intf_WarnMsg( 3, "vout: WinDXCloseWindow" );
- if( p_vout->p_sys->hwnd != INVALID_HANDLE_VALUE )
+ intf_WarnMsg( 3, "vout: DirectXCloseWindow" );
+ if( p_vout->p_sys->hwnd != NULL )
{
DestroyWindow( p_vout->p_sys->hwnd);
- p_vout->p_sys->hwnd = INVALID_HANDLE_VALUE;
+ p_vout->p_sys->hwnd = NULL;
}
hInstance = GetModuleHandle(NULL);
hInstance ); /* handle to application instance */
/* free window background brush */
- if( p_vout->p_sys->hwnd != INVALID_HANDLE_VALUE )
+ if( p_vout->p_sys->hwnd != NULL )
{
DeleteObject( p_vout->p_sys->hbrush );
- p_vout->p_sys->hbrush = INVALID_HANDLE_VALUE;
+ p_vout->p_sys->hbrush = NULL;
}
}
/*****************************************************************************
- * WinDXCloseDDraw: Release the DDraw object allocated by WinDXInitDDraw
+ * DirectXCloseDDraw: Release the DDraw object allocated by DirectXInitDDraw
*****************************************************************************
- * This function returns all resources allocated by WinDXInitDDraw.
+ * This function returns all resources allocated by DirectXInitDDraw.
*****************************************************************************/
-static void WinDXCloseDDraw( vout_thread_t *p_vout )
+static void DirectXCloseDDraw( vout_thread_t *p_vout )
{
- intf_WarnMsg(3, "vout: WinDXCloseDDraw" );
+ intf_WarnMsg(3, "vout: DirectXCloseDDraw" );
if( p_vout->p_sys->p_ddobject != NULL )
{
- IDirectDraw_Release(p_vout->p_sys->p_ddobject);
+ IDirectDraw2_Release(p_vout->p_sys->p_ddobject);
p_vout->p_sys->p_ddobject = NULL;
}
+
+ if( p_vout->p_sys->hddraw_dll != NULL )
+ {
+ FreeLibrary( p_vout->p_sys->hddraw_dll );
+ p_vout->p_sys->hddraw_dll = NULL;
+ }
}
/*****************************************************************************
- * WinDXCloseDisplay: close and reset DirectX device
+ * DirectXCloseDisplay: close and reset the DirectX display device
*****************************************************************************
- * This function returns all resources allocated by WinDXCreateDisplay and
- * restore the original state of the device.
+ * This function returns all resources allocated by DirectXCreateDisplay.
*****************************************************************************/
-static void WinDXCloseDisplay( vout_thread_t *p_vout )
+static void DirectXCloseDisplay( vout_thread_t *p_vout )
{
- intf_WarnMsg( 3, "vout: WinDXCloseDisplay" );
+ intf_WarnMsg( 3, "vout: DirectXCloseDisplay" );
if( p_vout->p_sys->p_display != NULL )
{
- if( p_vout->p_sys->p_overlay != NULL )
- {
- intf_WarnMsg( 3, "vout: WinDXCloseDisplay overlay" );
- IDirectDraw_Release( p_vout->p_sys->p_overlay );
- p_vout->p_sys->p_overlay = NULL;
- }
+ DirectXCloseSurface( p_vout );
- if( p_vout->p_sys->p_clipper != NULL )
- {
- intf_WarnMsg( 3, "vout: WinDXCloseDisplay clipper" );
- IDirectDraw_Release( p_vout->p_sys->p_clipper );
- p_vout->p_sys->p_clipper = NULL;
- }
-
- intf_WarnMsg( 3, "vout: WinDXCloseDisplay display" );
- IDirectDraw_Release( p_vout->p_sys->p_display );
+ intf_WarnMsg( 3, "vout: DirectXCloseDisplay display" );
+ IDirectDraw2_Release( p_vout->p_sys->p_display );
p_vout->p_sys->p_display = NULL;
}
}
/*****************************************************************************
- * WinDXCloseYUVOverlay: close the overlay surface
+ * DirectXCloseSurface: close the YUV overlay or RGB surface.
*****************************************************************************
- * This function returns all resources allocated by the overlay surface.
+ * This function returns all resources allocated by the surface.
* We also call this function when the decoded picture change its dimensions
* (in that case we close the overlay surface and reopen another with the
* right dimensions).
*****************************************************************************/
-static void WinDXCloseYUVOverlay( vout_thread_t *p_vout )
+static void DirectXCloseSurface( vout_thread_t *p_vout )
{
- intf_WarnMsg( 3, "vout: WinDXCloseYUVOverlay" );
- if( p_vout->p_sys->p_overlay != NULL )
+ intf_WarnMsg( 3, "vout: DirectXCloseSurface" );
+ if( p_vout->p_sys->p_surface != NULL )
+ {
+ intf_WarnMsg( 3, "vout: DirectXCloseSurface surface" );
+ IDirectDraw2_Release( p_vout->p_sys->p_surface );
+ p_vout->p_sys->p_surface = NULL;
+ }
+
+ if( p_vout->p_sys->p_clipper != NULL )
{
- IDirectDraw_Release( p_vout->p_sys->p_overlay );
- p_vout->p_sys->p_overlay = NULL;
+ intf_WarnMsg( 3, "vout: DirectXCloseSurface clipper" );
+ IDirectDraw2_Release( p_vout->p_sys->p_clipper );
+ p_vout->p_sys->p_clipper = NULL;
}
+
+ /* Disable any display */
p_vout->p_sys->b_display_enabled = 0;
}
* aout_dummy.c : dummy audio output plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout_dummy.c,v 1.12 2001/05/31 01:37:08 sam Exp $
+ * $Id: aout_dummy.c,v 1.13 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
typedef struct aout_sys_s
{
-#if defined( _MSC_VER )
+ /* Prevent malloc(0) */
int i_dummy;
-#endif
+
} aout_sys_t;
/*****************************************************************************
* intf_dummy.c: dummy interface plugin
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: intf_dummy.c,v 1.9 2001/05/31 01:37:08 sam Exp $
+ * $Id: intf_dummy.c,v 1.10 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
typedef struct intf_sys_s
{
-#if defined( _MSC_VER )
+ /* Prevent malloc(0) */
int i_dummy;
-#endif
+
} intf_sys_t;
/*****************************************************************************
# Real targets
#
+ifeq (1,$(LOCAL_LIBDVDCSS))
../../lib/dvd.so: libdvdcss $(PLUGIN_DVD)
- $(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) $(LIB_DVD)
+ $(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) ../../lib/libdvdcss.a $(LIB_DVD)
../../lib/dvd.a: libdvdcss $(BUILTIN_DVD)
ar r $@ $(BUILTIN_DVD)
$(RANLIB) $@
+else
+../../lib/dvd.so: $(PLUGIN_DVD)
+ $(CC) $(PCFLAGS) -o $@ $(PLUGIN_DVD) $(PLCFLAGS) $(LIB_DVD)
+
+../../lib/dvd.a: $(BUILTIN_DVD)
+ ar r $@ $(BUILTIN_DVD)
+ $(RANLIB) $@
+endif
libdvdcss:
cd ../../ && $(MAKE) libdvdcss
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.72 2001/06/13 00:03:08 stef Exp $
+ * $Id: input_dvd.c,v 1.73 2001/06/14 01:49:44 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
input_area_t * p_area;
int i_title;
int i_chapter;
- int i_ret;
int i;
p_dvd = malloc( sizeof(thread_dvd_data_t) );
p_input->p_plugin_data = (void *)p_dvd;
p_input->p_method_data = NULL;
- p_dvd->dvdhandle = dvdcss_init( DVDCSS_INIT_QUIET );
-
- if( p_dvd->dvdhandle == NULL )
- {
- free( p_dvd );
- p_input->b_error = 1;
- return;
- }
-
/* XXX: put this shit in an access plugin */
if( strlen( p_input->p_source ) > 4
&& !strncasecmp( p_input->p_source, "dvd:", 4 ) )
{
- i_ret = dvdcss_open( p_dvd->dvdhandle, p_input->p_source + 4 );
+ p_dvd->dvdhandle = dvdcss_open( p_input->p_source + 4,
+ DVDCSS_INIT_QUIET );
}
else
{
- i_ret = dvdcss_open( p_dvd->dvdhandle, p_input->p_source );
+ p_dvd->dvdhandle = dvdcss_open( p_input->p_source,
+ DVDCSS_INIT_QUIET );
}
- if( i_ret < 0 )
+ if( p_dvd->dvdhandle == NULL )
{
- dvdcss_end( p_dvd->dvdhandle );
free( p_dvd );
p_input->b_error = 1;
return;
{
intf_ErrMsg( "dvd error: allcation error in ifo" );
dvdcss_close( p_dvd->dvdhandle );
- dvdcss_end( p_dvd->dvdhandle );
free( p_dvd );
p_input->b_error = 1;
return;
intf_ErrMsg( "dvd error: fatal failure in ifo" );
IfoDestroy( p_dvd->p_ifo );
dvdcss_close( p_dvd->dvdhandle );
- dvdcss_end( p_dvd->dvdhandle );
free( p_dvd );
p_input->b_error = 1;
return;
/* Clean up libdvdcss */
dvdcss_close( p_dvd->dvdhandle );
- dvdcss_end( p_dvd->dvdhandle );
free( p_dvd );
p_dvd->i_title_id =
vts.title_inf.p_title_start[i_vts_title-1].i_title_id;
- intf_WarnMsg( 3, "dvd: title %d vts_title %d pgc %d",
- p_dvd->i_title,
- i_vts_title,
- p_dvd->i_title_id );
+ intf_WarnMsgImm( 3, "dvd: title %d vts_title %d pgc %d",
+ p_dvd->i_title, i_vts_title, p_dvd->i_title_id );
/*
* CSS cracking has to be done again
/* last video cell */
p_dvd->i_cell = 0;
- intf_FlushMsg();
p_dvd->i_prg_cell = -1 +
vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_menu.c,v 1.9 2001/06/02 01:09:03 sam Exp $
+ * $Id: gtk_menu.c,v 1.10 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* user_data to transmit intf_* and we need to refresh the other menu.
****************************************************************************/
-#define GtkLangToggle( intf, window, menu, type, callback, b_update ) \
+#define GTKLANGTOGGLE( intf, window, menu, type, callback, b_update ) \
intf_thread_t * p_intf; \
GtkWidget * p_menu; \
es_descriptor_t * p_es; \
void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkLangToggle( "intf_window", p_popup, "popup_audio", AUDIO_ES,
+ GTKLANGTOGGLE( "intf_window", p_popup, "popup_audio", AUDIO_ES,
GtkPopupAudioToggle, b_audio_update );
}
void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkLangToggle( "intf_popup", p_window, "menubar_audio", AUDIO_ES,
+ GTKLANGTOGGLE( "intf_popup", p_window, "menubar_audio", AUDIO_ES,
GtkMenubarAudioToggle, b_audio_update );
}
void GtkMenubarSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkLangToggle( "intf_window", p_popup, "popup_subpictures", SPU_ES,
+ GTKLANGTOGGLE( "intf_window", p_popup, "popup_subpictures", SPU_ES,
GtkPopupSubtitleToggle, b_spu_update );
}
void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkLangToggle( "intf_popup", p_window, "menubar_subpictures", SPU_ES,
+ GTKLANGTOGGLE( "intf_popup", p_window, "menubar_subpictures", SPU_ES,
GtkMenubarSubtitleToggle, b_spu_update );
}
-#undef GtkLangToggle
+#undef GTKLANGTOGGLE
/*
* Navigation
* Angle
*/
-#define GtkAngleToggle( intf, window, menu, callback ) \
+#define GTKANGLETOGGLE( intf, window, menu, callback ) \
intf_thread_t * p_intf; \
GtkWidget * p_menu; \
input_area_t * p_area; \
void GtkMenubarAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkAngleToggle( "intf_window", p_popup, "popup_angle",
+ GTKANGLETOGGLE( "intf_window", p_popup, "popup_angle",
GtkPopupAngleToggle );
}
void GtkPopupAngleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
- GtkAngleToggle( "intf_popup", p_window, "menubar_angle",
+ GTKANGLETOGGLE( "intf_popup", p_window, "menubar_angle",
GtkMenubarAngleToggle );
}
-#undef GtkAngleToggle
+#undef GTKANGLETOGGLE
/****************************************************************************
* Functions to generate menus
* gtk_menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_menu.h,v 1.3 2001/05/19 00:39:30 stef Exp $
+ * $Id: gtk_menu.h,v 1.4 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
gint GtkSetupMenus( struct intf_thread_s * );
+/*****************************************************************************
+ * String sizes
+ *****************************************************************************/
+#define GTK_MENU_LABEL_SIZE 64
+
+/*****************************************************************************
+ * Convert user_data structures to title and chapter information
+ *****************************************************************************/
+#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
+#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
+#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
+
* intf_gtk.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gtk.h,v 1.6 2001/05/23 23:08:20 stef Exp $
+ * $Id: intf_gtk.h,v 1.7 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#define DROP_ACCEPT_TEXT_URI_LIST 0
#define DROP_ACCEPT_TEXT_PLAIN 1
-/*****************************************************************************
- * String sizes
- *****************************************************************************/
-#define GTK_MENU_LABEL_SIZE 64
-
-/*****************************************************************************
- * Convert user_data structures to title and chapter information
- *****************************************************************************/
-#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
-#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
-#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
-
/*****************************************************************************
* Useful inline function
****************************************************************************/
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input.c,v 1.120 2001/06/12 18:16:49 stef Exp $
+ * $Id: input.c,v 1.121 2001/06/14 01:49:44 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_input->stream.pp_areas = NULL;
p_input->stream.p_selected_area = NULL;
p_input->stream.p_new_area = NULL;
- /* By default there is one areas in a stream */
+
+ /* By default there is one area in a stream */
input_AddArea( p_input );
p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
p_input->pf_network_close = NetworkClose;
#endif
- /* Create thread and set locks. */
- vlc_mutex_init( &p_input->stream.stream_lock );
- vlc_cond_init( &p_input->stream.stream_wait );
- vlc_mutex_init( &p_input->stream.control.control_lock );
+ /* Create thread. */
if( vlc_thread_create( &p_input->thread_id, "input", (void *) RunThread,
(void *) p_input ) )
{
p_input->b_error = 1;
ErrorThread( p_input );
DestroyThread( p_input );
+ free( p_input );
return;
}
p_input->c_packets_trashed = 0;
#endif
+ /* Set locks. */
+ vlc_mutex_init( &p_input->stream.stream_lock );
+ vlc_cond_init( &p_input->stream.stream_wait );
+ vlc_mutex_init( &p_input->stream.control.control_lock );
+
/* Default, might get overwritten */
p_input->pf_open = p_input->pf_file_open;
p_input->pf_close = p_input->pf_file_close;
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.102 2001/06/12 22:14:44 sam Exp $
+ * $Id: main.c,v 1.103 2001/06/14 01:49:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
p_aout_bank = &aout_bank;
p_vout_bank = &vout_bank;
+ /*
+ * Initialize threads
+ */
+#if defined( PTH_INIT_IN_PTH_H )
+ pth_init( );
+#endif
+
/*
* Test if our code is likely to run on this CPU
*/
system_End();
#endif
+
/*
* Terminate messages interface and program
*/
intf_Msg( "intf: program terminated" );
intf_MsgDestroy();
+#if defined( PTH_INIT_IN_PTH_H )
+ pth_kill( );
+#endif
+
return 0;
}
i_illegal = 1;
+#ifdef HAVE_SIGRELSE
sigrelse( i_signal );
+#endif
longjmp( env, 1 );
}
volatile unsigned int i_eax, i_ebx, i_ecx, i_edx;
volatile boolean_t b_amd;
- signal( SIGILL, InstructionSignalHandler );
+ signal( SIGILL, InstructionSignalHandler );
/* test for a 486 CPU */
asm volatile ( "pushfl\n\t"
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.34 2001/06/03 12:47:22 sam Exp $
+ * $Id: modules.c,v 1.35 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
|| p_module->psz_version == NULL )
{
intf_ErrMsg( "module error: can't duplicate strings" );
- free( p_module->is.plugin.psz_filename );
- free( p_module->psz_name );
- free( p_module->psz_longname );
- free( p_module->psz_version );
+
+ if( p_module->is.plugin.psz_filename != NULL )
+ {
+ free( p_module->is.plugin.psz_filename );
+ }
+
+ if( p_module->psz_name != NULL )
+ {
+ free( p_module->psz_name );
+ }
+
+ if( p_module->psz_longname != NULL )
+ {
+ free( p_module->psz_longname );
+ }
+
+ if( p_module->psz_version != NULL )
+ {
+ free( p_module->psz_version );
+ }
+
free( p_module );
module_unload( handle );
return( -1 );
|| p_module->psz_version == NULL )
{
intf_ErrMsg( "module error: can't duplicate strings" );
- free( p_module->psz_name );
- free( p_module->psz_longname );
- free( p_module->psz_version );
+
+ if( p_module->psz_name != NULL )
+ {
+ free( p_module->psz_name );
+ }
+
+ if( p_module->psz_longname != NULL )
+ {
+ free( p_module->psz_longname );
+ }
+
+ if( p_module->psz_version != NULL )
+ {
+ free( p_module->psz_version );
+ }
+
free( p_module );
return( -1 );
}
* modules_core.h : Module management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_core.h,v 1.1 2001/06/02 01:09:03 sam Exp $
+ * $Id: modules_core.h,v 1.2 2001/06/14 01:49:44 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#else
return( dlsym( handle, psz_function ) );
+
#endif
}
* Functions are prototyped in mtime.h.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: mtime.c,v 1.21 2001/05/31 12:45:39 sam Exp $
+ * $Id: mtime.c,v 1.22 2001/06/14 01:49:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
#include <stdio.h> /* sprintf() */
+#if defined( PTH_INIT_IN_PTH_H ) /* GNU Pth */
+# include <pth.h>
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h> /* select() */
#endif
return;
}
-# ifdef HAVE_USLEEP
+# if defined( PTH_INIT_IN_PTH_H )
+ pth_usleep( delay );
+
+# elif defined( HAVE_USLEEP )
usleep( delay );
+
# 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
#elif defined( HAVE_USLEEP ) || defined( WIN32 )
usleep( delay );
+#elif defined( PTH_INIT_IN_PTH_H )
+ struct timeval tv_delay;
+ tv_delay.tv_sec = delay / 1000000;
+ tv_delay.tv_usec = delay % 1000000;
+ pth_select( 0, NULL, NULL, NULL, &tv_delay );
+
#else
struct timeval tv_delay;
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: video_output.c,v 1.131 2001/05/31 03:57:54 sam Exp $
+ * $Id: video_output.c,v 1.132 2001/06/14 01:49:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
while( (!p_vout->b_die) && (!p_vout->b_error) )
{
/* Initialize loop variables */
+ p_vout->p_rendered_pic = NULL;
p_pic = NULL;
p_subpic = NULL;
p_ephemer = NULL;