Commit 4b921617 authored by Sam Hocevar's avatar Sam Hocevar

  * DirectX enhancements by Gildas Bazin, such as software rendering.
  * Merged dvdcss_init and dvdcss_open into dvdcss_open, and dvdcss_close
    and dvdcss_end into dvdcss_close. libdvdcss API now has 7 functions.
  * Another failed attempt at profiling vlc under Linux: ported the
    threads API to GNU Pth. Activate with --enable-pth. It doesn't seem to
    spawn new threads for me, maybe someone will have better luck.
  * Makefile optimizations.
  * Automatic build of libdvdcss if not found.
parent 322cfc68
......@@ -11,109 +11,43 @@
#
# 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
......@@ -163,13 +97,21 @@ export
#
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
......@@ -182,21 +124,28 @@ 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)
......
......@@ -55,6 +55,7 @@ prefix = @prefix@
bindir = @bindir@
datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
#
# Libraries for special cases
......@@ -87,6 +88,11 @@ CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@
#
# Other special cases
#
LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
###############################################################################
# Configuration pre-processing
###############################################################################
......@@ -140,22 +146,28 @@ endif
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
......
This diff is collapsed.
......@@ -50,6 +50,8 @@ AC_CHECK_FUNC(inet_aton,,[
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],
......@@ -67,28 +69,25 @@ CFLAGS="${CFLAGS} -I/usr/local/include"
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)
......@@ -176,12 +175,10 @@ AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
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
......@@ -214,34 +211,26 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
])
dnl
dnl dummy plugin
dnl GNU portable threads
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
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 ])
......@@ -303,6 +292,45 @@ AC_ARG_ENABLE(optimizations,
[ 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
......@@ -423,18 +451,18 @@ AC_ARG_WITH(directx,
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
......@@ -582,6 +610,7 @@ AC_SUBST(DEFINE)
AC_SUBST(INCLUDE)
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(ASM)
AC_SUBST(TRACE)
AC_SUBST(OPTIMS)
AC_SUBST(CSS)
......@@ -617,6 +646,8 @@ AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11)
AC_SUBST(LOCAL_LIBDVDCSS)
AC_OUTPUT([Makefile.opts include/config.h])
echo "
......@@ -625,6 +656,7 @@ global configuration
system : ${SYS}
architecture : ${ARCH}
optimizations : ${OPTIMS}
inline assembly : ${ASM}
vlc configuration
-----------------
......
......@@ -2,7 +2,7 @@ Source: vlc
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
......
......@@ -5,6 +5,9 @@
include ../../Makefile.opts
LIBDVDCSS_VERSION = 0.0.1
LIBDVDCSS_MAJOR = 0
#
# Objects
#
......@@ -18,13 +21,23 @@ $(LIBDVDCSS_O): %.o: .dep/%.d
$(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)
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -57,10 +57,12 @@ static int _dvdcss_read ( dvdcss_handle, void *p_buffer, int i_blocks );
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 */
......@@ -76,50 +78,15 @@ extern dvdcss_handle dvdcss_init ( int i_flags )
}
/* 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 );
......@@ -127,7 +94,8 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
{
_dvdcss_error( dvdcss, "css test failed" );
_dvdcss_close( dvdcss );
return i_ret;
free( dvdcss );
return NULL;
}
dvdcss->b_encrypted = i_ret;
......@@ -140,13 +108,20 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
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;
}
/*****************************************************************************
......@@ -154,12 +129,6 @@ extern int dvdcss_open ( dvdcss_handle dvdcss, char *psz_target )
*****************************************************************************/
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 );
}
......@@ -170,12 +139,6 @@ extern int dvdcss_crack ( dvdcss_handle dvdcss, int i_title, int i_block )
{
int i_ret;
if( ! (dvdcss->i_status & DVDCSS_STATUS_OPEN) )
{
_dvdcss_error( dvdcss, "no device opened" );
return -1;
}
if( ! dvdcss->b_encrypted )
{
return 0;
......@@ -210,12 +173,6 @@ extern int dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
{
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
......@@ -248,12 +205,6 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
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
......@@ -296,18 +247,12 @@ extern int dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
}
/*****************************************************************************
* 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 )
......@@ -315,22 +260,6 @@ extern int dvdcss_close ( dvdcss_handle dvdcss )
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;
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -32,9 +32,6 @@
*****************************************************************************/
struct dvdcss_s
{
/* Status */
int i_status;
/* File descriptor */
int i_fd;
......@@ -49,13 +46,6 @@ struct dvdcss_s
};
/*****************************************************************************
* Flags
*****************************************************************************/
#define DVDCSS_STATUS_NONE 0
#define DVDCSS_STATUS_INIT 1 << 0
#define DVDCSS_STATUS_OPEN 1 << 1
/*****************************************************************************
* Error management
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -42,10 +42,8 @@ typedef struct dvdcss_s* dvdcss_handle;
/*****************************************************************************
* 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,
......
......@@ -37,6 +37,9 @@
/* 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
......@@ -73,6 +76,9 @@
/* 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
......@@ -139,6 +145,12 @@
/* 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
......@@ -172,6 +184,9 @@
/* 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 diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -50,9 +50,9 @@
*****************************************************************************/
typedef struct aout_sys_s
{
#if defined( _MSC_VER )
/* Prevent malloc(0) */
int i_dummy;
#endif
} aout_sys_t;
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -50,9 +50,9 @@
*****************************************************************************/
typedef struct intf_sys_s
{
#if defined( _MSC_VER )
/* Prevent malloc(0) */
int i_dummy;
#endif
} intf_sys_t;
/*****************************************************************************
......
......@@ -30,12 +30,21 @@ $(BUILTIN_DVD): BUILTIN_%.o: %.c
# 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
......
......@@ -10,7 +10,7 @@
* -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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -215,7 +215,6 @@ static void DVDInit( input_thread_t * p_input )
input_area_t * p_area;
int i_title;
int i_chapter;
int i_ret;
int i;
p_dvd = malloc( sizeof(thread_dvd_data_t) );
......@@ -229,29 +228,21 @@ static void DVDInit( input_thread_t * p_input )
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;
......@@ -276,7 +267,6 @@ static void DVDInit( input_thread_t * p_input )
{
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;
......@@ -287,7 +277,6 @@ static void DVDInit( input_thread_t * p_input )
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;
......@@ -378,7 +367,6 @@ static void DVDEnd( input_thread_t * p_input )
/* Clean up libdvdcss */
dvdcss_close( p_dvd->dvdhandle );
dvdcss_end( p_dvd->dvdhandle );
free( p_dvd );
......@@ -441,10 +429,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
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
......@@ -473,7 +459,6 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
/* 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;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment