Commit 05e3077c authored by Sam Hocevar's avatar Sam Hocevar

* ./include/modules_inner.h: support for several modules with the same

    name but with different directory names.
  * ./Makefile: plugins get installed in different directory names.
  * ALL: additional -ansi -pedantic fixes.
parent 58c63dc9
......@@ -187,11 +187,16 @@ endif
plugins-install:
mkdir -p $(DESTDIR)$(libdir)/vlc
ifneq (,$(PLUGINS))
$(INSTALL) $(PLUGINS:%=modules/%.so) $(DESTDIR)$(libdir)/vlc
for plugin in $(PLUGINS) ; \
do dir=`echo $$plugin | sed -e 's@/[^ ]*@@g'` ; \
mkdir -p $(DESTDIR)$(libdir)/vlc/$$dir ; \
cp modules/$${plugin}.so $(DESTDIR)$(libdir)/vlc/$$dir ; \
done
endif
plugins-uninstall:
rm -f $(DESTDIR)$(libdir)/vlc/*.so
rm -f $(DESTDIR)$(libdir)/vlc/*/*.so
-rmdir $(DESTDIR)$(libdir)/vlc/*
-rmdir $(DESTDIR)$(libdir)/vlc
builtins-install:
......@@ -405,7 +410,7 @@ src/misc/modules_builtin.h: Makefile.opts Makefile Makefile.config
@rm -f $@ && cp $@.in $@
ifneq (,$(BUILTINS))
@for i in $(BUILTINS) ; do \
echo "int vlc_entry__"`basename $$i`"( module_t* );" >>$@; \
echo "int vlc_entry__modules_"`echo $$i | sed -e 'y@/@_@ ; s@\..*@@'`"( module_t* );" >>$@; \
done
@echo "" >> $@ ;
endif
......@@ -414,7 +419,7 @@ endif
@echo " { \\" >> $@ ;
ifneq (,$(BUILTINS))
@for i in $(BUILTINS) ; do \
echo " ALLOCATE_BUILTIN("`basename $$i`"); \\" >> $@ ; \
echo " ALLOCATE_BUILTIN(modules_"`echo $$i | sed -e 'y@/@_@ ; s@\..*@@'`"); \\" >> $@ ; \
done
endif
@echo " } while( 0 );" >> $@ ;
......@@ -479,7 +484,7 @@ builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
modules/%.a modules/%.so: $(H_OBJ) FORCE
@cd $(shell echo $@ | sed -e 's@\(.*\)/.*@\1@') && $(MAKE) -f $(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')/Makefile.modules $(shell echo $@ | sed -e 's@.*/@@') PARENT=$(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')
cd $(shell echo $@ | sed -e 's@\(.*\)/.*@\1@') && $(MAKE) -f $(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@')/Makefile.modules $(shell echo $@ | sed -e 's@.*/@@') PARENT=$(shell echo $@ | sed -e 's@[^/]*/@../@g' -e 's@\(.*\)/.*@\1@') MODULE_PATH=$(shell echo $@ | sed -e 'y@/@_@ ; s@\..*@@')
#
# Mozilla plugin target
......
......@@ -29,12 +29,12 @@ builtins_CFLAGS += -D__BUILTIN__ -I$(PARENT)/include -I$(PARENT)/extras
ifeq (lo,$(suff))
extra_CFLAGS := $(plugins_CFLAGS) $($(module_name)_CFLAGS) \
-DMODULE_NAME=$(module_name) -DMODULE_NAME_IS_$(module_name) \
$($(module_name)_so_CFLAGS)
-DMODULE_PATH=$(MODULE_PATH) $($(module_name)_so_CFLAGS)
OBJ_ALL := $(SRC_C:%.c=%.lo.$(module_name)) $(SRC_CPP:%.cpp=%.lo.$(module_name))
else
extra_CFLAGS := $(builtins_CFLAGS) $($(module_name)_CFLAGS) \
-DMODULE_NAME=$(module_name) -DMODULE_NAME_IS_$(module_name) \
$($(module_name)_a_CFLAGS)
-DMODULE_PATH=$(MODULE_PATH) $($(module_name)_a_CFLAGS)
OBJ_ALL := $(SRC_C:%.c=%.o.$(module_name)) $(SRC_CPP:%.cpp=%.o.$(module_name)) \
$(SRC_M:%.m=%.o.$(module_name))
endif
......
This diff is collapsed.
......@@ -56,6 +56,10 @@ AM_GNU_GETTEXT
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE
dnl
dnl Set default LDFLAGS
dnl
......
usr/bin
usr/lib/vlc
usr/lib/vlc/gui
usr/share/doc
usr/share/gnome/apps/Multimedia
usr/share/man/man1
......
usr/bin
usr/lib/vlc
usr/lib/vlc/gui
usr/share/doc
usr/share/gnome/apps/Multimedia
usr/share/man/man1
......
usr/bin
usr/lib/vlc
usr/lib/vlc/gui
usr/share/doc
usr/share/man/man1
usr/share/pixmaps
......
usr/bin
usr/lib/vlc
usr/lib/vlc/gui
usr/share/doc
usr/share/man/man1
usr/share/pixmaps
......
......@@ -61,65 +61,111 @@ install: build
DESTDIR=`pwd`/debian/vlc/ $(MAKE) install prefix=/usr
# make symlinks for packages and install plugins
case $(DEB_BUILD_ARCH) in \
i386) \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa xosd kde glide" ;; \
*) \
ARCH_ALIASES="ggi gtk gnome esd sdl qt arts mad alsa lirc aa xosd kde" ;; \
esac ;\
for alias in $$ARCH_ALIASES ; do \
ln -s vlc debian/vlc-plugin-$$alias/usr/share/doc/vlc-plugin-$$alias ; \
mv debian/vlc/usr/lib/vlc/$$alias.so \
debian/vlc-plugin-$$alias/usr/lib/vlc/ ; done
# do the same for the mozilla plugin
ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
# Package: vlc
mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
cp debian/vlc.desktop debian/vlc/$(GNOMEDIR)
cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
# install development files
# Package: libvlc0-dev
mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
mv debian/vlc/usr/include/vlc/* debian/libvlc0-dev/usr/include/vlc/
ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
# do the binary aliases
mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
ln -s vlc debian/gvlc/usr/share/doc/gvlc
mv debian/vlc/usr/lib/vlc/gtk.so debian/gvlc/usr/lib/vlc/
ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
# Package: gnome-vlc
mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
mv debian/vlc/usr/lib/vlc/gnome.so debian/gnome-vlc/usr/lib/vlc/
-mv debian/vlc/usr/lib/vlc/gui/gnome.so debian/gnome-vlc/usr/lib/vlc/gui/
ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
# Package: gvlc
mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
ln -s vlc debian/gvlc/usr/share/doc/gvlc
-mv debian/vlc/usr/lib/vlc/gui/gtk.so debian/gvlc/usr/lib/vlc/gui/
ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
# Package: vlc-plugin-esd
ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
-mv debian/vlc/usr/lib/vlc/audio_output/esd.so \
debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
# Package: vlc-plugin-alsa
ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
-mv debian/vlc/usr/lib/vlc/audio_output/alsa.so \
debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
# Package: vlc-plugin-sdl
ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
-mv debian/vlc/usr/lib/vlc/audio_output/sdl.so \
debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
-mv debian/vlc/usr/lib/vlc/video_output/sdl.so \
debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
# Package: vlc-plugin-ggi
ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
-mv debian/vlc/usr/lib/vlc/video_output/ggi.so \
debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
# Package: vlc-plugin-glide
ifeq ($(DEB_BUILD_ARCH),i386)
ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
-mv debian/vlc/usr/lib/vlc/video_output/glide.so \
debian/vlc-plugin-glide/usr/lib/vlc/video_output/
endif
# Package: qvlc
mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
ln -s vlc debian/qvlc/usr/share/doc/qvlc
mv debian/vlc/usr/lib/vlc/qt.so debian/qvlc/usr/lib/vlc/
-mv debian/vlc/usr/lib/vlc/gui/qt.so debian/qvlc/usr/lib/vlc/gui/
ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
# Package: vlc-plugin-mad
ln -s vlc debian/vlc-plugin-mad/usr/share/doc/vlc-plugin-mad
-mv debian/vlc/usr/lib/vlc/codec/mad.so \
debian/vlc-plugin-mad/usr/lib/vlc/codec/
# Package: vlc-plugin-arts
ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
-mv debian/vlc/usr/lib/vlc/audio_output/arts.so \
debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
# Package: vlc-plugin-lirc
ln -s vlc debian/vlc-plugin-lirc/usr/share/doc/vlc-plugin-lirc
-mv debian/vlc/usr/lib/vlc/control/lirc.so \
debian/vlc-plugin-lirc/usr/lib/vlc/control/
# Package: vlc-plugin-aa
ln -s vlc debian/vlc-plugin-aa/usr/share/doc/vlc-plugin-aa
-mv debian/vlc/usr/lib/vlc/video_output/aa.so \
debian/vlc-plugin-aa/usr/lib/vlc/video_output/
# Package: vlc-plugin-xosd
ln -s vlc debian/vlc-plugin-xosd/usr/share/doc/vlc-plugin-xosd
-mv debian/vlc/usr/lib/vlc/visualization/xosd.so \
debian/vlc-plugin-xosd/usr/lib/vlc/visualization/
# Package: mozilla-plugin-vlc
ln -s vlc debian/mozilla-plugin-vlc/usr/share/doc/mozilla-plugin-vlc
mv debian/vlc/usr/lib/mozilla debian/mozilla-plugin-vlc/usr/lib
# Package: kvlc
mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
ln -s vlc debian/kvlc/usr/share/doc/kvlc
mv debian/vlc/usr/lib/vlc/kde.so debian/kvlc/usr/lib/vlc/
-mv debian/vlc/usr/lib/vlc/gui/kde.so debian/kvlc/usr/lib/vlc/gui/
ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
# copy pictures
mv debian/vlc/$(VIDDIR)/vlc48x48.png debian/vlc/$(PIXDIR)/vlc.png
mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
rm -f debian/vlc/$(VIDDIR)/*.png
cp debian/vlc.desktop debian/vlc/$(GNOMEDIR)
cp debian/gvlc.desktop debian/gvlc/$(GNOMEDIR)
cp debian/gnome-vlc.desktop debian/gnome-vlc/$(GNOMEDIR)
# Clean up
rm -f debian/vlc/$(VIDDIR)/*.png
#gzip -9 < doc/vlc.1 >| debian/vlc/usr/share/man/man1/vlc.1.gz
......@@ -136,14 +182,9 @@ binary-arch: build install
dh_installdocs
# dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
dh_installman doc/vlc.1
# dh_installinfo
# dh_undocumented
dh_installchangelogs -Ngnome-vlc -Ngvlc -Nvlc-plugin-ggi -Nvlc-plugin-glide -Nvlc-plugin-esd -Nvlc-plugin-alsa -Nvlc-plugin-sdl -Nqvlc -Nvlc-plugin-arts -Nvlc-plugin-mad -Nvlc-plugin-lirc -Nvlc-plugin-aa -Nvlc-plugin-xosd -Nkvlc -Nmozilla-plugin-vlc ChangeLog
dh_installman doc/vlc.1 -p vlc
dh_installman doc/vlc-config.1 -p libvlc0-dev
dh_installchangelogs ChangeLog -p vlc
dh_link
dh_strip
dh_compress
......
usr/lib/vlc
usr/lib/vlc/video_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/audio_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/audio_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/audio_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/video_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/video_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/control
usr/share/doc
usr/lib/vlc
usr/lib/vlc/codec
usr/share/doc
usr/lib/vlc
usr/lib/vlc/audio_output
usr/lib/vlc/video_output
usr/share/doc
usr/lib/vlc
usr/lib/vlc/visualization
usr/share/doc
usr/bin
usr/lib/vlc
usr/lib/vlc/acess
usr/lib/vlc/audio_filter
usr/lib/vlc/audio_mixer
usr/lib/vlc/audio_output
usr/lib/vlc/codec
usr/lib/vlc/control
usr/lib/vlc/demux
usr/lib/vlc/gui
usr/lib/vlc/misc
usr/lib/vlc/video_chroma
usr/lib/vlc/video_filter
usr/lib/vlc/video_output
usr/lib/vlc/visualization
usr/share/doc/vlc
usr/share/gnome/apps/Multimedia
usr/share/pixmaps
......
......@@ -26,14 +26,14 @@
*/
typedef union {
long long q; /* Quadword (64-bit) value */
unsigned long long uq; /* Unsigned Quadword */
int d[2]; /* 2 Doubleword (32-bit) values */
unsigned int ud[2]; /* 2 Unsigned Doubleword */
short w[4]; /* 4 Word (16-bit) values */
unsigned short uw[4]; /* 4 Unsigned Word */
char b[8]; /* 8 Byte (8-bit) values */
unsigned char ub[8]; /* 8 Unsigned Byte */
s64 q; /* Quadword (64-bit) value */
u64 uq; /* Unsigned Quadword */
s32 d[2]; /* 2 Doubleword (32-bit) values */
u32 ud[2]; /* 2 Unsigned Doubleword */
s16 w[4]; /* 4 Word (16-bit) values */
u16 uw[4]; /* 4 Unsigned Word */
s8 b[8]; /* 8 Byte (8-bit) values */
u8 ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */
} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */
......
......@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.28 2002/08/08 00:35:10 sam Exp $
* $Id: modules_inner.h,v 1.29 2002/08/08 22:28:22 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -26,6 +26,7 @@
*****************************************************************************/
#if !defined( __PLUGIN__ ) && !defined( __BUILTIN__ )
# define MODULE_NAME main
# define MODULE_PATH main
#endif
/*****************************************************************************
......@@ -53,8 +54,8 @@
/* If the module is built-in, then we need to define foo_InitModule instead
* of InitModule. Same for Activate- and DeactivateModule. */
#if defined( __BUILTIN__ )
# define E_( function ) CONCATENATE( function, MODULE_NAME )
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
# define E_( function ) CONCATENATE( function, MODULE_PATH )
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_PATH )
# define DECLARE_SYMBOLS struct _u_n_u_s_e_d_
# define STORE_SYMBOLS struct _u_n_u_s_e_d_
#elif defined( __PLUGIN__ )
......
......@@ -2,7 +2,7 @@
* dvd_ifo.h: Structures for ifo parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ifo.h,v 1.2 2002/08/08 00:35:10 sam Exp $
* $Id: ifo.h,v 1.3 2002/08/08 22:28:22 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -276,7 +276,7 @@ typedef struct vobu_map_s
*/
typedef struct manager_inf_s
{
char psz_id[13]; /* 12 bytes (DVDVIDEO-VMG) */
byte_t psz_id[13]; /* 12 bytes (DVDVIDEO-VMG) */
u32 i_vmg_end_sector; /* 4 bytes */
/* char[12] ??? */
u32 i_vmg_inf_end_sector; /* 4 bytes */
......@@ -288,7 +288,7 @@ typedef struct manager_inf_s
u8 i_disc_side; /* 1 bytes */
/* char[20] ??? */
u16 i_title_set_nb; /* 2 bytes */
char ps_provider_id[32]; /* 32 bytes */
byte_t ps_provider_id[32]; /* 32 bytes */
u64 i_pos_code; /* 8 bytes */
/* char[24] ??? */
u32 i_vmg_inf_end_byte; /* 4 bytes */
......@@ -345,7 +345,7 @@ typedef struct title_inf_s
*/
typedef struct parental_desc_s
{
char ps_country_code[2]; /* 2 bytes */
byte_t ps_country_code[2]; /* 2 bytes */
/* char[2] ??? */
u16 i_parental_mask_start_byte; /* 2 bytes */
/* char[2] ??? */
......@@ -429,7 +429,7 @@ typedef struct vmg_s
*/
typedef struct vts_manager_s
{
char psz_id[13]; /* 12 bytes (DVDVIDEO-VTS) */
byte_t psz_id[13]; /* 12 bytes (DVDVIDEO-VTS) */
u32 i_last_sector; /* 4 bytes */
/* char[12] ??? */
u32 i_inf_last_sector; /* 4 bytes */
......
......@@ -5,7 +5,7 @@
* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: udf.c,v 1.2 2002/08/08 00:35:10 sam Exp $
* $Id: udf.c,v 1.3 2002/08/08 22:28:22 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -233,7 +233,7 @@ static int UDFICB( u8 * pi_data, u8 * pi_file_type, u16 * pi_flags)
* UDFPartition: gets partition descriptor
*****************************************************************************/
static int UDFPartition( u8 * pi_data, u16 * pi_flags, u16 * pi_nb,
char * ps_contents, u32 * pi_start, u32 * pi_length )
byte_t * ps_contents, u32 * pi_start, u32 * pi_length )
{
pi_flags[0] = GETN2( 20 );
pi_nb[0] = GETN2( 22 );
......@@ -250,13 +250,13 @@ static int UDFPartition( u8 * pi_data, u16 * pi_flags, u16 * pi_nb,
*****************************************************************************
* Returns 0 on OK, 1 on error
*****************************************************************************/
static int UDFLogVolume(u8 * pi_data, char * p_volume_descriptor )
static int UDFLogVolume(u8 * pi_data, byte_t * p_volume_descriptor )
{
u32 i_lb_size;
u32 i_MT_L;
u32 i_N_PM;
UDFDecode( &pi_data[84], 128, p_volume_descriptor );
UDFDecode( &pi_data[84], 128, (char *)p_volume_descriptor );
i_lb_size = GETN4( 212 ); /* should be 2048 */
i_MT_L = GETN4( 264 ); /* should be 6 */
......
......@@ -2,7 +2,7 @@
* cdrom.c: cdrom tools
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.c,v 1.1 2002/08/04 17:23:42 sam Exp $
* $Id: cdrom.c,v 1.2 2002/08/08 22:28:22 sam Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -73,7 +73,7 @@ int getNumberOfTracks( CDTOC *, int );
/*****************************************************************************
* ioctl_ReadTocHeader: Read the TOC header and return the track number.
*****************************************************************************/
int ioctl_GetTrackCount( int i_fd, const char *psz_dev )
int ioctl_GetTrackCount( vlc_object_t * p_this, int i_fd, const char *psz_dev )
{
int i_count = -1;
......@@ -83,7 +83,7 @@ int ioctl_GetTrackCount( int i_fd, const char *psz_dev )
if( ( pTOC = getTOC( psz_dev ) ) == NULL )
{
//X intf_ErrMsg( "vcd error: failed to get the TOC" );
msg_Err( p_this, "failed to get the TOC" );
return( -1 );
}
......@@ -97,7 +97,7 @@ int ioctl_GetTrackCount( int i_fd, const char *psz_dev )
if( ioctl( i_fd, CDIOREADTOCHEADER, &tochdr ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read TOCHDR" );
msg_Err( p_this, "could not read TOCHDR" );
return -1;
}
......@@ -109,7 +109,7 @@ int ioctl_GetTrackCount( int i_fd, const char *psz_dev )
/* First we read the TOC header */
if( ioctl( i_fd, CDROMREADTOCHDR, &tochdr ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read TOCHDR" );
msg_Err( p_this, "could not read TOCHDR" );
return -1;
}
......@@ -122,7 +122,7 @@ int ioctl_GetTrackCount( int i_fd, const char *psz_dev )
/*****************************************************************************
* ioctl_GetSectors: Read the Table of Contents and fill p_vcd.
*****************************************************************************/
int * ioctl_GetSectors( int i_fd, const char *psz_dev )
int * ioctl_GetSectors( vlc_object_t *p_this, int i_fd, const char *psz_dev )
{
int i, i_tracks;
int *p_sectors = NULL;
......@@ -136,7 +136,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
if( ( pTOC = getTOC( psz_dev ) ) == NULL )
{
//X intf_ErrMsg( "vcd error: failed to get the TOC" );
msg_Err( p_this, "failed to get the TOC" );
return( NULL );
}
......@@ -146,7 +146,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
p_sectors = malloc( (i_tracks + 1) * sizeof(int) );
if( p_sectors == NULL )
{
//X intf_ErrMsg( "vcd error: could not allocate p_sectors" );
msg_Err( p_this, "out of memory" );
freeTOC( pTOC );
return NULL;
}
......@@ -169,7 +169,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
if( i_leadout == -1 )
{
//X intf_ErrMsg( "vcd error: leadout not found" );
msg_Err( p_this, "leadout not found" );
free( p_sectors );
freeTOC( pTOC );
return( NULL );
......@@ -184,11 +184,11 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
#elif defined( HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H )
struct ioc_read_toc_entry toc_entries;
i_tracks = ioctl_GetTrackCount( i_fd, psz_dev );
i_tracks = ioctl_GetTrackCount( p_this, i_fd, psz_dev );
p_sectors = malloc( (i_tracks + 1) * sizeof(int) );
if( p_sectors == NULL )
{
//X intf_ErrMsg( "vcd error: could not allocate p_sectors" );
msg_Err( p_this, "out of memory" );
return NULL;
}
......@@ -198,7 +198,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
toc_entries.data = (struct cd_toc_entry *) malloc( toc_entries.data_len );
if( toc_entries.data == NULL )
{
//X intf_ErrMsg( "vcd error: not enoug memory" );
msg_Err( p_this, "out of memory" );
free( p_sectors );
return NULL;
}
......@@ -206,7 +206,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
/* Read the TOC */
if( ioctl( i_fd, CDIOREADTOCENTRYS, &toc_entries ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read the TOC" );
msg_Err( p_this, "could not read the TOC" );
free( p_sectors );
free( toc_entries.data );
return NULL;
......@@ -224,7 +224,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
/* First we read the TOC header */
if( ioctl( i_fd, CDROMREADTOCHDR, &tochdr ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read TOCHDR" );
msg_Err( p_this, "could not read TOCHDR" );
return NULL;
}
......@@ -233,7 +233,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
p_sectors = malloc( (i_tracks + 1) * sizeof(int) );
if( p_sectors == NULL )
{
//X intf_ErrMsg( "vcd error: could not allocate p_sectors" );
msg_Err( p_this, "out of memory" );
return NULL;
}
......@@ -246,7 +246,7 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
if( ioctl( i_fd, CDROMREADTOCENTRY, &tocent ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read TOCENTRY" );
msg_Err( p_this, "could not read TOCENTRY" );
free( p_sectors );
return NULL;
}
......@@ -261,7 +261,8 @@ int * ioctl_GetSectors( int i_fd, const char *psz_dev )
/****************************************************************************
* ioctl_ReadSector: Read a sector (2324 bytes)
****************************************************************************/
int ioctl_ReadSector( int i_fd, int i_sector, byte_t * p_buffer )
int ioctl_ReadSector( vlc_object_t *p_this,
int i_fd, int i_sector, byte_t * p_buffer )
{
byte_t p_block[ VCD_SECTOR_SIZE ];
......@@ -281,7 +282,7 @@ int ioctl_ReadSector( int i_fd, int i_sector, byte_t * p_buffer )
if( ioctl( i_fd, DKIOCCDREAD, &cd_read ) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read block %d", i_sector );
msg_Err( p_this, "could not read block %d", i_sector );
return( -1 );
}
......@@ -291,19 +292,19 @@ int ioctl_ReadSector( int i_fd, int i_sector, byte_t * p_buffer )
if( ioctl( i_fd, CDRIOCSETBLOCKSIZE, &i_size ) == -1 )
{
//X intf_ErrMsg( "vcd error: Could not set block size" );
msg_Err( p_this, "Could not set block size" );
return( -1 );
}
if( lseek( i_fd, i_sector * VCD_SECTOR_SIZE, SEEK_SET ) == -1 )
{
//X intf_ErrMsg( "vcd error: Could not lseek to sector %d", i_sector );
msg_Err( p_this, "Could not lseek to sector %d", i_sector );
return( -1 );
}
if( read( i_fd, p_block, VCD_SECTOR_SIZE ) == -1 )
{
//X intf_ErrMsg( "vcd error: Could not read sector %d", i_sector );
msg_Err( p_this, "Could not read sector %d", i_sector );
return( -1 );
}
......@@ -318,8 +319,7 @@ int ioctl_ReadSector( int i_fd, int i_sector, byte_t * p_buffer )
if( ioctl(i_fd, CDROMREADRAW, p_block) == -1 )
{
//X intf_ErrMsg( "vcd error: could not read block %i from disc",
//X i_sector );
msg_Err( p_this, "could not read block %i from disc", i_sector );
return( -1 );
}
#endif
......@@ -347,7 +347,7 @@ CDTOC *getTOC( const char *psz_dev )
if( psz_dev == NULL )
{
//X intf_ErrMsg( "vcd error: invalid device path" );
msg_Err( p_this, "invalid device path" );
return( NULL );
}
......@@ -364,7 +364,7 @@ CDTOC *getTOC( const char *psz_dev )
/* get port for IOKit communication */
if( ( ret = IOMasterPort( MACH_PORT_NULL, &port ) ) != KERN_SUCCESS )
{
//X intf_ErrMsg( "vcd error: IOMasterPort: 0x%08x", ret );
msg_Err( p_this, "IOMasterPort: 0x%08x", ret );
return( NULL );
}
......@@ -373,7 +373,7 @@ CDTOC *getTOC( const char *psz_dev )
port, IOBSDNameMatching( port, 0, psz_devname ),
&iterator ) ) != KERN_SUCCESS )
{
//X intf_ErrMsg( "vcd error: IOServiceGetMatchingServices: 0x%08x", ret );
msg_Err( p_this, "IOServiceGetMatchingServices: 0x%08x", ret );
return( NULL );
}
......@@ -387,8 +387,7 @@ CDTOC *getTOC( const char *psz_dev )
if( ( ret = IORegistryEntryGetParentIterator( service,
kIOServicePlane, &iterator ) ) != KERN_SUCCESS )
{
//X intf_ErrMsg( "vcd error: "
//X "IORegistryEntryGetParentIterator: 0x%08x", ret );
msg_Err( p_this, "IORegistryEntryGetParentIterator: 0x%08x", ret );
IOObjectRelease( service );
return( NULL );
}
......@@ -400,7 +399,7 @@ CDTOC *getTOC( const char *psz_dev )
if( service == NULL )
{
//X intf_ErrMsg( "vcd error: search for kIOCDMediaClass came up empty" );
msg_Err( p_this, "search for kIOCDMediaClass came up empty" );
return( NULL );
}
......@@ -408,8 +407,7 @@ CDTOC *getTOC( const char *psz_dev )
if( ( ret = IORegistryEntryCreateCFProperties( service, &properties,
kCFAllocatorDefault, kNilOptions ) ) != KERN_SUCCESS )
{
//X intf_ErrMsg( "vcd error: "
//X " IORegistryEntryCreateCFProperties: 0x%08x", ret );
msg_Err( p_this, "IORegistryEntryCreateCFProperties: 0x%08x", ret );
IOObjectRelease( service );
return( NULL );
}
......@@ -431,7 +429,7 @@ CDTOC *getTOC( const char *psz_dev )
}
else
{
//X intf_ErrMsg( "vcd error: CFDictionaryGetValue failed" );
msg_Err( p_this, "CFDictionaryGetValue failed" );
}
CFRelease( properties );
......
......@@ -2,7 +2,7 @@
* cdrom.h: cdrom tools header
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.h,v 1.1 2002/08/04 17:23:42 sam Exp $
* $Id: cdrom.h,v 1.2 2002/08/08 22:28:22 sam Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
*
......@@ -31,7 +31,7 @@
/******************************************************************************
* Prototypes *
******************************************************************************/
int ioctl_GetTrackCount ( int, const char *psz_dev );
int * ioctl_GetSectors ( int, const char *psz_dev );
int ioctl_ReadSector ( int, int, byte_t * );
int ioctl_GetTrackCount ( vlc_object_t *, int, const char *psz_dev );
int * ioctl_GetSectors ( vlc_object_t *, int, const char *psz_dev );
int ioctl_ReadSector ( vlc_object_t *, int, int, byte_t * );
......@@ -2,7 +2,7 @@
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vcd.c,v 1.3 2002/08/08 00:35:10 sam Exp $
* $Id: vcd.c,v 1.4 2002/08/08 22:28:22 sam Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
*
......@@ -193,8 +193,8 @@ static int VCDOpen( vlc_object_t *p_this )
}