* ./modules/*: moved plugins to the new tree. Yet untested builds include
authorSam Hocevar <sam@videolan.org>
Sun, 4 Aug 2002 17:23:44 +0000 (17:23 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 4 Aug 2002 17:23:44 +0000 (17:23 +0000)
    waveout, directx, qnx, beos, win32, macosx, and the AltiVec modules.
  * ALL: removed mention of AC3 in favour of A52.
  * ./configure.in, ./Makefile*: modules can now be built deeper than 1
    directory. As a consequence, the build is even slower (but I'm fixing
    this) and make clean doesn't work anymore.

461 files changed:
Makefile
Makefile.modules
Makefile.opts.in
configure
configure.in
doc/mad/API [new file with mode: 0644]
doc/mad/BUGS [new file with mode: 0644]
doc/mad/DESIGN [new file with mode: 0644]
doc/mad/TODO [new file with mode: 0644]
doc/mad/joe_drew.txt [new file with mode: 0644]
doc/mad/rob_leslie.txt [new file with mode: 0644]
include/ac3_downmix.h [deleted file]
include/ac3_imdct.h [deleted file]
include/audio_output.h
include/input_ext-dec.h
include/input_ext-intf.h
modules/access/.cvsignore [new file with mode: 0644]
modules/access/Makefile [new file with mode: 0644]
modules/access/dvd/.cvsignore [new file with mode: 0644]
modules/access/dvd/Makefile [new file with mode: 0644]
modules/access/dvd/access.c [new file with mode: 0644]
modules/access/dvd/demux.c [new file with mode: 0644]
modules/access/dvd/dvd.c [new file with mode: 0644]
modules/access/dvd/dvd.h [new file with mode: 0644]
modules/access/dvd/dvdcss.h [new file with mode: 0644]
modules/access/dvd/es.c [new file with mode: 0644]
modules/access/dvd/es.h [new file with mode: 0644]
modules/access/dvd/ifo.c [new file with mode: 0644]
modules/access/dvd/ifo.h [new file with mode: 0644]
modules/access/dvd/seek.c [new file with mode: 0644]
modules/access/dvd/seek.h [new file with mode: 0644]
modules/access/dvd/summary.c [new file with mode: 0644]
modules/access/dvd/summary.h [new file with mode: 0644]
modules/access/dvd/udf.c [new file with mode: 0644]
modules/access/dvd/udf.h [new file with mode: 0644]
modules/access/dvdplay/.cvsignore [new file with mode: 0644]
modules/access/dvdplay/Makefile [new file with mode: 0644]
modules/access/dvdplay/access.c [new file with mode: 0644]
modules/access/dvdplay/access.h [new file with mode: 0644]
modules/access/dvdplay/demux.c [new file with mode: 0644]
modules/access/dvdplay/demux.h [new file with mode: 0644]
modules/access/dvdplay/dvd.c [new file with mode: 0644]
modules/access/dvdplay/dvd.h [new file with mode: 0644]
modules/access/dvdplay/es.c [new file with mode: 0644]
modules/access/dvdplay/es.h [new file with mode: 0644]
modules/access/dvdplay/intf.c [new file with mode: 0644]
modules/access/dvdplay/intf.h [new file with mode: 0644]
modules/access/dvdplay/tools.c [new file with mode: 0644]
modules/access/dvdplay/tools.h [new file with mode: 0644]
modules/access/dvdread/.cvsignore [new file with mode: 0644]
modules/access/dvdread/Makefile [new file with mode: 0644]
modules/access/dvdread/dvdread.c [new file with mode: 0644]
modules/access/dvdread/input.c [new file with mode: 0644]
modules/access/dvdread/input.h [new file with mode: 0644]
modules/access/file.c [new file with mode: 0644]
modules/access/http.c [new file with mode: 0644]
modules/access/satellite/.cvsignore [new file with mode: 0644]
modules/access/satellite/Makefile [new file with mode: 0644]
modules/access/satellite/access.c [new file with mode: 0644]
modules/access/satellite/dvb.c [new file with mode: 0644]
modules/access/satellite/dvb.h [new file with mode: 0644]
modules/access/satellite/satellite.c [new file with mode: 0644]
modules/access/udp.c [new file with mode: 0644]
modules/access/vcd/.cvsignore [new file with mode: 0644]
modules/access/vcd/Makefile [new file with mode: 0644]
modules/access/vcd/cdrom.c [new file with mode: 0644]
modules/access/vcd/cdrom.h [new file with mode: 0644]
modules/access/vcd/vcd.c [new file with mode: 0644]
modules/access/vcd/vcd.h [new file with mode: 0644]
modules/audio_output/alsa/.cvsignore [new file with mode: 0644]
modules/audio_output/alsa/Makefile [new file with mode: 0644]
modules/audio_output/alsa/alsa.c [new file with mode: 0644]
modules/audio_output/arts/.cvsignore [new file with mode: 0644]
modules/audio_output/arts/Makefile [new file with mode: 0644]
modules/audio_output/arts/arts.c [new file with mode: 0644]
modules/audio_output/dsp/.cvsignore [new file with mode: 0644]
modules/audio_output/dsp/Makefile [new file with mode: 0644]
modules/audio_output/dsp/dsp.c [new file with mode: 0644]
modules/audio_output/esd/.cvsignore [new file with mode: 0644]
modules/audio_output/esd/Makefile [new file with mode: 0644]
modules/audio_output/esd/esd.c [new file with mode: 0644]
modules/audio_output/waveout/.cvsignore [new file with mode: 0644]
modules/audio_output/waveout/Makefile [new file with mode: 0644]
modules/audio_output/waveout/waveout.c [new file with mode: 0644]
modules/codec/a52/.cvsignore [new file with mode: 0644]
modules/codec/a52/Makefile [new file with mode: 0644]
modules/codec/a52/a52.c [new file with mode: 0644]
modules/codec/a52/a52.h [new file with mode: 0644]
modules/codec/a52old/.cvsignore [new file with mode: 0644]
modules/codec/a52old/Makefile [new file with mode: 0644]
modules/codec/a52old/a52old.c [new file with mode: 0644]
modules/codec/a52old/adec.h [new file with mode: 0644]
modules/codec/a52old/bit_allocate.c [new file with mode: 0644]
modules/codec/a52old/decoder.c [new file with mode: 0644]
modules/codec/a52old/decoder.h [new file with mode: 0644]
modules/codec/a52old/downmix.h [new file with mode: 0644]
modules/codec/a52old/downmix/.cvsignore [new file with mode: 0644]
modules/codec/a52old/downmix/Makefile [new file with mode: 0644]
modules/codec/a52old/downmix/downmix.c [new file with mode: 0644]
modules/codec/a52old/downmix/downmix_3dn.c [new file with mode: 0644]
modules/codec/a52old/downmix/downmix_c.c [new file with mode: 0644]
modules/codec/a52old/downmix/downmix_common.h [new file with mode: 0644]
modules/codec/a52old/downmix/downmix_sse.c [new file with mode: 0644]
modules/codec/a52old/exponent.c [new file with mode: 0644]
modules/codec/a52old/exponent.h [new file with mode: 0644]
modules/codec/a52old/imdct.c [new file with mode: 0644]
modules/codec/a52old/imdct.h [new file with mode: 0644]
modules/codec/a52old/imdct/.cvsignore [new file with mode: 0644]
modules/codec/a52old/imdct/Makefile [new file with mode: 0644]
modules/codec/a52old/imdct/imdct.c [new file with mode: 0644]
modules/codec/a52old/imdct/imdct_3dn.c [new file with mode: 0644]
modules/codec/a52old/imdct/imdct_c.c [new file with mode: 0644]
modules/codec/a52old/imdct/imdct_common.c [new file with mode: 0644]
modules/codec/a52old/imdct/imdct_common.h [new file with mode: 0644]
modules/codec/a52old/imdct/imdct_sse.c [new file with mode: 0644]
modules/codec/a52old/imdct/retables.h [new file with mode: 0644]
modules/codec/a52old/imdct/srfft.h [new file with mode: 0644]
modules/codec/a52old/imdct/srfft_3dn.c [new file with mode: 0644]
modules/codec/a52old/imdct/srfft_c.c [new file with mode: 0644]
modules/codec/a52old/imdct/srfft_sse.c [new file with mode: 0644]
modules/codec/a52old/internal.h [new file with mode: 0644]
modules/codec/a52old/mantissa.c [new file with mode: 0644]
modules/codec/a52old/mantissa.h [new file with mode: 0644]
modules/codec/a52old/parse.c [new file with mode: 0644]
modules/codec/a52old/rematrix.c [new file with mode: 0644]
modules/codec/cinepak/.cvsignore [new file with mode: 0644]
modules/codec/cinepak/Makefile [new file with mode: 0644]
modules/codec/cinepak/cinepak.c [new file with mode: 0644]
modules/codec/cinepak/cinepak.h [new file with mode: 0644]
modules/codec/ffmpeg/.cvsignore [new file with mode: 0644]
modules/codec/ffmpeg/Makefile [new file with mode: 0644]
modules/codec/ffmpeg/ffmpeg.c [new file with mode: 0644]
modules/codec/ffmpeg/ffmpeg.h [new file with mode: 0644]
modules/codec/lpcm/.cvsignore [new file with mode: 0644]
modules/codec/lpcm/Makefile [new file with mode: 0644]
modules/codec/lpcm/lpcm.c [new file with mode: 0644]
modules/codec/lpcm/lpcm.h [new file with mode: 0644]
modules/codec/mad/.cvsignore [new file with mode: 0644]
modules/codec/mad/Makefile [new file with mode: 0644]
modules/codec/mad/decoder.c [new file with mode: 0644]
modules/codec/mad/decoder.h [new file with mode: 0644]
modules/codec/mad/libmad.c [new file with mode: 0644]
modules/codec/mad/libmad.h [new file with mode: 0644]
modules/codec/mpeg_audio/.cvsignore [new file with mode: 0644]
modules/codec/mpeg_audio/Makefile [new file with mode: 0644]
modules/codec/mpeg_audio/decoder.c [new file with mode: 0644]
modules/codec/mpeg_audio/decoder.h [new file with mode: 0644]
modules/codec/mpeg_audio/generic.c [new file with mode: 0644]
modules/codec/mpeg_audio/generic.h [new file with mode: 0644]
modules/codec/mpeg_audio/layer1.c [new file with mode: 0644]
modules/codec/mpeg_audio/layer1.h [new file with mode: 0644]
modules/codec/mpeg_audio/layer2.c [new file with mode: 0644]
modules/codec/mpeg_audio/layer2.h [new file with mode: 0644]
modules/codec/mpeg_audio/math.c [new file with mode: 0644]
modules/codec/mpeg_audio/math.h [new file with mode: 0644]
modules/codec/mpeg_audio/test.c [new file with mode: 0644]
modules/codec/mpeg_video/.cvsignore [new file with mode: 0644]
modules/codec/mpeg_video/Makefile [new file with mode: 0644]
modules/codec/mpeg_video/blocks.c [new file with mode: 0644]
modules/codec/mpeg_video/blocks.h [new file with mode: 0644]
modules/codec/mpeg_video/decoder.c [new file with mode: 0644]
modules/codec/mpeg_video/decoder.h [new file with mode: 0644]
modules/codec/mpeg_video/headers.c [new file with mode: 0644]
modules/codec/mpeg_video/idct/.cvsignore [new file with mode: 0644]
modules/codec/mpeg_video/idct/Makefile [new file with mode: 0644]
modules/codec/mpeg_video/idct/block_c.h [new file with mode: 0644]
modules/codec/mpeg_video/idct/block_mmx.h [new file with mode: 0644]
modules/codec/mpeg_video/idct/idct.c [new file with mode: 0644]
modules/codec/mpeg_video/idct/idct.h [new file with mode: 0644]
modules/codec/mpeg_video/idct/idct_decl.h [new file with mode: 0644]
modules/codec/mpeg_video/idct/idct_sparse.h [new file with mode: 0644]
modules/codec/mpeg_video/idct/idctaltivec.c [new file with mode: 0644]
modules/codec/mpeg_video/idct/idctclassic.c [new file with mode: 0644]
modules/codec/mpeg_video/idct/idctmmx.c [new file with mode: 0644]
modules/codec/mpeg_video/idct/idctmmxext.c [new file with mode: 0644]
modules/codec/mpeg_video/motion/.cvsignore [new file with mode: 0644]
modules/codec/mpeg_video/motion/Makefile [new file with mode: 0644]
modules/codec/mpeg_video/motion/motion.c [new file with mode: 0644]
modules/codec/mpeg_video/motion/motion3dnow.c [new file with mode: 0644]
modules/codec/mpeg_video/motion/motionaltivec.c [new file with mode: 0644]
modules/codec/mpeg_video/motion/motionmmx.c [new file with mode: 0644]
modules/codec/mpeg_video/motion/motionmmxext.c [new file with mode: 0644]
modules/codec/mpeg_video/parser.c [new file with mode: 0644]
modules/codec/mpeg_video/parser.h [new file with mode: 0644]
modules/codec/mpeg_video/pool.c [new file with mode: 0644]
modules/codec/mpeg_video/pool.h [new file with mode: 0644]
modules/codec/mpeg_video/synchro.c [new file with mode: 0644]
modules/codec/spdif/.cvsignore [new file with mode: 0644]
modules/codec/spdif/Makefile [new file with mode: 0644]
modules/codec/spdif/spdif.c [new file with mode: 0644]
modules/codec/spdif/spdif.h [new file with mode: 0644]
modules/codec/spudec/.cvsignore [new file with mode: 0644]
modules/codec/spudec/Makefile [new file with mode: 0644]
modules/codec/spudec/spudec.c [new file with mode: 0644]
modules/codec/spudec/spudec.h [new file with mode: 0644]
modules/control/lirc/.cvsignore [new file with mode: 0644]
modules/control/lirc/Makefile [new file with mode: 0644]
modules/control/lirc/lirc.c [new file with mode: 0644]
modules/control/rc/.cvsignore [new file with mode: 0644]
modules/control/rc/Makefile [new file with mode: 0644]
modules/control/rc/rc.c [new file with mode: 0644]
modules/demux/a52/.cvsignore [new file with mode: 0644]
modules/demux/a52/Makefile [new file with mode: 0644]
modules/demux/a52/demux.c [new file with mode: 0644]
modules/demux/avi/.cvsignore [new file with mode: 0644]
modules/demux/avi/Makefile [new file with mode: 0644]
modules/demux/avi/avi.c [new file with mode: 0644]
modules/demux/avi/avi.h [new file with mode: 0644]
modules/demux/avi/libioRIFF.c [new file with mode: 0644]
modules/demux/avi/libioRIFF.h [new file with mode: 0644]
modules/demux/mp4/.cvsignore [new file with mode: 0644]
modules/demux/mp4/Makefile [new file with mode: 0644]
modules/demux/mp4/libmp4.c [new file with mode: 0644]
modules/demux/mp4/libmp4.h [new file with mode: 0644]
modules/demux/mp4/mp4.c [new file with mode: 0644]
modules/demux/mp4/mp4.h [new file with mode: 0644]
modules/demux/mpeg/.cvsignore [new file with mode: 0644]
modules/demux/mpeg/Makefile [new file with mode: 0644]
modules/demux/mpeg/audio.c [new file with mode: 0644]
modules/demux/mpeg/es.c [new file with mode: 0644]
modules/demux/mpeg/ps.c [new file with mode: 0644]
modules/demux/mpeg/ts.c [new file with mode: 0644]
modules/gui/beos/.cvsignore [new file with mode: 0644]
modules/gui/beos/AudioOutput.cpp [new file with mode: 0644]
modules/gui/beos/BeOS.cpp [new file with mode: 0644]
modules/gui/beos/Bitmaps.h [new file with mode: 0644]
modules/gui/beos/DrawingTidbits.cpp [new file with mode: 0644]
modules/gui/beos/DrawingTidbits.h [new file with mode: 0644]
modules/gui/beos/Interface.cpp [new file with mode: 0644]
modules/gui/beos/InterfaceWindow.cpp [new file with mode: 0644]
modules/gui/beos/InterfaceWindow.h [new file with mode: 0644]
modules/gui/beos/Makefile [new file with mode: 0644]
modules/gui/beos/MediaControlView.cpp [new file with mode: 0644]
modules/gui/beos/MediaControlView.h [new file with mode: 0644]
modules/gui/beos/MsgVals.h [new file with mode: 0644]
modules/gui/beos/PlayListWindow.cpp [new file with mode: 0644]
modules/gui/beos/PlayListWindow.h [new file with mode: 0644]
modules/gui/beos/TransportButton.cpp [new file with mode: 0644]
modules/gui/beos/TransportButton.h [new file with mode: 0644]
modules/gui/beos/VideoOutput.cpp [new file with mode: 0644]
modules/gui/beos/VideoWindow.h [new file with mode: 0644]
modules/gui/beos/VlcWrapper.cpp [new file with mode: 0644]
modules/gui/beos/VlcWrapper.h [new file with mode: 0644]
modules/gui/familiar/.cvsignore [new file with mode: 0644]
modules/gui/familiar/Makefile [new file with mode: 0644]
modules/gui/familiar/callbacks.c [new file with mode: 0644]
modules/gui/familiar/callbacks.h [new file with mode: 0644]
modules/gui/familiar/familiar.c [new file with mode: 0644]
modules/gui/familiar/familiar.glade [new file with mode: 0644]
modules/gui/familiar/familiar.h [new file with mode: 0644]
modules/gui/familiar/interface.c [new file with mode: 0644]
modules/gui/familiar/interface.h [new file with mode: 0644]
modules/gui/familiar/support.c [new file with mode: 0644]
modules/gui/familiar/support.h [new file with mode: 0644]
modules/gui/gtk/.cvsignore [new file with mode: 0644]
modules/gui/gtk/Makefile [new file with mode: 0644]
modules/gui/gtk/common.h [new file with mode: 0644]
modules/gui/gtk/control.c [new file with mode: 0644]
modules/gui/gtk/control.h [new file with mode: 0644]
modules/gui/gtk/display.c [new file with mode: 0644]
modules/gui/gtk/display.h [new file with mode: 0644]
modules/gui/gtk/gnome.c [new file with mode: 0644]
modules/gui/gtk/gnome.glade [new file with mode: 0644]
modules/gui/gtk/gnome_callbacks.c [new file with mode: 0644]
modules/gui/gtk/gnome_callbacks.h [new file with mode: 0644]
modules/gui/gtk/gnome_interface.c [new file with mode: 0644]
modules/gui/gtk/gnome_interface.h [new file with mode: 0644]
modules/gui/gtk/gnome_support.c [new file with mode: 0644]
modules/gui/gtk/gnome_support.h [new file with mode: 0644]
modules/gui/gtk/gtk.c [new file with mode: 0644]
modules/gui/gtk/gtk.glade [new file with mode: 0644]
modules/gui/gtk/gtk_callbacks.c [new file with mode: 0644]
modules/gui/gtk/gtk_callbacks.h [new file with mode: 0644]
modules/gui/gtk/gtk_interface.c [new file with mode: 0644]
modules/gui/gtk/gtk_interface.h [new file with mode: 0644]
modules/gui/gtk/gtk_support.c [new file with mode: 0644]
modules/gui/gtk/gtk_support.h [new file with mode: 0644]
modules/gui/gtk/menu.c [new file with mode: 0644]
modules/gui/gtk/menu.h [new file with mode: 0644]
modules/gui/gtk/modules.c [new file with mode: 0644]
modules/gui/gtk/modules.h [new file with mode: 0644]
modules/gui/gtk/open.c [new file with mode: 0644]
modules/gui/gtk/open.h [new file with mode: 0644]
modules/gui/gtk/playlist.c [new file with mode: 0644]
modules/gui/gtk/playlist.h [new file with mode: 0644]
modules/gui/gtk/preferences.c [new file with mode: 0644]
modules/gui/gtk/preferences.h [new file with mode: 0644]
modules/gui/kde/.cvsignore [new file with mode: 0644]
modules/gui/kde/Makefile [new file with mode: 0644]
modules/gui/kde/QConfigItem.cpp [new file with mode: 0644]
modules/gui/kde/QConfigItem.h [new file with mode: 0644]
modules/gui/kde/common.h [new file with mode: 0644]
modules/gui/kde/disc.cpp [new file with mode: 0644]
modules/gui/kde/disc.h [new file with mode: 0644]
modules/gui/kde/interface.cpp [new file with mode: 0644]
modules/gui/kde/interface.h [new file with mode: 0644]
modules/gui/kde/kde.cpp [new file with mode: 0644]
modules/gui/kde/menu.cpp [new file with mode: 0644]
modules/gui/kde/menu.h [new file with mode: 0644]
modules/gui/kde/net.cpp [new file with mode: 0644]
modules/gui/kde/net.h [new file with mode: 0644]
modules/gui/kde/pluginsbox.cpp [new file with mode: 0644]
modules/gui/kde/pluginsbox.h [new file with mode: 0644]
modules/gui/kde/preferences.cpp [new file with mode: 0644]
modules/gui/kde/preferences.h [new file with mode: 0644]
modules/gui/kde/slider.cpp [new file with mode: 0644]
modules/gui/kde/slider.h [new file with mode: 0644]
modules/gui/kde/ui.rc [new file with mode: 0644]
modules/gui/macosx/.cvsignore [new file with mode: 0644]
modules/gui/macosx/Makefile [new file with mode: 0644]
modules/gui/macosx/aout.m [new file with mode: 0644]
modules/gui/macosx/controls.m [new file with mode: 0644]
modules/gui/macosx/intf.h [new file with mode: 0644]
modules/gui/macosx/intf.m [new file with mode: 0644]
modules/gui/macosx/macosx.m [new file with mode: 0644]
modules/gui/macosx/open.h [new file with mode: 0644]
modules/gui/macosx/open.m [new file with mode: 0644]
modules/gui/macosx/playlist.h [new file with mode: 0644]
modules/gui/macosx/playlist.m [new file with mode: 0644]
modules/gui/macosx/vout.h [new file with mode: 0644]
modules/gui/macosx/vout.m [new file with mode: 0644]
modules/gui/ncurses/.cvsignore [new file with mode: 0644]
modules/gui/ncurses/Makefile [new file with mode: 0644]
modules/gui/ncurses/ncurses.c [new file with mode: 0644]
modules/gui/qnx/.cvsignore [new file with mode: 0644]
modules/gui/qnx/Makefile [new file with mode: 0644]
modules/gui/qnx/aout.c [new file with mode: 0644]
modules/gui/qnx/qnx.c [new file with mode: 0644]
modules/gui/qnx/vout.c [new file with mode: 0644]
modules/gui/qt/.cvsignore [new file with mode: 0644]
modules/gui/qt/Makefile [new file with mode: 0644]
modules/gui/qt/intf.cpp [new file with mode: 0644]
modules/gui/qt/qt.cpp [new file with mode: 0644]
modules/gui/win32/.cvsignore [new file with mode: 0644]
modules/gui/win32/Makefile [new file with mode: 0644]
modules/gui/win32/about.cpp [new file with mode: 0644]
modules/gui/win32/about.dfm [new file with mode: 0644]
modules/gui/win32/about.h [new file with mode: 0644]
modules/gui/win32/control.cpp [new file with mode: 0644]
modules/gui/win32/control.h [new file with mode: 0644]
modules/gui/win32/disc.cpp [new file with mode: 0644]
modules/gui/win32/disc.dfm [new file with mode: 0644]
modules/gui/win32/disc.h [new file with mode: 0644]
modules/gui/win32/intfwin.bpf [new file with mode: 0644]
modules/gui/win32/intfwin.cpp [new file with mode: 0644]
modules/gui/win32/mainframe.cpp [new file with mode: 0644]
modules/gui/win32/mainframe.dfm [new file with mode: 0644]
modules/gui/win32/mainframe.h [new file with mode: 0644]
modules/gui/win32/menu.cpp [new file with mode: 0644]
modules/gui/win32/menu.h [new file with mode: 0644]
modules/gui/win32/messages.cpp [new file with mode: 0644]
modules/gui/win32/messages.dfm [new file with mode: 0644]
modules/gui/win32/messages.h [new file with mode: 0644]
modules/gui/win32/network.cpp [new file with mode: 0644]
modules/gui/win32/network.dfm [new file with mode: 0644]
modules/gui/win32/network.h [new file with mode: 0644]
modules/gui/win32/playlist.cpp [new file with mode: 0644]
modules/gui/win32/playlist.dfm [new file with mode: 0644]
modules/gui/win32/playlist.h [new file with mode: 0644]
modules/gui/win32/preferences.cpp [new file with mode: 0644]
modules/gui/win32/preferences.dfm [new file with mode: 0644]
modules/gui/win32/preferences.h [new file with mode: 0644]
modules/gui/win32/win32.bpr [new file with mode: 0644]
modules/gui/win32/win32.cpp [new file with mode: 0644]
modules/gui/win32/win32.h [new file with mode: 0644]
modules/gui/win32/win32_common.h [new file with mode: 0644]
modules/misc/dummy/.cvsignore [new file with mode: 0644]
modules/misc/dummy/Makefile [new file with mode: 0644]
modules/misc/dummy/aout.c [new file with mode: 0644]
modules/misc/dummy/decoder.c [new file with mode: 0644]
modules/misc/dummy/dummy.c [new file with mode: 0644]
modules/misc/dummy/dummy.h [new file with mode: 0644]
modules/misc/dummy/input.c [new file with mode: 0644]
modules/misc/dummy/interface.c [new file with mode: 0644]
modules/misc/dummy/vout.c [new file with mode: 0644]
modules/misc/logger/.cvsignore [new file with mode: 0644]
modules/misc/logger/Makefile [new file with mode: 0644]
modules/misc/logger/logger.c [new file with mode: 0644]
modules/misc/memcpy/.cvsignore [new file with mode: 0644]
modules/misc/memcpy/Makefile [new file with mode: 0644]
modules/misc/memcpy/fastmemcpy.h [new file with mode: 0644]
modules/misc/memcpy/memcpy.c [new file with mode: 0644]
modules/misc/memcpy/memcpyaltivec.c [new file with mode: 0644]
modules/misc/network/.cvsignore [new file with mode: 0644]
modules/misc/network/Makefile [new file with mode: 0644]
modules/misc/network/ipv4.c [new file with mode: 0644]
modules/misc/network/ipv6.c [new file with mode: 0644]
modules/misc/null/.cvsignore [new file with mode: 0644]
modules/misc/null/Makefile [new file with mode: 0644]
modules/misc/null/null.c [new file with mode: 0644]
modules/video_chroma/.cvsignore [new file with mode: 0644]
modules/video_chroma/Makefile [new file with mode: 0644]
modules/video_chroma/i420_rgb.c [new file with mode: 0644]
modules/video_chroma/i420_rgb.h [new file with mode: 0644]
modules/video_chroma/i420_rgb16.c [new file with mode: 0644]
modules/video_chroma/i420_rgb8.c [new file with mode: 0644]
modules/video_chroma/i420_rgb_c.h [new file with mode: 0644]
modules/video_chroma/i420_rgb_mmx.h [new file with mode: 0644]
modules/video_chroma/i420_ymga.c [new file with mode: 0644]
modules/video_chroma/i420_yuy2.c [new file with mode: 0644]
modules/video_chroma/i420_yuy2.h [new file with mode: 0644]
modules/video_chroma/i422_yuy2.c [new file with mode: 0644]
modules/video_chroma/i422_yuy2.h [new file with mode: 0644]
modules/video_filter/.cvsignore [new file with mode: 0644]
modules/video_filter/Makefile [new file with mode: 0644]
modules/video_filter/clone.c [new file with mode: 0644]
modules/video_filter/crop.c [new file with mode: 0644]
modules/video_filter/deinterlace/.cvsignore [new file with mode: 0644]
modules/video_filter/deinterlace/Makefile [new file with mode: 0644]
modules/video_filter/deinterlace/deinterlace.c [new file with mode: 0644]
modules/video_filter/distort.c [new file with mode: 0644]
modules/video_filter/filter_common.h [new file with mode: 0644]
modules/video_filter/invert.c [new file with mode: 0644]
modules/video_filter/transform.c [new file with mode: 0644]
modules/video_filter/wall.c [new file with mode: 0644]
modules/video_output/aa/.cvsignore [new file with mode: 0644]
modules/video_output/aa/Makefile [new file with mode: 0644]
modules/video_output/aa/aa.c [new file with mode: 0644]
modules/video_output/directx/.cvsignore [new file with mode: 0644]
modules/video_output/directx/Makefile [new file with mode: 0644]
modules/video_output/directx/aout.c [new file with mode: 0644]
modules/video_output/directx/directx.c [new file with mode: 0644]
modules/video_output/directx/events.c [new file with mode: 0644]
modules/video_output/directx/vout.c [new file with mode: 0644]
modules/video_output/directx/vout.h [new file with mode: 0644]
modules/video_output/fb/.cvsignore [new file with mode: 0644]
modules/video_output/fb/Makefile [new file with mode: 0644]
modules/video_output/fb/fb.c [new file with mode: 0644]
modules/video_output/ggi/.cvsignore [new file with mode: 0644]
modules/video_output/ggi/Makefile [new file with mode: 0644]
modules/video_output/ggi/ggi.c [new file with mode: 0644]
modules/video_output/glide/.cvsignore [new file with mode: 0644]
modules/video_output/glide/Makefile [new file with mode: 0644]
modules/video_output/glide/glide.c [new file with mode: 0644]
modules/video_output/mga/.cvsignore [new file with mode: 0644]
modules/video_output/mga/Makefile [new file with mode: 0644]
modules/video_output/mga/mga.c [new file with mode: 0644]
modules/video_output/mga/xmga.c [new file with mode: 0644]
modules/video_output/sdl/.cvsignore [new file with mode: 0644]
modules/video_output/sdl/Makefile [new file with mode: 0644]
modules/video_output/sdl/aout.c [new file with mode: 0644]
modules/video_output/sdl/sdl.c [new file with mode: 0644]
modules/video_output/sdl/vout.c [new file with mode: 0644]
modules/video_output/x11/.cvsignore [new file with mode: 0644]
modules/video_output/x11/Makefile [new file with mode: 0644]
modules/video_output/x11/x11.c [new file with mode: 0644]
modules/video_output/x11/xcommon.c [new file with mode: 0644]
modules/video_output/x11/xcommon.h [new file with mode: 0644]
modules/video_output/x11/xvideo.c [new file with mode: 0644]
modules/visualization/scope/.cvsignore [new file with mode: 0644]
modules/visualization/scope/Makefile [new file with mode: 0644]
modules/visualization/scope/scope.c [new file with mode: 0644]
modules/visualization/xosd/.cvsignore [new file with mode: 0644]
modules/visualization/xosd/Makefile [new file with mode: 0644]
modules/visualization/xosd/xosd.c [new file with mode: 0644]
src/audio_output/aout_spdif.c
src/audio_output/aout_spdif.h
src/audio_output/audio_output.c
src/input/mpeg_system.c
src/libvlc.h
src/misc/modules.c

index ea4b1f7..4798c7d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,165 +13,6 @@ endif
 # Objects and files
 ###############################################################################
 
-# 
-# All possible plugin directories, needed for make clean
-#
-PLUGINS_DIR := a52 \
-               a52_system \
-               aa \
-               ac3_adec \
-               ac3_spdif \
-               access \
-               alsa \
-               arts \
-               avi \
-               beos \
-               chroma \
-               cinepak \
-               directx \
-               downmix \
-               dsp \
-               dummy \
-               dvd \
-               dvdread \
-               dvdplay \
-               esd \
-               familiar \
-               fb \
-               ffmpeg \
-               mp4 \
-               filter \
-               fx \
-               ggi \
-               glide \
-               gtk \
-               idct \
-               imdct \
-               kde \
-               lirc \
-               lpcm_adec \
-               macosx \
-               mad \
-               memcpy \
-               mga \
-               motion \
-               mpeg_system \
-               mpeg_adec \
-               mpeg_vdec \
-               mp4 \
-               network \
-               ogg \
-               qnx \
-               qt \
-               satellite \
-               sdl \
-               spudec \
-               text \
-               vcd \
-               win32 \
-               x11 \
-               xosd
-
-PLUGINS_TARGETS := a52/a52 \
-               aa/aa \
-               a52_system/a52_system \
-               ac3_adec/ac3_adec \
-               ac3_spdif/ac3_spdif \
-               access/file \
-               access/udp \
-               access/http \
-               alsa/alsa \
-               arts/arts \
-               avi/avi \
-               beos/beos \
-               chroma/chroma_i420_rgb \
-               chroma/chroma_i420_rgb_mmx \
-               chroma/chroma_i420_yuy2 \
-               chroma/chroma_i420_yuy2_mmx \
-               chroma/chroma_i422_yuy2 \
-               chroma/chroma_i422_yuy2_mmx \
-               chroma/chroma_i420_ymga \
-               chroma/chroma_i420_ymga_mmx \
-               cinepak/cinepak \
-               directx/directx \
-               downmix/downmix \
-               downmix/downmixsse \
-               downmix/downmix3dn \
-               dsp/dsp \
-               dummy/dummy \
-               dummy/null \
-               dvd/dvd \
-               dvdread/dvdread \
-               dvdplay/dvdplay \
-               esd/esd \
-               familiar/familiar \
-               fb/fb \
-               ffmpeg/ffmpeg \
-               mp4/mp4 \
-               filter/filter_clone \
-               filter/filter_crop \
-               filter/filter_deinterlace \
-               filter/filter_distort \
-               filter/filter_invert \
-               filter/filter_transform \
-               filter/filter_wall \
-               filter/filter_clone \
-               fx/fx_scope \
-               ggi/ggi \
-               glide/glide \
-               gtk/gnome \
-               gtk/gtk \
-               idct/idct \
-               idct/idctclassic \
-               idct/idctmmx \
-               idct/idctmmxext \
-               idct/idctaltivec \
-               imdct/imdct \
-               imdct/imdct3dn \
-               imdct/imdctsse \
-               kde/kde \
-               lirc/lirc \
-               lpcm_adec/lpcm_adec \
-               macosx/macosx \
-               mad/mad \
-               memcpy/memcpy \
-               memcpy/memcpymmx \
-               memcpy/memcpymmxext \
-               memcpy/memcpy3dn \
-               memcpy/memcpyaltivec \
-               mga/mga \
-               mga/xmga \
-               motion/motion \
-               motion/motionmmx \
-               motion/motionmmxext \
-               motion/motion3dnow \
-               motion/motionaltivec \
-               mpeg_system/mpeg_audio \
-               mpeg_system/mpeg_es \
-               mpeg_system/mpeg_ps \
-               mpeg_system/mpeg_ts \
-               mpeg_system/mpeg_ts_dvbpsi \
-               mpeg_adec/mpeg_adec \
-               mpeg_vdec/mpeg_vdec \
-               mp4/mp4 \
-               network/ipv4 \
-               network/ipv6 \
-               ogg/vorbis \
-               qnx/qnx \
-               qt/qt \
-               satellite/satellite \
-               sdl/sdl \
-               spudec/spudec \
-               text/logger \
-               text/ncurses \
-               text/rc \
-               vcd/vcd \
-               win32/waveout \
-               win32/intfwin \
-               x11/x11 \
-               x11/xvideo \
-               xosd/xosd
-
 #
 # C Objects
 # 
@@ -238,10 +79,10 @@ CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
 # Translate plugin names
 #
 ifneq (,$(PLUGINS))
-PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
+PLUGIN_OBJ := $(PLUGINS:%=modules/%.so)
 endif
 ifneq (,$(BUILTINS))
-BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
+BUILTIN_OBJ := $(BUILTINS:%=modules/%.a)
 endif
 
 #
@@ -295,9 +136,9 @@ po-clean:
 
 plugins-clean:
        for dir in $(PLUGINS_DIR) ; do \
-               ( cd plugins/$${dir} \
+               ( cd modules/$${dir} \
                        && $(MAKE) -f ../../Makefile.modules clean ) ; done
-       rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
+       rm -f modules/**/*.o modules/**/*.lo modules/**/*.moc modules/**/*.bak
 
 vlc-clean:
        rm -f $(C_OBJ) $(CPP_OBJ)
@@ -348,7 +189,7 @@ endif
 plugins-install:
        mkdir -p $(DESTDIR)$(libdir)/vlc
 ifneq (,$(PLUGINS))
-       $(INSTALL) $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
+       $(INSTALL) $(PLUGINS:%=modules/%.so) $(DESTDIR)$(libdir)/vlc
 endif
 
 plugins-uninstall:
@@ -357,7 +198,7 @@ plugins-uninstall:
 builtins-install:
        mkdir -p $(DESTDIR)$(libdir)/vlc
 ifneq (,$(BUILTINS))
-       $(INSTALL) -m 644 $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
+       $(INSTALL) -m 644 $(BUILTINS:%=modules/%.a) $(DESTDIR)$(libdir)/vlc
 endif
 
 builtins-uninstall:
@@ -410,13 +251,13 @@ dist:
        find debian -mindepth 1 -maxdepth 1 -type d | \
                while read i ; do rm -Rf tmp/vlc/$$i ; done
        # Copy .c .h .in .cpp .m and .glade files
-       find include src plugins -type f -name '*.[bcdhigmrst]*' | while read i ; \
+       find include src modules -type f -name '*.[bcdhigmrst]*' | while read i ; \
                do cp $$i tmp/vlc/$$i ; done
        # Grmbl... special case...
        for i in API BUGS DESIGN TODO ; \
-               do cp plugins/mad/$$i tmp/vlc/plugins/mad ; done
+               do cp modules/mad/$$i tmp/vlc/modules/mad ; done
        # Copy plugin Makefiles
-       find plugins -type f -name Makefile | while read i ; \
+       find modules -type f -name Makefile | while read i ; \
                do cp $$i tmp/vlc/$$i ; done
        # Copy extra programs and documentation
        cp -a extras/* tmp/vlc/extras
@@ -472,12 +313,12 @@ package-win32:
        for file in AUTHORS COPYING ChangeLog README FAQ TODO ; \
                        do cp $$file tmp/$${file}.txt ; \
                        unix2dos tmp/$${file}.txt ; done
-       mkdir tmp/plugins
-       cp $(PLUGINS:%=plugins/%.so) tmp/plugins/ 
+       mkdir tmp/modules
+       cp $(PLUGINS:%=modules/%.so) tmp/modules/ 
        # don't include these two
-       #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
+       #rm -f tmp/modules/gtk.so tmp/modules/sdl.so
 ifneq (,$(PLUGINS))
-       for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/plugins/$$i.so ; fi ; done
+       for i in $(PLUGINS) ; do if test $$i != intfwin ; then $(STRIP) tmp/modules/$$i.so ; fi ; done
 endif
        mkdir tmp/share
        for file in default8x16.psf default8x9.psf ; \
@@ -504,9 +345,9 @@ package-beos:
        cp AUTHORS COPYING ChangeLog README FAQ TODO tmp/vlc/
        for file in default8x16.psf default8x9.psf ; \
                do cp share/$$file tmp/vlc/share/ ; done
-       mkdir tmp/vlc/plugins
-       cp $(PLUGINS:%=plugins/%.so) tmp/vlc/plugins/ 
-       strip $(PLUGINS:%=tmp/vlc/plugins/%.so)
+       mkdir tmp/vlc/modules
+       cp $(PLUGINS:%=modules/%.so) tmp/vlc/modules/ 
+       strip $(PLUGINS:%=tmp/vlc/modules/%.so)
        # Create package 
        mv tmp/vlc tmp/vlc-${VERSION}
        (cd tmp ; find vlc-${VERSION} | \
@@ -546,10 +387,10 @@ ifneq (,$(findstring darwin,$(SYS)))
        cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t' | grep -v "^$$"
        cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
        $(INSTALL) -d vlc.app/Contents/MacOS/share
-       $(INSTALL) -d vlc.app/Contents/MacOS/plugins
+       $(INSTALL) -d vlc.app/Contents/MacOS/modules
        $(INSTALL) vlc vlc.app/Contents/MacOS/
 ifneq (,$(PLUGINS))
-       $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
+       $(INSTALL) $(PLUGINS:%=modules/%.so) vlc.app/Contents/MacOS/modules
 endif
        $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
 endif
@@ -564,7 +405,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__"$$i"( module_t* );" >>$@; \
+               echo "int vlc_entry__"`basename $$i`"( module_t* );" >>$@; \
        done
        @echo "" >> $@ ;
 endif
@@ -573,7 +414,7 @@ endif
        @echo "    { \\" >> $@ ;
 ifneq (,$(BUILTINS))
        @for i in $(BUILTINS) ; do \
-               echo "        ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
+               echo "        ALLOCATE_BUILTIN("`basename $$i`"); \\" >> $@ ; \
        done
 endif
        @echo "    } while( 0 );" >> $@ ;
@@ -634,19 +475,11 @@ lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
 #lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
 #      $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
 
-#
-# Plugins target
-#
+builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
-$(PLUGIN_OBJ): $(H_OBJ) FORCE
-       @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
 
-#
-# Built-in modules target
-#
-builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
-$(BUILTIN_OBJ): $(H_OBJ) FORCE
-       @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
+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@')
 
 #
 # Mozilla plugin target
index 5a04c8d..3d9f603 100644 (file)
@@ -13,7 +13,7 @@ include Makefile
 #
 # Analyze the target we are asked to build
 #
-module_name := $(shell echo $(MAKECMDGOALS) | sed 's@.*/\(.*\)\..*@\1@')
+module_name := $(shell echo $(MAKECMDGOALS) | sed 's@\..*@@')
 suff := $(shell echo $(MAKECMDGOALS) | sed 's@.*\.@@' | tr so/a lo/o)
 
 #
@@ -23,6 +23,9 @@ SRC_C := $(filter %.c,$($(module_name)_SOURCES))
 SRC_CPP := $(filter %.cpp,$($(module_name)_SOURCES))
 SRC_M := $(filter %.m,$($(module_name)_SOURCES))
 
+plugins_CFLAGS += -D__PLUGIN__ -I$(PARENT)/include -I$(PARENT)/extras
+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) \
@@ -57,17 +60,17 @@ clean:
 
 FORCE:
 
-$(OBJ_ALL): ../../Makefile.modules ../../Makefile.dep ../../Makefile ../../Makefile.opts Makefile
-$(OBJ_ALL): $(H_DEP:%=../../include/%)
+$(OBJ_ALL): $(PARENT)/Makefile.modules $(PARENT)/Makefile.dep $(PARENT)/Makefile $(PARENT)/Makefile.opts Makefile
+$(OBJ_ALL): $(H_DEP:%=$(PARENT)/include/%)
 
 $(C_DEP): %.d: FORCE
-       @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
+       @$(MAKE) -s --no-print-directory -f $(PARENT)/Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
 
 $(CPP_DEP): %.dpp: FORCE
-       @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
+       @$(MAKE) -s --no-print-directory -f $(PARENT)/Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
 
 $(M_DEP): %.dm: FORCE
-       @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
+       @$(MAKE) -s --no-print-directory -f $(PARENT)/Makefile.dep $@ CFLAGS="$(CFLAGS) $(extra_CFLAGS)"
 
 $(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): .dep/%.d
 $(SRC_C:%.c=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.c
@@ -83,10 +86,10 @@ $(SRC_M:%.m=%.$(suff).$(module_name)): %.$(suff).$(module_name): %.m
 
 # foo_CUSTOM lets us override all target rules for foo.so and foo.a
 ifeq (,$($(module_name)_CUSTOM))
-../$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL)
+$(module_name).so: $(EXTRA_DEP) $(OBJ_ALL)
        $(CC) $(OBJ_ALL) $(LDFLAGS) $(plugins_LDFLAGS) $($(module_name)_LDFLAGS) -o $@
 
-../$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL)
+$(module_name).a: $(EXTRA_DEP) $(OBJ_ALL)
        rm -f $@
        ar rc $@ $(OBJ_ALL)
        $(RANLIB) $@
index f9d6de8..768ed80 100644 (file)
@@ -60,7 +60,7 @@ mozilla_CFLAGS = @mozilla_CFLAGS@
 
 a52_CFLAGS = @a52_CFLAGS@
 arts_CFLAGS = @arts_CFLAGS@
-chroma_i420_yuy2_mmx_CFLAGS = @chroma_i420_yuy2_mmx_CFLAGS@
+i420_yuy2_mmx_CFLAGS = @i420_yuy2_mmx_CFLAGS@
 directx_CFLAGS = @directx_CFLAGS@
 dvd_CFLAGS = @dvd_CFLAGS@
 dvdread_CFLAGS = @dvdread_CFLAGS@
@@ -76,7 +76,7 @@ kde_CFLAGS = @kde_CFLAGS@
 mad_CFLAGS = @mad_CFLAGS@
 memcpyaltivec_CFLAGS = @memcpyaltivec_CFLAGS@
 motionaltivec_CFLAGS = @motionaltivec_CFLAGS@
-mpeg_ts_dvbpsi_CFLAGS = @mpeg_ts_dvbpsi_CFLAGS@
+ts_dvbpsi_CFLAGS = @ts_dvbpsi_CFLAGS@
 qt_CFLAGS = @qt_CFLAGS@
 sdl_CFLAGS = @sdl_CFLAGS@
 x11_CFLAGS = @x11_CFLAGS@
@@ -95,7 +95,7 @@ aa_LDFLAGS = @aa_LDFLAGS@
 alsa_LDFLAGS = @alsa_LDFLAGS@
 arts_LDFLAGS = @arts_LDFLAGS@
 beos_LDFLAGS = @beos_LDFLAGS@
-chroma_i420_rgb_LDFLAGS = @chroma_i420_rgb_LDFLAGS@
+i420_rgb_LDFLAGS = @i420_rgb_LDFLAGS@
 directx_LDFLAGS = @directx_LDFLAGS@
 dsp_LDFLAGS = @dsp_LDFLAGS@
 dvd_LDFLAGS = @dvd_LDFLAGS@
@@ -103,7 +103,7 @@ dvdread_LDFLAGS = @dvdread_LDFLAGS@
 dvdplay_LDFLAGS = @dvdplay_LDFLAGS@
 esd_LDFLAGS = @esd_LDFLAGS@
 familiar_LDFLAGS = @familiar_LDFLAGS@
-filter_distort_LDFLAGS = @filter_distort_LDFLAGS@
+distort_LDFLAGS = @distort_LDFLAGS@
 ffmpeg_LDFLAGS = @ffmpeg_LDFLAGS@
 mp4_LDFLAGS = @mp4_LDFLAGS@
 ggi_LDFLAGS = @ggi_LDFLAGS@
@@ -123,7 +123,7 @@ macosx_LDFLAGS = @macosx_LDFLAGS@
 mad_LDFLAGS = @mad_LDFLAGS@
 memcpyaltivec_LDFLAGS = @memcpyaltivec_LDFLAGS@
 motionaltivec_LDFLAGS = @motionaltivec_LDFLAGS@
-mpeg_ts_dvbpsi_LDFLAGS = @mpeg_ts_dvbpsi_LDFLAGS@
+ts_dvbpsi_LDFLAGS = @ts_dvbpsi_LDFLAGS@
 ncurses_LDFLAGS = @ncurses_LDFLAGS@
 qnx_LDFLAGS = @qnx_LDFLAGS@
 qt_LDFLAGS = @qt_LDFLAGS@
@@ -250,16 +250,10 @@ endif
 endif
 endif
 
-#
-# C compiler flags: plugins and builtins compilation
-#
-plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras
-builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras
-
 #
 # Linker flags: plugins and builtins linking
 #
-builtins_LDFLAGS += $(patsubst %,$$%_LDFLAGS,$(BUILTINS))
+builtins_LDFLAGS += $(patsubst %,$$%_LDFLAGS,$(shell echo $(BUILTINS) | sed -e 's@\([^ ]*/\)*@@g'))
 
 #
 # Debugging and profiling support
index 782b5c1..d3ee733 100755 (executable)
--- a/configure
+++ b/configure
@@ -5386,7 +5386,7 @@ echo "$ac_t""$ac_cv_c_omit_frame_pointer" 1>&6
 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
-    chroma_i420_yuy2_mmx_CFLAGS="${chroma_i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
+    i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
 fi
 
 echo $ac_n "checking if \$CC accepts -bundle -undefined error -lcc_dynamic""... $ac_c" 1>&6
@@ -5532,29 +5532,35 @@ case "x${target_cpu}" in
 esac
 
 BUILTINS="${BUILTINS}"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
-
-MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
-MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
-THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
-SSE_MODULES="imdctsse downmixsse"
-ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
+PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
+PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
+PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/ps demux/mpeg/ts"
+PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/mpeg_video/mpeg_video codec/lpcm/lpcm codec/spdif/spdif codec/spudec/spudec"
+PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
+PLUGINS="${PLUGINS} visualization/scope/scope"
+PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
+
+MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
+MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
+THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
+SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
+ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:5545: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:5551: checking if \$CC groks MMX inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5551 "configure"
+#line 5557 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmx_inline=yes
 else
@@ -5572,20 +5578,20 @@ if test "x${ac_cv_mmx_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
-echo "configure:5576: checking if \$CC groks MMX EXT inline assembly" >&5
+echo "configure:5582: checking if \$CC groks MMX EXT inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5582 "configure"
+#line 5588 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmxext_inline=yes
 else
@@ -5603,20 +5609,20 @@ if test "x${ac_cv_mmxext_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
-echo "configure:5607: checking if \$CC groks 3D Now! inline assembly" >&5
+echo "configure:5613: checking if \$CC groks 3D Now! inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5613 "configure"
+#line 5619 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_3dnow_inline=yes
 else
@@ -5638,20 +5644,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
-echo "configure:5642: checking if \$CC groks SSE inline assembly" >&5
+echo "configure:5648: checking if \$CC groks SSE inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5648 "configure"
+#line 5654 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sse_inline=yes
 else
@@ -5676,20 +5682,20 @@ fi
 # we should be able to remove this test with future versions of mingw32
 if test "x${SYS}" != "xmingw32"; then
 echo $ac_n "checking if \$CC groks AltiVec inline assembly""... $ac_c" 1>&6
-echo "configure:5680: checking if \$CC groks AltiVec inline assembly" >&5
+echo "configure:5686: checking if \$CC groks AltiVec inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5686 "configure"
+#line 5692 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline=yes
 else
@@ -5698,14 +5704,14 @@ else
   rm -rf conftest*
   CFLAGS="${save_CFLAGS} -Wa,-m7400"
           cat > conftest.$ac_ext <<EOF
-#line 5702 "configure"
+#line 5708 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline="-Wa,-m7400"
 else
@@ -5736,21 +5742,21 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks AltiVec C extensions""... $ac_c" 1>&6
-echo "configure:5740: checking if \$CC groks AltiVec C extensions" >&5
+echo "configure:5746: checking if \$CC groks AltiVec C extensions" >&5
 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -faltivec"
      # Darwin test
      cat > conftest.$ac_ext <<EOF
-#line 5747 "configure"
+#line 5753 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec=-faltivec
 else
@@ -5761,14 +5767,14 @@ else
         # Linux/PPC test
         CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
         cat > conftest.$ac_ext <<EOF
-#line 5765 "configure"
+#line 5771 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec="-fvec"
 else
@@ -5798,20 +5804,20 @@ EOF
 fi
 
 echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
-echo "configure:5802: checking if linker needs -framework vecLib" >&5
+echo "configure:5808: checking if linker needs -framework vecLib" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
      cat > conftest.$ac_ext <<EOF
-#line 5808 "configure"
+#line 5814 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_altivec=yes
 else
@@ -5943,17 +5949,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5947: checking for $ac_hdr" >&5
+echo "configure:5953: 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 5952 "configure"
+#line 5958 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5963: \"$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*
@@ -5973,7 +5979,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
-  PLUGINS="${PLUGINS} dvd"
+  PLUGINS="${PLUGINS} access/dvd/dvd"
           dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" 
 else
   echo "$ac_t""no" 1>&6
@@ -5984,7 +5990,7 @@ done
 
     else
       echo $ac_n "checking for libdvdcss.a in ${with_dvdcss_tree}""... $ac_c" 1>&6
-echo "configure:5988: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
+echo "configure:5994: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
       if test "x${real_dvdcss_tree}" = "x"
       then
@@ -5994,7 +6000,7 @@ echo "configure:5988: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
       if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
       then
                 echo "$ac_t""${real_dvdcss_tree}/src/.libs/libdvdcss.a" 1>&6
-        BUILTINS="${BUILTINS} dvd"
+        BUILTINS="${BUILTINS} access/dvd/dvd"
         dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
         dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
       else
@@ -6004,17 +6010,17 @@ echo "configure:5988: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
     fi
   ;;
   xno)
-        PLUGINS="${PLUGINS} dvd"
+        PLUGINS="${PLUGINS} access/dvd/dvd"
     dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
     dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
   ;;
   *)
     echo $ac_n "checking for dvdcss headers in ${with_dvdcss}""... $ac_c" 1>&6
-echo "configure:6014: checking for dvdcss headers in ${with_dvdcss}" >&5
+echo "configure:6020: checking for dvdcss headers in ${with_dvdcss}" >&5
     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
     then
             echo "$ac_t""yes" 1>&6
-      PLUGINS="${PLUGINS} dvd"
+      PLUGINS="${PLUGINS} access/dvd/dvd"
       dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
       dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
     else
@@ -6052,17 +6058,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6056: checking for $ac_hdr" >&5
+echo "configure:6062: 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 6061 "configure"
+#line 6067 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6072: \"$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*
@@ -6084,17 +6090,17 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
      cat > conftest.$ac_ext <<EOF
-#line 6088 "configure"
+#line 6094 "configure"
 #include "confdefs.h"
 #include <dvdread/dvd_reader.h>
 int main() {
 void foo() { int i=DVD_VIDEO_LB_LEN; }
 ; return 0; }
 EOF
-if { (eval echo configure:6095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
-          PLUGINS="${PLUGINS} dvdread"
+          PLUGINS="${PLUGINS} access/dvdread/dvdread"
           dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
           dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
         
@@ -6156,17 +6162,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6160: checking for $ac_hdr" >&5
+echo "configure:6166: 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 6165 "configure"
+#line 6171 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6176: \"$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*
@@ -6187,7 +6193,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-      PLUGINS="${PLUGINS} dvdplay"
+      PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
       dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
       dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
     
@@ -6238,17 +6244,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6242: checking for $ac_hdr" >&5
+echo "configure:6248: 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 6247 "configure"
+#line 6253 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6258: \"$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*
@@ -6268,8 +6274,8 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
-  PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
-          mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" 
+  PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
+          ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" 
 else
   echo "$ac_t""no" 1>&6
 fi
@@ -6277,7 +6283,7 @@ done
 
     else
       echo $ac_n "checking for libdvbpsi.a in ${with_dvbpsi_tree}""... $ac_c" 1>&6
-echo "configure:6281: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
+echo "configure:6287: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
       if test "x${real_dvbpsi_tree}" = "x"
       then
@@ -6287,9 +6293,9 @@ echo "configure:6281: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
       then
                 echo "$ac_t""${real_dvbpsi_tree}/src/.libs/libdvbpsi.a" 1>&6
-        BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
-        mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
-        mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
+        BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
+        ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+        ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
       else
                 echo "$ac_t""no" 1>&6
         { echo "configure: error: cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}" 1>&2; exit 1; }
@@ -6300,7 +6306,7 @@ echo "configure:6281: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       ;;
   *)
     echo $ac_n "checking for dvbpsi headers in ${with_dvbpsi}""... $ac_c" 1>&6
-echo "configure:6304: checking for dvbpsi headers in ${with_dvbpsi}" >&5
+echo "configure:6310: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     if test "x${with_dvbpsi}" = "x"
     then
       test_LDFLAGS=""
@@ -6312,17 +6318,17 @@ echo "configure:6304: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
     ac_safe=`echo "dvbpsi/dr.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dvbpsi/dr.h""... $ac_c" 1>&6
-echo "configure:6316: checking for dvbpsi/dr.h" >&5
+echo "configure:6322: checking for dvbpsi/dr.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 6321 "configure"
+#line 6327 "configure"
 #include "confdefs.h"
 #include <dvbpsi/dr.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6332: \"$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*
@@ -6339,9 +6345,9 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-      PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
-      mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
-      mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
+      PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
+      ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
+      ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
       
 else
   echo "$ac_t""no" 1>&6
@@ -6368,7 +6374,7 @@ fi
 if test "x${enable_vcd}" != "xno"
 then
   cat > conftest.$ac_ext <<EOF
-#line 6372 "configure"
+#line 6378 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -6376,14 +6382,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "cdrom_msf0" >/dev/null 2>&1; then
   rm -rf conftest*
   
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
   
 fi
 rm -f conftest*
 
   
   cat > conftest.$ac_ext <<EOF
-#line 6387 "configure"
+#line 6393 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -6391,7 +6397,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "ioc_toc_header " >/dev/null 2>&1; then
   rm -rf conftest*
   
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
     cat >> confdefs.h <<\EOF
 #define HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H 1
 EOF
@@ -6403,7 +6409,7 @@ rm -f conftest*
   
   if test "x${SYS}" = "xbsdi"
   then
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
   fi
 
   if test "x${SYS}" = "xdarwin"
@@ -6418,7 +6424,7 @@ if test "${enable_satellite+set}" = set; then
   enableval="$enable_satellite"
    if test "x${enable_satellite}" = "xyes"
     then
-      PLUGINS="${PLUGINS} satellite"
+      PLUGINS="${PLUGINS} access/satellite/satellite"
     fi
 fi
 
@@ -6427,12 +6433,12 @@ if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
 then
   have_ipv6=0
   echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
-echo "configure:6431: checking for inet_pton" >&5
+echo "configure:6437: checking for inet_pton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_pton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6436 "configure"
+#line 6442 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_pton(); below.  */
@@ -6455,7 +6461,7 @@ inet_pton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_pton=yes"
 else
@@ -6474,7 +6480,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for inet_pton in -lresolv""... $ac_c" 1>&6
-echo "configure:6478: checking for inet_pton in -lresolv" >&5
+echo "configure:6484: checking for inet_pton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_pton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6482,7 +6488,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6486 "configure"
+#line 6492 "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
@@ -6493,7 +6499,7 @@ int main() {
 inet_pton()
 ; return 0; }
 EOF
-if { (eval echo configure:6497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6503: \"$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
@@ -6518,9 +6524,9 @@ fi
 fi
 
   echo $ac_n "checking for sockaddr_in6 in netinet/in.h""... $ac_c" 1>&6
-echo "configure:6522: checking for sockaddr_in6 in netinet/in.h" >&5
+echo "configure:6528: checking for sockaddr_in6 in netinet/in.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6524 "configure"
+#line 6530 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
@@ -6535,15 +6541,15 @@ fi
 rm -f conftest*
 
   if test x$have_ipv6 = x1; then
-    PLUGINS="${PLUGINS} ipv6"
+    PLUGINS="${PLUGINS} misc/network/ipv6"
   fi
 fi
 if test "x${SYS}" = "xmingw32"
 then
   echo $ac_n "checking for getaddrinfo in ws2tcpip.h""... $ac_c" 1>&6
-echo "configure:6545: checking for getaddrinfo in ws2tcpip.h" >&5
+echo "configure:6551: checking for getaddrinfo in ws2tcpip.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6547 "configure"
+#line 6553 "configure"
 #include "confdefs.h"
 #include <ws2tcpip.h>
 EOF
@@ -6551,7 +6557,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "addrinfo" >/dev/null 2>&1; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
-    PLUGINS="${PLUGINS} ipv6"
+    PLUGINS="${PLUGINS} misc/network/ipv6"
 else
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
@@ -6568,7 +6574,7 @@ fi
 
 if test "x${enable_avi}" != "xno"
 then
-  PLUGINS="${PLUGINS} avi"
+  PLUGINS="${PLUGINS} demux/avi/avi"
 fi
 
 
@@ -6614,7 +6620,7 @@ fi
       { echo "configure: error: ${with_mad_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for mad.h in ${real_mad_tree}/libmad""... $ac_c" 1>&6
-echo "configure:6618: checking for mad.h in ${real_mad_tree}/libmad" >&5
+echo "configure:6624: checking for mad.h in ${real_mad_tree}/libmad" >&5
     if test -f ${real_mad_tree}/libmad/mad.h
     then
       echo "$ac_t""yes" 1>&6
@@ -6622,7 +6628,7 @@ echo "configure:6618: checking for mad.h in ${real_mad_tree}/libmad" >&5
       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
       echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6626: checking for mad_bit_init in -lmad" >&5
+echo "configure:6632: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_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
@@ -6630,7 +6636,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6634 "configure"
+#line 6640 "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
@@ -6641,7 +6647,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6651: \"$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
@@ -6657,7 +6663,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-        BUILTINS="${BUILTINS} mad"
+        BUILTINS="${BUILTINS} codec/mad/mad"
         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
         
 else
@@ -6678,17 +6684,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6682: checking for $ac_hdr" >&5
+echo "configure:6688: 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 6687 "configure"
+#line 6693 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6698: \"$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*
@@ -6716,7 +6722,7 @@ fi
 done
 
     echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6720: checking for mad_bit_init in -lmad" >&5
+echo "configure:6726: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_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
@@ -6724,7 +6730,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6728 "configure"
+#line 6734 "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
@@ -6735,7 +6741,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6745: \"$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
@@ -6751,7 +6757,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-      PLUGINS="${PLUGINS} mad"
+      PLUGINS="${PLUGINS} codec/mad/mad"
       mad_LDFLAGS="${mad_LDFLAGS} -lmad" 
 else
   echo "$ac_t""no" 1>&6
@@ -6792,7 +6798,7 @@ fi
   if test "x${with_ffmpeg_tree}" != "x"
   then
     echo $ac_n "checking for libavcodec.a in ${with_ffmpeg_tree}""... $ac_c" 1>&6
-echo "configure:6796: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
+echo "configure:6802: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x${real_ffmpeg_tree}" = x
     then
@@ -6802,7 +6808,7 @@ echo "configure:6796: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
     then
             echo "$ac_t""${real_ffmpeg_tree}/libavcodec/libavcodec.a" 1>&6
-      BUILTINS="${BUILTINS} ffmpeg"
+      BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
     else
@@ -6813,7 +6819,7 @@ echo "configure:6796: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
     echo $ac_n "checking for avcodec_init in -lavcodec""... $ac_c" 1>&6
-echo "configure:6817: checking for avcodec_init in -lavcodec" >&5
+echo "configure:6823: checking for avcodec_init in -lavcodec" >&5
 ac_lib_var=`echo avcodec'_'avcodec_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
@@ -6821,7 +6827,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lavcodec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6825 "configure"
+#line 6831 "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
@@ -6832,7 +6838,7 @@ int main() {
 avcodec_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6842: \"$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
@@ -6848,7 +6854,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-      BUILTINS="${BUILTINS} ffmpeg"
+      BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" 
 else
   echo "$ac_t""no" 1>&6
@@ -6870,17 +6876,17 @@ if test "x${enable_mp4}" = "xyes"
 then
     ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
-echo "configure:6874: checking for zlib.h" >&5
+echo "configure:6880: checking for zlib.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 6879 "configure"
+#line 6885 "configure"
 #include "confdefs.h"
 #include <zlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6890: \"$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*
@@ -6897,7 +6903,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for inflateEnd in -lz""... $ac_c" 1>&6
-echo "configure:6901: checking for inflateEnd in -lz" >&5
+echo "configure:6907: checking for inflateEnd in -lz" >&5
 ac_lib_var=`echo z'_'inflateEnd | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6905,7 +6911,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6909 "configure"
+#line 6915 "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
@@ -6916,7 +6922,7 @@ int main() {
 inflateEnd()
 ; return 0; }
 EOF
-if { (eval echo configure:6920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6926: \"$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
@@ -6931,7 +6937,7 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-   PLUGINS="${PLUGINS} mp4"
+   PLUGINS="${PLUGINS} demux/mp4/mp4"
               mp4_LDFLAGS="${mp4_LDFLAGS} -lz" 
 else
   echo "$ac_t""no" 1>&6
@@ -6947,7 +6953,7 @@ fi
 
 if test "x${SYS}" = "xbeos"
 then
-    PLUGINS="${PLUGINS} beos"
+    PLUGINS="${PLUGINS} gui/beos/beos"
 fi
 
 # Check whether --enable-a52 or --disable-a52 was given.
@@ -6973,7 +6979,7 @@ fi
       { echo "configure: error: ${with_a52_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for a52.h in ${real_a52_tree}/include""... $ac_c" 1>&6
-echo "configure:6977: checking for a52.h in ${real_a52_tree}/include" >&5
+echo "configure:6983: checking for a52.h in ${real_a52_tree}/include" >&5
     if test -f ${real_a52_tree}/include/a52.h
     then
       echo "$ac_t""yes" 1>&6
@@ -6981,7 +6987,7 @@ echo "configure:6977: checking for a52.h in ${real_a52_tree}/include" >&5
       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:6985: checking for a52_free in -la52" >&5
+echo "configure:6991: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6989,7 +6995,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6993 "configure"
+#line 6999 "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
@@ -7000,7 +7006,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7010: \"$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
@@ -7016,7 +7022,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-        BUILTINS="${BUILTINS} a52"
+        BUILTINS="${BUILTINS} codec/a52/a52"
         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
         a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
         
@@ -7041,17 +7047,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7045: checking for $ac_hdr" >&5
+echo "configure:7051: 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 7050 "configure"
+#line 7056 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7061: \"$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*
@@ -7073,7 +7079,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:7077: checking for a52_free in -la52" >&5
+echo "configure:7083: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7081,7 +7087,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7085 "configure"
+#line 7091 "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
@@ -7092,7 +7098,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7102: \"$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
@@ -7108,7 +7114,7 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-        BUILTINS="${BUILTINS} a52"
+        BUILTINS="${BUILTINS} codec/a52/a52"
         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
         a52_CFLAGS="${a52_CFLAGS}"
       
@@ -7133,7 +7139,7 @@ fi
 
 if test "x${enable_cinepak}" != "xno"
 then
-  PLUGINS="${PLUGINS} cinepak"
+  PLUGINS="${PLUGINS} codec/cinepak/cinepak"
 fi
 
 # Check whether --enable-vorbis or --disable-vorbis was given.
@@ -7148,17 +7154,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7152: checking for $ac_hdr" >&5
+echo "configure:7158: 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 7157 "configure"
+#line 7163 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7168: \"$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*
@@ -7179,7 +7185,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-        #PLUGINS="${PLUGINS} vorbis"
+        #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
    
 else
@@ -7210,17 +7216,17 @@ if test "x${enable_x11}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7214: checking for $ac_hdr" >&5
+echo "configure:7220: 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 7219 "configure"
+#line 7225 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7230: \"$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*
@@ -7241,7 +7247,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-    PLUGINS="${PLUGINS} x11"
+    PLUGINS="${PLUGINS} video_output/x11/x11"
     x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
     x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
   
@@ -7266,17 +7272,17 @@ if test "x${enable_xvideo}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7270: checking for $ac_hdr" >&5
+echo "configure:7276: 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 7275 "configure"
+#line 7281 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7286: \"$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*
@@ -7299,7 +7305,7 @@ EOF
  
     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
     echo $ac_n "checking for XvPutImage in -lXv_pic""... $ac_c" 1>&6
-echo "configure:7303: checking for XvPutImage in -lXv_pic" >&5
+echo "configure:7309: checking for XvPutImage in -lXv_pic" >&5
 ac_lib_var=`echo Xv_pic'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7307,7 +7313,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv_pic  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7311 "configure"
+#line 7317 "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
@@ -7318,7 +7324,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7328: \"$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
@@ -7334,13 +7340,13 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   # We have Xv_pic, that's good, we can build an xvideo.so plugin !
-      PLUGINS="${PLUGINS} xvideo"
+      PLUGINS="${PLUGINS} video_output/x11/xvideo"
       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
       xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}"
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for XvPutImage in -lXv""... $ac_c" 1>&6
-echo "configure:7344: checking for XvPutImage in -lXv" >&5
+echo "configure:7350: checking for XvPutImage in -lXv" >&5
 ac_lib_var=`echo Xv'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7348,7 +7354,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7352 "configure"
+#line 7358 "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
@@ -7359,7 +7365,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7369: \"$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
@@ -7375,12 +7381,13 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
-        PLUGINS="${PLUGINS} xvideo"
+        PLUGINS="${PLUGINS} video_output/x11/xvideo"
         xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
         xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}"
 else
   echo "$ac_t""no" 1>&6
 # Otherwise... well, do nothing.
+        :
       
 fi
 
@@ -7418,7 +7425,7 @@ fi
   # Extract the first word of "sdl12-config", so it can be a program name with args.
 set dummy sdl12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7422: checking for $ac_word" >&5
+echo "configure:7429: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7458,7 +7465,7 @@ fi
     # Extract the first word of "sdl11-config", so it can be a program name with args.
 set dummy sdl11-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7462: checking for $ac_word" >&5
+echo "configure:7469: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7499,7 +7506,7 @@ fi
     # Extract the first word of "sdl-config", so it can be a program name with args.
 set dummy sdl-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7503: checking for $ac_word" >&5
+echo "configure:7510: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7536,7 +7543,7 @@ fi
   fi
   if test "x${SDL_CONFIG}" != "xno"
   then
-    PLUGINS="${PLUGINS} sdl"
+    PLUGINS="${PLUGINS} video_output/sdl/sdl"
     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
     CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
@@ -7544,17 +7551,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7548: checking for $ac_hdr" >&5
+echo "configure:7555: 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 7553 "configure"
+#line 7560 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7565: \"$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*
@@ -7624,17 +7631,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7628: checking for $ac_hdr" >&5
+echo "configure:7635: 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 7633 "configure"
+#line 7640 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7645: \"$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*
@@ -7654,7 +7661,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
-  PLUGINS="${PLUGINS} directx"
+  PLUGINS="${PLUGINS} video_output/directx/directx"
         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" 
 else
   echo "$ac_t""no" 1>&6
@@ -7663,10 +7670,10 @@ done
 
     else
       echo $ac_n "checking for directX headers in ${with_directx}""... $ac_c" 1>&6
-echo "configure:7667: checking for directX headers in ${with_directx}" >&5
+echo "configure:7674: checking for directX headers in ${with_directx}" >&5
       if test -f ${with_directx}/ddraw.h
       then
-        PLUGINS="${PLUGINS} directx"
+        PLUGINS="${PLUGINS} video_output/directx/directx"
         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
         echo "$ac_t""yes" 1>&6
@@ -7690,17 +7697,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7694: checking for $ac_hdr" >&5
+echo "configure:7701: 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 7699 "configure"
+#line 7706 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7711: \"$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*
@@ -7721,7 +7728,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-        PLUGINS="${PLUGINS} fb"
+        PLUGINS="${PLUGINS} video_output/fb/fb"
       
 else
   echo "$ac_t""no" 1>&6
@@ -7735,7 +7742,7 @@ if test "${enable_mga+set}" = set; then
   enableval="$enable_mga"
    if test "x${enable_mga}" = "xyes"
     then
-      PLUGINS="${PLUGINS} mga xmga"
+      PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
     fi 
 fi
 
@@ -7748,7 +7755,7 @@ fi
 
 if test "x${enable_ggi}" = "xyes"
 then
-  PLUGINS="${PLUGINS} ggi"
+  PLUGINS="${PLUGINS} video_output/ggi/ggi"
   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
   # Check whether --with-ggi or --without-ggi was given.
 if test "${with_ggi+set}" = set; then
@@ -7770,7 +7777,7 @@ fi
 
 if test "x${enable_glide}" = "xyes"
 then
-  PLUGINS="${PLUGINS} glide"
+  PLUGINS="${PLUGINS} video_output/glide/glide"
   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
   # Check whether --with-glide or --without-glide was given.
@@ -7795,17 +7802,17 @@ if test "x${enable_aa}" = "xyes"
 then
   ac_safe=`echo "aalib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for aalib.h""... $ac_c" 1>&6
-echo "configure:7799: checking for aalib.h" >&5
+echo "configure:7806: checking for aalib.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 7804 "configure"
+#line 7811 "configure"
 #include "confdefs.h"
 #include <aalib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7816: \"$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*
@@ -7829,7 +7836,7 @@ fi
 
   if test "x${have_aa}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} aa"
+    PLUGINS="${PLUGINS} video_output/aa/aa"
     aa_LDFLAGS="${aa_LDFLAGS} -laa"
   fi
 fi
@@ -7856,17 +7863,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7860: checking for $ac_hdr" >&5
+echo "configure:7867: 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 7865 "configure"
+#line 7872 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7877: \"$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*
@@ -7887,9 +7894,9 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-    PLUGINS="${PLUGINS} dsp"
+    PLUGINS="${PLUGINS} audio_output/dsp/dsp"
     echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:7893: checking for main in -lossaudio" >&5
+echo "configure:7900: checking for main in -lossaudio" >&5
 ac_lib_var=`echo ossaudio'_'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
@@ -7897,14 +7904,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lossaudio  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7901 "configure"
+#line 7908 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7915: \"$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
@@ -7940,7 +7947,7 @@ if test "${enable_esd+set}" = set; 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:7944: checking for $ac_word" >&5
+echo "configure:7951: 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
@@ -7975,7 +7982,7 @@ fi
 
      if test "x${ESD_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} esd"
+       PLUGINS="${PLUGINS} audio_output/esd/esd"
        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
      fi
@@ -7991,7 +7998,7 @@ if test "${enable_arts+set}" = set; then
      # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7995: checking for $ac_word" >&5
+echo "configure:8002: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8026,7 +8033,7 @@ fi
 
      if test "x${ARTS_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} arts"
+       PLUGINS="${PLUGINS} audio_output/arts/arts"
        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
      fi
@@ -8041,17 +8048,17 @@ if test "${enable_alsa+set}" = set; then
    then
      ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:8045: checking for alsa/asoundlib.h" >&5
+echo "configure:8052: checking for alsa/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 8050 "configure"
+#line 8057 "configure"
 #include "confdefs.h"
 #include <alsa/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8062: \"$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*
@@ -8068,7 +8075,7 @@ fi
 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:8072: checking for main in -lasound" >&5
+echo "configure:8079: 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
@@ -8076,14 +8083,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8080 "configure"
+#line 8087 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:8087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8094: \"$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
@@ -8111,7 +8118,7 @@ fi
 
      if test "x${have_alsa}" = "xtrue"
      then
-       PLUGINS="${PLUGINS} alsa"
+       PLUGINS="${PLUGINS} audio_output/alsa/alsa"
        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
      fi
    fi
@@ -8126,7 +8133,7 @@ fi
 
 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
   then
-    PLUGINS="${PLUGINS} waveout"
+    PLUGINS="${PLUGINS} audio_output/waveout/waveout"
     waveout_LDFLAGS="-lwinmm"
 fi
 
@@ -8160,7 +8167,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8164: checking for $ac_word" >&5
+echo "configure:8171: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8199,7 +8206,7 @@ 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:8203: checking for $ac_word" >&5
+echo "configure:8210: 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
@@ -8248,17 +8255,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8252: checking for $ac_hdr" >&5
+echo "configure:8259: 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 8257 "configure"
+#line 8264 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8269: \"$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*
@@ -8289,7 +8296,7 @@ done
 
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
-      PLUGINS="${PLUGINS} gtk"
+      PLUGINS="${PLUGINS} gui/gtk/gtk"
       ALIASES="${ALIASES} gvlc"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
@@ -8318,7 +8325,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8322: checking for $ac_word" >&5
+echo "configure:8329: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8357,7 +8364,7 @@ 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:8361: checking for $ac_word" >&5
+echo "configure:8368: 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
@@ -8406,17 +8413,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8410: checking for $ac_hdr" >&5
+echo "configure:8417: 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 8415 "configure"
+#line 8422 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8427: \"$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*
@@ -8447,7 +8454,7 @@ done
 
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
-      PLUGINS="${PLUGINS} familiar"
+      PLUGINS="${PLUGINS} gui/familiar/familiar"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
   fi
@@ -8461,7 +8468,7 @@ if test "${enable_gnome+set}" = set; then
     # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8465: checking for $ac_word" >&5
+echo "configure:8472: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8505,17 +8512,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8509: checking for $ac_hdr" >&5
+echo "configure:8516: 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 8514 "configure"
+#line 8521 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8526: \"$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*
@@ -8536,7 +8543,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-      PLUGINS="${PLUGINS} gnome"
+      PLUGINS="${PLUGINS} gui/gtk/gnome"
       ALIASES="${ALIASES} gnome-vlc"
      
 else
@@ -8556,7 +8563,7 @@ fi
 if test "${enable_qt+set}" = set; then
   enableval="$enable_qt"
   if test "x${enable_qt}" = "xyes"; then
-     PLUGINS="${PLUGINS} qt"
+     PLUGINS="${PLUGINS} gui/qt/qt"
      ALIASES="${ALIASES} qvlc"
      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
@@ -8574,7 +8581,7 @@ fi
 if test "${enable_kde+set}" = set; then
   enableval="$enable_kde"
   if test "x${enable_kde}" = "xyes"; then
-     PLUGINS="${PLUGINS} kde"
+     PLUGINS="${PLUGINS} gui/kde/kde"
      ALIASES="${ALIASES} kvlc"
      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
@@ -8594,7 +8601,7 @@ if test "${enable_macosx+set}" = set; then
   enableval="$enable_macosx"
   if test "x${enable_macosx}" = "xyes"
    then
-     BUILTINS="${BUILTINS} macosx"
+     BUILTINS="${BUILTINS} gui/macosx/macosx"
      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
    fi
 else
@@ -8602,17 +8609,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8606: checking for $ac_hdr" >&5
+echo "configure:8613: 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 8611 "configure"
+#line 8618 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8616: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8623: \"$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*
@@ -8632,7 +8639,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   cat >> confdefs.h <<EOF
 #define $ac_tr_hdr 1
 EOF
- BUILTINS="${BUILTINS} macosx"
+ BUILTINS="${BUILTINS} gui/macosx/macosx"
      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
    
 else
@@ -8655,17 +8662,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8659: checking for $ac_hdr" >&5
+echo "configure:8666: 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 8664 "configure"
+#line 8671 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8676: \"$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*
@@ -8686,7 +8693,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 #define $ac_tr_hdr 1
 EOF
  
-        PLUGINS="${PLUGINS} qnx"
+        PLUGINS="${PLUGINS} gui/qnx/qnx"
         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
       
 else
@@ -8711,7 +8718,7 @@ fi
     then
       BCBUILDER="${with_bcbuilder}"
     fi
-    PLUGINS="${PLUGINS} intfwin"
+    PLUGINS="${PLUGINS} gui/win32/win32"
   fi 
 fi
 
@@ -8720,7 +8727,7 @@ fi
 if test "${enable_ncurses+set}" = set; then
   enableval="$enable_ncurses"
   if test "x${enable_ncurses}" = "xyes"; then
-     PLUGINS="${PLUGINS} ncurses"
+     PLUGINS="${PLUGINS} gui/ncurses/ncurses"
      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
    fi
 fi
@@ -8736,17 +8743,17 @@ if test "x${enable_xosd}" = "xyes"
 then
   ac_safe=`echo "xosd.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for xosd.h""... $ac_c" 1>&6
-echo "configure:8740: checking for xosd.h" >&5
+echo "configure:8747: checking for xosd.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 8745 "configure"
+#line 8752 "configure"
 #include "confdefs.h"
 #include <xosd.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8757: \"$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*
@@ -8770,7 +8777,7 @@ fi
 
   if test "x${have_xosd}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} xosd"
+    PLUGINS="${PLUGINS} visualization/xosd/xosd"
     xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
   fi
 fi
@@ -8785,17 +8792,17 @@ if test "x${enable_lirc}" = "xyes"
 then
   ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6
-echo "configure:8789: checking for lirc/lirc_client.h" >&5
+echo "configure:8796: checking for lirc/lirc_client.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 8794 "configure"
+#line 8801 "configure"
 #include "confdefs.h"
 #include <lirc/lirc_client.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8806: \"$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*
@@ -8812,7 +8819,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:8816: checking for lirc_init in -llirc_client" >&5
+echo "configure:8823: checking for lirc_init in -llirc_client" >&5
 ac_lib_var=`echo lirc_client'_'lirc_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
@@ -8820,7 +8827,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llirc_client  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8824 "configure"
+#line 8831 "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
@@ -8831,7 +8838,7 @@ int main() {
 lirc_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8842: \"$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
@@ -8859,7 +8866,7 @@ fi
 
   if test "x${have_lirc}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} lirc"
+    PLUGINS="${PLUGINS} control/lirc/lirc"
     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
   fi
 fi
@@ -8886,7 +8893,7 @@ fi
       ;;
     *)
                   echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6
-echo "configure:8890: checking whether the byte order is big-endian" >&5
+echo "configure:8897: checking whether the byte order is big-endian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8968,7 +8975,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test "x${enable_pth}" = "xyes"; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:8972: checking for pth_init in -lpth" >&5
+echo "configure:8979: 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
@@ -8976,7 +8983,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8980 "configure"
+#line 8987 "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
@@ -8987,7 +8994,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:8991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8998: \"$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
@@ -9015,7 +9022,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9019 "configure"
+#line 9026 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -9041,7 +9048,7 @@ if test "${enable_st+set}" = set; then
   enableval="$enable_st"
    if test "x${enable_st}" = "xyes"; then
     echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6
-echo "configure:9045: checking for st_init in -lst" >&5
+echo "configure:9052: checking for st_init in -lst" >&5
 ac_lib_var=`echo st'_'st_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
@@ -9049,7 +9056,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lst  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9053 "configure"
+#line 9060 "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
@@ -9060,7 +9067,7 @@ int main() {
 st_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9071: \"$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
@@ -9088,7 +9095,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9092 "configure"
+#line 9099 "configure"
 #include "confdefs.h"
 #include <st.h>
 EOF
@@ -9124,7 +9131,7 @@ then
   # Extract the first word of "mozilla-config", so it can be a program name with args.
 set dummy mozilla-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9128: checking for $ac_word" >&5
+echo "configure:9135: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MOZILLA_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9162,7 +9169,7 @@ fi
     if test "x${SYS}" != "xmingw32"; then
       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
       echo $ac_n "checking for XtStrings in -lXt""... $ac_c" 1>&6
-echo "configure:9166: checking for XtStrings in -lXt" >&5
+echo "configure:9173: checking for XtStrings in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtStrings | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9170,7 +9177,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9174 "configure"
+#line 9181 "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
@@ -9181,7 +9188,7 @@ int main() {
 XtStrings()
 ; return 0; }
 EOF
-if { (eval echo configure:9185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9192: \"$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
@@ -9589,11 +9596,11 @@ s%@builtins_CFLAGS@%$builtins_CFLAGS%g
 s%@mozilla_CFLAGS@%$mozilla_CFLAGS%g
 s%@a52_CFLAGS@%$a52_CFLAGS%g
 s%@arts_CFLAGS@%$arts_CFLAGS%g
-s%@chroma_i420_yuy2_mmx_CFLAGS@%$chroma_i420_yuy2_mmx_CFLAGS%g
+s%@i420_yuy2_mmx_CFLAGS@%$i420_yuy2_mmx_CFLAGS%g
 s%@dvd_CFLAGS@%$dvd_CFLAGS%g
 s%@dvdread_CFLAGS@%$dvdread_CFLAGS%g
 s%@dvdplay_CFLAGS@%$dvdplay_CFLAGS%g
-s%@mpeg_ts_dvbpsi_CFLAGS@%$mpeg_ts_dvbpsi_CFLAGS%g
+s%@ts_dvbpsi_CFLAGS@%$ts_dvbpsi_CFLAGS%g
 s%@directx_CFLAGS@%$directx_CFLAGS%g
 s%@esd_CFLAGS@%$esd_CFLAGS%g
 s%@familiar_CFLAGS@%$familiar_CFLAGS%g
@@ -9620,16 +9627,16 @@ s%@aa_LDFLAGS@%$aa_LDFLAGS%g
 s%@alsa_LDFLAGS@%$alsa_LDFLAGS%g
 s%@arts_LDFLAGS@%$arts_LDFLAGS%g
 s%@beos_LDFLAGS@%$beos_LDFLAGS%g
-s%@chroma_i420_rgb_LDFLAGS@%$chroma_i420_rgb_LDFLAGS%g
+s%@i420_rgb_LDFLAGS@%$i420_rgb_LDFLAGS%g
 s%@directx_LDFLAGS@%$directx_LDFLAGS%g
 s%@dsp_LDFLAGS@%$dsp_LDFLAGS%g
 s%@dvd_LDFLAGS@%$dvd_LDFLAGS%g
 s%@dvdread_LDFLAGS@%$dvdread_LDFLAGS%g
 s%@dvdplay_LDFLAGS@%$dvdplay_LDFLAGS%g
-s%@mpeg_ts_dvbpsi_LDFLAGS@%$mpeg_ts_dvbpsi_LDFLAGS%g
+s%@ts_dvbpsi_LDFLAGS@%$ts_dvbpsi_LDFLAGS%g
 s%@esd_LDFLAGS@%$esd_LDFLAGS%g
 s%@familiar_LDFLAGS@%$familiar_LDFLAGS%g
-s%@filter_distort_LDFLAGS@%$filter_distort_LDFLAGS%g
+s%@distort_LDFLAGS@%$distort_LDFLAGS%g
 s%@ffmpeg_LDFLAGS@%$ffmpeg_LDFLAGS%g
 s%@mp4_LDFLAGS@%$mp4_LDFLAGS%g
 s%@ggi_LDFLAGS@%$ggi_LDFLAGS%g
index 88ee205..817f09b 100644 (file)
@@ -367,7 +367,7 @@ AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
 if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
     # this plugin does not compile without -fomit-frame-pointer, damn gcc!
-    chroma_i420_yuy2_mmx_CFLAGS="${chroma_i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
+    i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
 fi
 
 dnl Check for Darwin plugin linking flags
@@ -434,16 +434,22 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS}"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
+PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
+PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file access/udp access/http misc/network/ipv4 misc/memcpy/memcpy"
+PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/ps demux/mpeg/ts"
+PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/mpeg_audio/mpeg_audio codec/a52old/a52old codec/mpeg_video/mpeg_video codec/lpcm/lpcm codec/spdif/spdif codec/spudec/spudec"
+PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop"
+PLUGINS="${PLUGINS} visualization/scope/scope"
+PLUGINS="${PLUGINS} video_chroma/i420_rgb video_chroma/i420_yuy2 video_chroma/i422_yuy2 video_chroma/i420_ymga"
 
 dnl
 dnl  Accelerated modules
 dnl
-MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
-MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
-THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
-SSE_MODULES="imdctsse downmixsse"
-ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
+MMX_MODULES="misc/memcpy/memcpymmx codec/mpeg_video/idct/idctmmx codec/mpeg_video/motion/motionmmx video_chroma/i420_rgb_mmx video_chroma/i420_yuy2_mmx video_chroma/i422_yuy2_mmx video_chroma/i420_ymga_mmx"
+MMXEXT_MODULES="misc/memcpy/memcpymmxext codec/mpeg_video/idct/idctmmxext codec/mpeg_video/motion/motionmmxext"
+THREEDNOW_MODULES="misc/memcpy/memcpy3dn codec/a52old/imdct/imdct3dn codec/a52old/downmix/downmix3dn"
+SSE_MODULES="codec/a52old/imdct/imdctsse codec/a52old/downmix/downmixsse"
+ALTIVEC_MODULES="codec/mpeg_video/idct/idctaltivec codec/mpeg_video/motion/motionaltivec misc/memcpy/memcpyaltivec"
 
 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
     [ac_cv_mmx_inline],
@@ -627,7 +633,7 @@ then
     if test "x${with_dvdcss_tree}" = x
     then
       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
-        [ PLUGINS="${PLUGINS} dvd"
+        [ PLUGINS="${PLUGINS} access/dvd/dvd"
           dvd_LDFLAGS="${dvd_LDFLAGS} -ldvdcss" ],
         [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
@@ -644,7 +650,7 @@ then
       then
         dnl  Use a custom libdvdcss
         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
-        BUILTINS="${BUILTINS} dvd"
+        BUILTINS="${BUILTINS} access/dvd/dvd"
         dvd_LDFLAGS="${dvd_LDFLAGS} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
         dvd_CFLAGS="${dvd_CFLAGS} -I${real_dvdcss_tree}/src"
       else
@@ -656,7 +662,7 @@ then
   ;;
   xno)
     dnl  Compile without dvdcss (dlopen version, works only under Linux)
-    PLUGINS="${PLUGINS} dvd"
+    PLUGINS="${PLUGINS} access/dvd/dvd"
     dvd_CFLAGS="${dvd_CFLAGS} -DGOD_DAMN_DMCA"
     dvd_LDFLAGS="${dvd_LDFLAGS} -ldl"
   ;;
@@ -666,7 +672,7 @@ then
     then
       dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
       AC_MSG_RESULT(yes)
-      PLUGINS="${PLUGINS} dvd"
+      PLUGINS="${PLUGINS} access/dvd/dvd"
       dvd_LDFLAGS="${dvd_LDFLAGS} -L${with_dvdcss}/lib -ldvdcss"
       dvd_CFLAGS="${dvd_CFLAGS} -I${with_dvdcss}/include"
     else
@@ -699,7 +705,7 @@ then
   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
         [void foo() { int i=DVD_VIDEO_LB_LEN; }],[
-          PLUGINS="${PLUGINS} dvdread"
+          PLUGINS="${PLUGINS} access/dvdread/dvdread"
           dvdread_LDFLAGS="${dvdread_LDFLAGS} ${test_LDFLAGS} -ldvdread"
           dvdread_CFLAGS="${dvdread_CFLAGS} ${test_CFLAGS}"
         ],[
@@ -741,7 +747,7 @@ then
   fi
   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
   AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
-      PLUGINS="${PLUGINS} dvdplay"
+      PLUGINS="${PLUGINS} access/dvdplay/dvdplay"
       dvdplay_LDFLAGS="${dvdplay_LDFLAGS} ${test_LDFLAGS} -ldvdplay -ldvdread"
       dvdplay_CFLAGS="${dvdplay_CFLAGS} ${test_CFLAGS}"
     ],[
@@ -775,8 +781,8 @@ then
     if test "x${with_dvbpsi_tree}" = "x"
     then
       AC_CHECK_HEADERS(dvbpsi/dr.h,
-        [ PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
-          mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
+        [ PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
+          ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
         [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
     else
       AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
@@ -791,9 +797,9 @@ then
       then
         dnl  Use a custom libdvbpsi
         AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
-        BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
-        mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
-        mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
+        BUILTINS="${BUILTINS} demux/mpeg/ts_dvbpsi"
+        ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+        ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
       else
         dnl  The given libdvbpsi wasn't built
         AC_MSG_RESULT(no)
@@ -816,9 +822,9 @@ then
     fi
     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
     AC_CHECK_HEADER([dvbpsi/dr.h],[
-      PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
-      mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
-      mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
+      PLUGINS="${PLUGINS} demux/mpeg/ts_dvbpsi"
+      ts_dvbpsi_LDFLAGS="${ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
+      ts_dvbpsi_CFLAGS="${ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
       ],[
       if test "x${enable_dvbpsi}" != "x"
       then
@@ -839,17 +845,17 @@ AC_ARG_ENABLE(vcd,
 if test "x${enable_vcd}" != "xno"
 then
   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
   ])
   
   AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
   ])
   
   if test "x${SYS}" = "xbsdi"
   then
-    PLUGINS="${PLUGINS} vcd"
+    PLUGINS="${PLUGINS} access/vcd/vcd"
   fi
 
   if test "x${SYS}" = "xdarwin"
@@ -866,7 +872,7 @@ AC_ARG_ENABLE(satellite,
   [  --enable-satellite      satellite card support (default disabled)],
   [ if test "x${enable_satellite}" = "xyes"
     then
-      PLUGINS="${PLUGINS} satellite"
+      PLUGINS="${PLUGINS} access/satellite/satellite"
     fi])
 
 dnl
@@ -884,14 +890,14 @@ then
   AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
     [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=0])
   if test x$have_ipv6 = x1; then
-    PLUGINS="${PLUGINS} ipv6"
+    PLUGINS="${PLUGINS} misc/network/ipv6"
   fi
 fi
 if test "x${SYS}" = "xmingw32"
 then
   AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
   AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
-    PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
+    PLUGINS="${PLUGINS} misc/network/ipv6"],[AC_MSG_RESULT(no)])
 fi
 
 dnl
@@ -901,7 +907,7 @@ AC_ARG_ENABLE(avi,
   [  --enable-avi            AVI demux module (default enabled)])
 if test "x${enable_avi}" != "xno"
 then
-  PLUGINS="${PLUGINS} avi"
+  PLUGINS="${PLUGINS} demux/avi/avi"
 fi
 
 dnl
@@ -945,7 +951,7 @@ then
       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
       AC_CHECK_LIB(mad, mad_bit_init, [
-        BUILTINS="${BUILTINS} mad"
+        BUILTINS="${BUILTINS} codec/mad/mad"
         mad_LDFLAGS="${mad_LDFLAGS} -lmad"
         ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
       ],[])
@@ -960,7 +966,7 @@ then
     AC_CHECK_HEADERS(mad.h, ,
       [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
     AC_CHECK_LIB(mad, mad_bit_init, [
-      PLUGINS="${PLUGINS} mad"
+      PLUGINS="${PLUGINS} codec/mad/mad"
       mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
       [ AC_MSG_ERROR([Cannot find libmad library...]) ])
     CFLAGS="${save_CFLAGS}"
@@ -999,7 +1005,7 @@ then
     then
       dnl  Use a custom libffmpeg
       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
-      BUILTINS="${BUILTINS} ffmpeg"
+      BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
     else
@@ -1011,7 +1017,7 @@ then
     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS} -lm"
     AC_CHECK_LIB(avcodec, avcodec_init, [
-      BUILTINS="${BUILTINS} ffmpeg"
+      BUILTINS="${BUILTINS} codec/ffmpeg/ffmpeg"
       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
       [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
     LDFLAGS="${save_LDFLAGS}"
@@ -1028,7 +1034,7 @@ if test "x${enable_mp4}" = "xyes"
 then
     AC_CHECK_HEADER(zlib.h,
         AC_CHECK_LIB(z, inflateEnd,
-            [ PLUGINS="${PLUGINS} mp4"
+            [ PLUGINS="${PLUGINS} demux/mp4/mp4"
               mp4_LDFLAGS="${mp4_LDFLAGS} -lz" ], 
             [ AC_MSG_ERROR([cannot find zlib library...]) ]),
         [  AC_MSG_ERROR([cannot find zlib header...]) ])
@@ -1037,7 +1043,7 @@ fi
 dnl special case for BeOS
 if test "x${SYS}" = "xbeos"
 then
-    PLUGINS="${PLUGINS} beos"
+    PLUGINS="${PLUGINS} gui/beos/beos"
 fi
 
 dnl
@@ -1067,7 +1073,7 @@ then
       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
       AC_CHECK_LIB(a52, a52_free, [
-        BUILTINS="${BUILTINS} a52"
+        BUILTINS="${BUILTINS} codec/a52/a52"
         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
         a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
         ],[
@@ -1086,7 +1092,7 @@ then
   else dnl  no with args
     AC_CHECK_HEADERS(a52dec/a52.h, [
       AC_CHECK_LIB(a52, a52_free, [
-        BUILTINS="${BUILTINS} a52"
+        BUILTINS="${BUILTINS} codec/a52/a52"
         a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
         a52_CFLAGS="${a52_CFLAGS}"
       ],[],[-lm])
@@ -1101,7 +1107,7 @@ AC_ARG_ENABLE(cinepak,
   [  --enable-cinepak        Cinepak decoder (default enabled)])
 if test "x${enable_cinepak}" != "xno"
 then
-  PLUGINS="${PLUGINS} cinepak"
+  PLUGINS="${PLUGINS} codec/cinepak/cinepak"
 fi
 
 dnl
@@ -1113,7 +1119,7 @@ if test "x${enable_vorbis}" != "xno"
 then
   AC_CHECK_HEADERS(ogg/ogg.h, [
     dnl disabled for the moment
-    #PLUGINS="${PLUGINS} vorbis"
+    #PLUGINS="${PLUGINS} demux/ogg/ogg codec/vorbis/vorbis"
     vorbis_LDFLAGS="${vorbis_LDFLAGS} -lvorbis"
    ],[])
 fi
@@ -1134,7 +1140,7 @@ if test "x${enable_x11}" != "xno" &&
   (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
   AC_CHECK_HEADERS(X11/Xlib.h, [
-    PLUGINS="${PLUGINS} x11"
+    PLUGINS="${PLUGINS} video_output/x11/x11"
     x11_LDFLAGS="${x11_LDFLAGS} -L${x_libraries} -lX11 -lXext"
     x11_CFLAGS="${x11_CFLAGS} -I${x_includes}"
   ])
@@ -1154,15 +1160,16 @@ if test "x${enable_xvideo}" != "xno" &&
     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
     AC_CHECK_LIB(Xv_pic,XvPutImage,
       # We have Xv_pic, that's good, we can build an xvideo.so plugin !
-      PLUGINS="${PLUGINS} xvideo"
+      PLUGINS="${PLUGINS} video_output/x11/xvideo"
       xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv_pic"
       xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
       AC_CHECK_LIB(Xv,XvPutImage,
         # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
-        PLUGINS="${PLUGINS} xvideo"
+        PLUGINS="${PLUGINS} video_output/x11/xvideo"
         xvideo_LDFLAGS="${xvideo_LDFLAGS} -L${x_libraries} -lX11 -lXext -lXv"
         xvideo_CFLAGS="${xvideo_CFLAGS} -I${x_includes}",
         # Otherwise... well, do nothing.
+        :
       )
     )
     CFLAGS="${save_CFLAGS}"
@@ -1200,7 +1207,7 @@ then
   fi
   if test "x${SDL_CONFIG}" != "xno"
   then
-    PLUGINS="${PLUGINS} sdl"
+    PLUGINS="${PLUGINS} video_output/sdl/sdl"
     sdl_CFLAGS="${sdl_CFLAGS} `${SDL_CONFIG} --cflags`"
     sdl_LDFLAGS="${sdl_LDFLAGS} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
     CPPFLAGS="${save_CPPFLAGS} ${sdl_CFLAGS}"
@@ -1239,13 +1246,13 @@ then
     if test "x${with_directx}" = "x"
     then
       AC_CHECK_HEADERS(ddraw.h,
-      [ PLUGINS="${PLUGINS} directx"
+      [ PLUGINS="${PLUGINS} video_output/directx/directx"
         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
     else
       AC_MSG_CHECKING(for directX headers in ${with_directx})
       if test -f ${with_directx}/ddraw.h
       then
-        PLUGINS="${PLUGINS} directx"
+        PLUGINS="${PLUGINS} video_output/directx/directx"
         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32"
         directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
         AC_MSG_RESULT(yes)
@@ -1265,7 +1272,7 @@ AC_ARG_ENABLE(fb,
     if test "x${enable_fb}" != "xno"
     then
       AC_CHECK_HEADERS(linux/fb.h, [
-        PLUGINS="${PLUGINS} fb"
+        PLUGINS="${PLUGINS} video_output/fb/fb"
       ])
     fi
 
@@ -1276,7 +1283,7 @@ AC_ARG_ENABLE(mga,
   [  --enable-mga            Linux kernel Matrox support (default disabled)],
   [ if test "x${enable_mga}" = "xyes"
     then
-      PLUGINS="${PLUGINS} mga xmga"
+      PLUGINS="${PLUGINS} video_output/mga/mga video_output/mga/xmga"
     fi ])
 
 dnl
@@ -1286,7 +1293,7 @@ AC_ARG_ENABLE(ggi,
   [  --enable-ggi            GGI support (default disabled)])
 if test "x${enable_ggi}" = "xyes"
 then
-  PLUGINS="${PLUGINS} ggi"
+  PLUGINS="${PLUGINS} video_output/ggi/ggi"
   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
   AC_ARG_WITH(ggi,
     [    --with-ggi=PATH       path to libggi],
@@ -1304,7 +1311,7 @@ AC_ARG_ENABLE(glide,
   [  --enable-glide          Glide (3dfx) support (default disabled)])
 if test "x${enable_glide}" = "xyes"
 then
-  PLUGINS="${PLUGINS} glide"
+  PLUGINS="${PLUGINS} video_output/glide/glide"
   glide_LDFLAGS="${glide_LDFLAGS} -lglide2x -lm"
   glide_CFLAGS="${glide_CFLAGS} -I/usr/include/glide"
   AC_ARG_WITH(glide,
@@ -1326,7 +1333,7 @@ then
   AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
   if test "x${have_aa}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} aa"
+    PLUGINS="${PLUGINS} video_output/aa/aa"
     aa_LDFLAGS="${aa_LDFLAGS} -laa"
   fi
 fi
@@ -1347,7 +1354,7 @@ if test "x${enable_dsp}" != "xno" &&
   (test "x${SYS}" != "xmingw32" || test "x${enable_dsp}" = "xyes")
 then
   AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
-    PLUGINS="${PLUGINS} dsp"
+    PLUGINS="${PLUGINS} audio_output/dsp/dsp"
     AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio")
   ])
 fi
@@ -1362,7 +1369,7 @@ AC_ARG_ENABLE(esd,
      AC_PATH_PROG(ESD_CONFIG, esd-config, no)
      if test "x${ESD_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} esd"
+       PLUGINS="${PLUGINS} audio_output/esd/esd"
        esd_CFLAGS="${esd_CFLAGS} `${ESD_CONFIG} --cflags`"
        esd_LDFLAGS="${esd_LDFLAGS} `${ESD_CONFIG} --libs`"
      fi
@@ -1378,7 +1385,7 @@ AC_ARG_ENABLE(arts,
      AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
      if test "x${ARTS_CONFIG}" != "xno"
      then
-       PLUGINS="${PLUGINS} arts"
+       PLUGINS="${PLUGINS} audio_output/arts/arts"
        arts_CFLAGS="${arts_CFLAGS} `${ARTS_CONFIG} --cflags`"
        arts_LDFLAGS="${arts_LDFLAGS} `${ARTS_CONFIG} --libs `"
      fi
@@ -1394,7 +1401,7 @@ AC_ARG_ENABLE(alsa,
      AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
      if test "x${have_alsa}" = "xtrue"
      then
-       PLUGINS="${PLUGINS} alsa"
+       PLUGINS="${PLUGINS} audio_output/alsa/alsa"
        alsa_LDFLAGS="${alsa_LDFLAGS} -lasound -lm -ldl"
      fi
    fi])
@@ -1406,7 +1413,7 @@ AC_ARG_ENABLE(waveout,
   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
 if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
   then
-    PLUGINS="${PLUGINS} waveout"
+    PLUGINS="${PLUGINS} audio_output/waveout/waveout"
     waveout_LDFLAGS="-lwinmm"
 fi
 
@@ -1454,7 +1461,7 @@ then
     ])
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
-      PLUGINS="${PLUGINS} gtk"
+      PLUGINS="${PLUGINS} gui/gtk/gtk"
       ALIASES="${ALIASES} gvlc"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
@@ -1499,7 +1506,7 @@ then
     ])
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
-      PLUGINS="${PLUGINS} familiar"
+      PLUGINS="${PLUGINS} gui/familiar/familiar"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
   fi
@@ -1521,7 +1528,7 @@ AC_ARG_ENABLE(gnome,
     # now look for the gnome.h header
     CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
     AC_CHECK_HEADERS(gnome.h, [
-      PLUGINS="${PLUGINS} gnome"
+      PLUGINS="${PLUGINS} gui/gtk/gnome"
       ALIASES="${ALIASES} gnome-vlc"
      ],[
       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
@@ -1536,7 +1543,7 @@ dnl
 AC_ARG_ENABLE(qt,
   [  --enable-qt             Qt interface support (default disabled)],
   [if test "x${enable_qt}" = "xyes"; then
-     PLUGINS="${PLUGINS} qt"
+     PLUGINS="${PLUGINS} gui/qt/qt"
      ALIASES="${ALIASES} qvlc"
      qt_LDFLAGS="${qt_LDFLAGS} -lqt -L${QTDIR}/lib"
      qt_CFLAGS="${qt_CFLAGS} -I/usr/include/qt -I${QTDIR}/include"
@@ -1554,7 +1561,7 @@ dnl
 AC_ARG_ENABLE(kde,
   [  --enable-kde            KDE interface support (default disabled)],
   [if test "x${enable_kde}" = "xyes"; then
-     PLUGINS="${PLUGINS} kde"
+     PLUGINS="${PLUGINS} gui/kde/kde"
      ALIASES="${ALIASES} kvlc"
      kde_LDFLAGS="${kde_LDFLAGS} -L${KDEDIR}/lib -lkfile"
      kde_CFLAGS="${kde_CFLAGS} -I/usr/include/kde -I/usr/include/qt"
@@ -1574,11 +1581,11 @@ AC_ARG_ENABLE(macosx,
   [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
   [if test "x${enable_macosx}" = "xyes"
    then
-     BUILTINS="${BUILTINS} macosx"
+     BUILTINS="${BUILTINS} gui/macosx/macosx"
      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
    fi],
   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
-     BUILTINS="${BUILTINS} macosx"
+     BUILTINS="${BUILTINS} gui/macosx/macosx"
      macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework AGL -framework QuickTime -lobjc -ObjC"
    )])
 
@@ -1590,7 +1597,7 @@ AC_ARG_ENABLE(qnx,
     if test "x${enable_qnx}" != "xno"
     then
       AC_CHECK_HEADERS(Ph.h, [
-        PLUGINS="${PLUGINS} qnx"
+        PLUGINS="${PLUGINS} gui/qnx/qnx"
         qnx_LDFLAGS="${qnx_LDFLAGS} -lasound -lph"
       ])
     fi
@@ -1608,7 +1615,7 @@ AC_ARG_ENABLE(intfwin,
     then
       BCBUILDER="${with_bcbuilder}"
     fi
-    PLUGINS="${PLUGINS} intfwin"
+    PLUGINS="${PLUGINS} gui/win32/win32"
   fi ])
 
 dnl
@@ -1617,7 +1624,7 @@ dnl
 AC_ARG_ENABLE(ncurses,
   [  --enable-ncurses        ncurses interface support (default disabled)],
   [if test "x${enable_ncurses}" = "xyes"; then
-     PLUGINS="${PLUGINS} ncurses"
+     PLUGINS="${PLUGINS} gui/ncurses/ncurses"
      ncurses_LDFLAGS="${ncurses_LDFLAGS} -lncurses"
    fi])
 
@@ -1631,7 +1638,7 @@ then
   AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
   if test "x${have_xosd}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} xosd"
+    PLUGINS="${PLUGINS} visualization/xosd/xosd"
     xosd_LDFLAGS="${xosd_LDFLAGS} -lxosd"
   fi
 fi
@@ -1646,7 +1653,7 @@ then
   AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
   if test "x${have_lirc}" = "xtrue"
   then
-    PLUGINS="${PLUGINS} lirc"
+    PLUGINS="${PLUGINS} control/lirc/lirc"
     lirc_LDFLAGS="${lirc_LDFLAGS} -llirc_client"
   fi
 fi
@@ -1879,11 +1886,11 @@ AC_SUBST(mozilla_CFLAGS)
 
 AC_SUBST(a52_CFLAGS)
 AC_SUBST(arts_CFLAGS)
-AC_SUBST(chroma_i420_yuy2_mmx_CFLAGS)
+AC_SUBST(i420_yuy2_mmx_CFLAGS)
 AC_SUBST(dvd_CFLAGS)
 AC_SUBST(dvdread_CFLAGS)
 AC_SUBST(dvdplay_CFLAGS)
-AC_SUBST(mpeg_ts_dvbpsi_CFLAGS)
+AC_SUBST(ts_dvbpsi_CFLAGS)
 AC_SUBST(directx_CFLAGS)
 AC_SUBST(esd_CFLAGS)
 AC_SUBST(familiar_CFLAGS)
@@ -1912,16 +1919,16 @@ AC_SUBST(aa_LDFLAGS)
 AC_SUBST(alsa_LDFLAGS)
 AC_SUBST(arts_LDFLAGS)
 AC_SUBST(beos_LDFLAGS)
-AC_SUBST(chroma_i420_rgb_LDFLAGS)
+AC_SUBST(i420_rgb_LDFLAGS)
 AC_SUBST(directx_LDFLAGS)
 AC_SUBST(dsp_LDFLAGS)
 AC_SUBST(dvd_LDFLAGS)
 AC_SUBST(dvdread_LDFLAGS)
 AC_SUBST(dvdplay_LDFLAGS)
-AC_SUBST(mpeg_ts_dvbpsi_LDFLAGS)
+AC_SUBST(ts_dvbpsi_LDFLAGS)
 AC_SUBST(esd_LDFLAGS)
 AC_SUBST(familiar_LDFLAGS)
-AC_SUBST(filter_distort_LDFLAGS)
+AC_SUBST(distort_LDFLAGS)
 AC_SUBST(ffmpeg_LDFLAGS)
 AC_SUBST(mp4_LDFLAGS)
 AC_SUBST(ggi_LDFLAGS)
diff --git a/doc/mad/API b/doc/mad/API
new file mode 100644 (file)
index 0000000..83a8731
--- /dev/null
@@ -0,0 +1,262 @@
+MAD API documentation collected from e-mails of Joe Drew and Rob Leslie.
+The original e-mails can be found in the docs directory. They contain the
+same information as is presented below.
+
+INDEX
+======
+1. I/O Synchronous Mode
+2. Low-level API
+
+
+
+1. I/O SYNCHRONOUS MODE (extract from Joe Drew)
+===============================================
+MAD operates with callbacks for functions. Each of these functions is
+expected to return type enum mad_flow; this allows you to control the
+decoding process.
+
+MAD always outputs 32-bit (well, mad_fixed_t) little-endian data. Take
+this into account when outputting samples to the sound card.
+Related to the above, since MAD outputs type mad_fixed_t, unless you can
+output with 32-bit accuracy (most sound cards can't), you will have to
+quantize, round, dither, etc these samples to 16-bit (or whatever you
+need.) While there is a sample routine in minimad.c, if you want good
+quality you'll either want to roll your own or take a look in madplay's
+sources.
+
+Integral to understanding MAD: MAD is a decoding library only. You
+handle input and output; you're responsible for fast-forwarding and
+rewinding, if you want that type of functionality. All that MAD will do
+is take input from you, decode the MPEG frames, give you some
+information about them, and give you the decoded PCM data.
+
+Now, the nitty-gritty information.
+
+First, you need a mad_decoder struct. This holds all information about
+how you want your stream decoded, such as input/output functions, error
+handling functions, etc.
+
+mad_decoder_init() sets this structure up for you.
+
+struct mad_decoder decoder;
+struct my_playbuf playbuf;
+
+mad_decoder_init(&decoder, &playbuf, input_func, header_func, /*filter*/
+0, output_func, /*error*/ 0, /* message */ 0);
+
+In this example, the function called to get more data is set to
+input_func, the function called after MPEG headers have been decoded is
+header_func, the function called after all sound data has been decoded
+to PCM (for output) is output_func, and the filter, error, and message
+functions are unset.
+
+Now, MAD runs in a constant decoding loop. It runs something along the
+following lines:
+
+if I'm out of data
+       call input_func
+if input_func says there's no more data,
+       quit
+decode the header and call header_func
+decode the mpeg audio data
+call the filter function
+call the output function
+loop
+
+Now, this is an oversimplification obviously. The important thing to
+realise is that at every step of the process you can tell MAD what to
+do.
+
+Since all of these functions return enum mad_flow, you can tell MAD to
+do any of the following:
+
+enum mad_flow {
+  MAD_FLOW_CONTINUE = 0x0000, /* Keep decoding this stream */
+  MAD_FLOW_STOP     = 0x0010, /* Stop decoding this stream, but exit
+                                normally */
+  MAD_FLOW_BREAK    = 0x0011, /* Stop decoding this stream, and exit
+                                 with an error */
+  MAD_FLOW_IGNORE   = 0x0020  /* Don't decode this frame,
+                                but continue afterwards */
+};
+
+Most of the time you'll probably want to return MAD_FLOW_CONTINUE. In
+every case, you'll have to return one of these values from the functions
+you define.
+
+This is the definition of each of the functions:
+
+enum mad_flow (*input_func)(void *, struct mad_stream *);
+enum mad_flow (*header_func)(void *, struct mad_header const *);
+enum mad_flow (*filter_func)(void *, struct mad_stream const *, struct
+mad_frame *);
+enum mad_flow (*output_func)(void *, struct mad_header const *, struct
+mad_pcm *);
+enum mad_flow (*error_func)(void *, struct mad_stream *, struct
+mad_frame *);
+enum mad_flow (*message_func)(void *, void *, unsigned int *);
+
+In each of these functions the void* pointer passed to the function is
+your "playbuf" structure. This can hold whatever you want - for example,
+song title, length, number of frames - just remember to re-cast it to
+the type you've defined.
+
+input_func takes a mad_stream pointer. Most of the time what you'll want
+to do is something along the lines of the following:
+
+if (more_data_available)
+  buffer = refill_buffer();
+  mad_stream_buffer(stream, buffer, length_of_buffer);
+  return MAD_FLOW_CONTINUE;
+else
+  return MAD_FLOW_STOP;
+
+(On many systems you'll want to use mmap() for this.)
+
+header_func takes a mad_header pointer. This contains most of the
+important information about a given frame; in constant bitrate files, it
+can contain most of the important information about the stream. It will
+give you the length of that frame, using mad_timer_t; the audio layer;
+extension; bitrate... the list is long. Read frame.h or mad.h in the
+frame.h area for more information.
+Again, return MAD_FLOW_{CONTINUE,STOP,BREAK} depending on outside
+conditions.
+
+The only other function I have firsthand information on is output_func;
+in this case, you are given a pointer to struct mad_pcm. This gives you
+the sampling rate, number of channels, and number of samples per
+channel; doing something like the following should work:
+
+mad_fixed_t *left_channel = pcm->samples[0], *right_channel =
+pcm->samples[1];
+int nsamples = pcm->length;
+signed int sample;
+unsigned char * buffer = some_buffer;
+unsigned char * ptr = buffer;
+
+while (nsamples--)
+{
+            sample = (signed int) do_downsample(*left_ch++)
+
+            *ptr++ = (unsigned char) (sample >> 0);
+            *ptr++ = (unsigned char) (sample >> 8);
+
+            sample = (signed int) do_downsample(*right_ch++)
+
+            *ptr++ = (unsigned char) (sample >> 0);
+            *ptr++ = (unsigned char) (sample >> 8);
+}
+
+output buffer to device.
+
+Be sure to handle the big-endian case (autoconf can test for this), and
+also the mono (1 channel) case. See mad.c in mpg321, at the end of the
+file, for an example.
+
+Information on the other (error, filter, message) functions would be
+appreciated, though I think in knowing this information anyone should be
+able to puzzle it out.
+
+Now that the decoder is set up with all these callback functions, you
+call
+
+mad_decoder_run(&decoder, MAD_DECODER_MODE_SYNC);
+
+and then
+
+mad_decoder_finish(&decoder);
+
+Once you've called mad_decoder_finish, you can re-use the decoder
+struct, if you're, for example, within a playlist. Incidentally, all MAD
+structures have similar mad_(whatever)_init and mad_(whatever)_finish
+functions.
+
+I hope this helps people get their feet wet with MAD. Read the source,
+and particularly mad.h - there are a lot of things there you might not
+expect. Rob has done a good job in making MAD a complete solution. :)
+
+
+2. LOW-LEVEL API (extract from Rob Leslie)
+==========================================
+
+By way of clarification, MAD also has a low-level API which does not use
+callbacks. You can control the entire decoding process yourself more or less
+as follows:
+
+  /* load buffer with your MPEG audio data */
+
+  mad_stream_buffer(&stream, buffer, buflen);
+
+  while (1) {
+    mad_frame_decode(&frame, &stream);
+    mad_synth_frame(&synth, &frame);
+
+    /* output PCM samples in synth.pcm */
+  }
+
+This is vastly simplified, but it shows the general idea. mad_frame_decode()
+decodes the next frame's header and subband samples. mad_synth_frame() takes
+those subband samples and synthesizes PCM samples.
+
+It is also possible to call mad_header_decode() before mad_frame_decode().
+This just gives you the frame's header info, in case that's all you want, or
+perhaps to help you decide whether you want to decode the rest of the frame.
+
+As Joe mentions, each of the stream, frame, and synth structs needs to be
+initialized and "finished" before and after use:
+
+  struct mad_stream stream;
+  struct mad_frame frame;
+  struct mad_synth synth;
+
+  mad_stream_init(&stream);
+  mad_frame_init(&frame);
+  mad_synth_init(&synth);
+
+  /* ... */
+
+  mad_synth_finish(&synth);
+  mad_frame_finish(&frame);
+  mad_stream_finish(&stream);
+
+You can work with just a struct mad_header instead of a struct mad_frame if
+you only want to decode frame headers.
+
+Joe writes:
+> MAD always outputs 32-bit (well, mad_fixed_t) little-endian data. Take
+> this into account when outputting samples to the sound card.
+
+This isn't quite right: the mad_fixed_t type is not necessarily little-endian.
+It's the same endianness as the native integer types. Also, it's only
+guaranteed to be *at least* 32 bits wide.
+
+The fixed-point sample format is important to understand, and I recommend
+reading the comments in libmad/fixed.h. The thing to remember when converting
+MAD's fixed-point integer samples to 16-bit PCM (or whatever) is that MAD
+encodes samples as numbers in the full-scale range [-1.0, +1.0) where the
+binary point is placed 28 (MAD_F_FRACBITS) bits to the left of the integer.
+However, you need to be prepared to handle clipping as some numbers may be
+less than -1.0 (-MAD_F_ONE) or greater than or equal to +1.0 (MAD_F_ONE, aka
+1 << MAD_F_FRACBITS).
+
+> Information on the other (error, filter, message) functions would be
+> appreciated, though I think in knowing this information anyone should be
+> able to puzzle it out.
+
+In the high-level API, the error callback function is called whenever a
+decoding error occurs. The error number is in stream->error.
+
+The filter callback function is called after decoding a frame, but before
+synthesis. Here it is possible to modify the frame's subband samples, for
+example to perform a uniform attenuation/amplification, or to do other special
+processing in the frequency domain.
+
+The message callback function is only used with MAD_DECODER_MODE_ASYNC, and is
+called whenever the parent process sends a message via mad_decoder_message().
+This callback can generate a reply by overwriting the message buffer that is
+passed to it. (The size of the reply must be the same or smaller than the
+message.)
+
+
+
+
diff --git a/doc/mad/BUGS b/doc/mad/BUGS
new file mode 100644 (file)
index 0000000..96c3931
--- /dev/null
@@ -0,0 +1,27 @@
+bug #09/11/2001-1: (FIXED 20/11/2001, by JP Saman)
+       Makefile.opts.in and Makefile.opts static libmad.a library is not filled in automatically by configure.
+       It should say in Makefile.opts LIB_MAD=lib/libmad.a
+
+bug #09/11/2001-2: (FIXED december 2001)
+       Libmad is not included in the vlc source code. It is assumed that the library is already available on the machine
+       where the plugin is compiled on. The configure option --with-libmad tells the script where libmad.a or libmad.so library
+       and mad.h include file are installed. E.g. if libmad.a is in /usr/lib and mad.h is in /usr/include then the configure
+       option should be --with-libmad=/usr
+
+bug #12/11/2001-1 (FIXED january 2002)
+       smoothen out audio in libmad_output callback function, by optimizing conversion routines. After investigation
+       and experimenting I found out that my input routine and output routine were not balanced correctly with
+       respect to buffer sizes. A lot of data got lost. I fixed that, but still need a bater scaling/smoothing routine
+       for the audio.
+       I tried a simpler audio scale function, but it did not improve the audio much. Not even on Intel machine, so I suspect the audio
+       decoding to need a bit too much time. The next thing to try is to steer the decoding process by hand (going to a lower level API).
+       Rewriting mad plugin to use a lower level API was not needed. I found the problem by reviewing libmad example code madlld and bbplay.
+       This resulted in a partial rewrite a some parts and a lot of testing. There are still some issues when trying on different CPU's
+       but this will sort itself gradually.
+
+bug #20/11/2001-1 (FIXED 25/11/2001, by JP Saman)
+       synchronization between audio and video output is lost. In libmad_output a timestamp is set on the audio data, but
+       it points to a later video frame, then when the audio data was read. How can I set the correct timestamp on the
+        audio fifo at the time it was read from the bitstream, so that it matches the video frame it belongs to?
+        Solution: Do it in two steps, in the input function save i_pts of fifo and in output function pass saved i_pts to
+        aout_fifo.
diff --git a/doc/mad/DESIGN b/doc/mad/DESIGN
new file mode 100644 (file)
index 0000000..12035ba
--- /dev/null
@@ -0,0 +1,63 @@
+File:  Plugin mad for vlc is based upon libmad from the mad distribution.
+Author: Jean-Paul Saman <jpsaman@wxs.nl>
+
+Directories:
+============
+vlc/plugins/mad                : mad audio decoder plugin for vlc
+
+Interface functions
+===================
+The following interface functions are implemented in the mad plugin.
+
+decoder_Probe  : vlc probes for plugin capabilities
+decoder_Run    : vlc starts a decoder plugin by calling this function
+InitThread     : routine to do some initializations
+EndThread      : cleanup function
+
+The following functions are callback functions for the mad decoder library:
+
+libmad_input   : called when input data is needed
+libmad_output  : called whenever a frame has been decoded
+libmad_header  : called upon decoding of only a frame header
+libmad_messages : libmad messages
+libmad_error   : called whenever an error occured during the decoding process
+
+Design: (ASCII art)
+=======
+It represents the function call flow viewed from the vlc main program. The main program is in charge of allocating decoders,
+initializing, starting and stopping them.
+
+      ---------------  
+      |  <library>  |
+      |   libmad    |
+      ---------------
+            ^
+            |
+      ---------------          
+      |   <plugin>  |
+      |     mad     |
+      _______________
+            ^
+            |
+   ________________________
+   |  <decoder interface> |
+   | vlc plugin interface |
+   ________________________
+
+
+Interface view:
+===============
+                                   [mad decoder plugin]
+                                  ----------------------
+       vlc decoder interface -> | mad_adec     mad_libmad | -> libmad
+                                  -----------------------
+
+Rationel:
+========
+Keeping libmad as a separate library on the system, either dynamic or statically linked in, makes maintenance so much simpeler.
+Merging with a new libmad version should be straight forward as long as the interface stays stable.
+There is another benefit: Disk (actually flash ROM) resources and memory are very limited on a iPaq.
+Other programs or utilities like madplay and BBplay can make use of the same libmad version we do. In this way
+limiting the needed storage place on disk (flash ROM). Also this is only possible when the interface stays the same.
+
+
diff --git a/doc/mad/TODO b/doc/mad/TODO
new file mode 100644 (file)
index 0000000..b19be0a
--- /dev/null
@@ -0,0 +1,40 @@
+TODO: (Jean-Paul Saman <jpsaman@wxs.nl>)
+
+[1 - 30 October 2001, done]
+introduce libmad in vlc-dev code tree, this includes:
+       configure from top level of source tree
+       compilable from top level of source tree
+
+[2 - 25 November 2001, done]
+creating basic mad plugin in vlc-dev code tree, this include:
+       writing most simple vlc-plugin (no fancy stuf)
+       configurable from top level of source tree
+       compilable from top level of source tree
+
+[3 - 25 November 2001, done]
+test basic mad plugin 
+       native Intel
+       native iPaq
+
+[4 - 26 November 2001, done]
+commit to current vlc-dev tree in CVS at VideoLan 
+       fix broken things and conflicts
+       run tests again (see [3])
+       
+[5 - all ready done by Christophe Massiot]
+make cross-compile possible for vlc without interface. With interface it is to damn difficult to do cross-compilation.
+
+[6 - done by fenrir ]
+extending mad plugin with more features
+       do fancy stuff (enable MP3 decoding)
+
+[7 - done ]
+test extended plugin 
+       native Intel
+       native iPaq
+
+[8 - done ]
+commit to current vlc-dev tree in CVS at Videolan
+       fix broken things and conflicts
+       run tests again (see [7])
diff --git a/doc/mad/joe_drew.txt b/doc/mad/joe_drew.txt
new file mode 100644 (file)
index 0000000..97dbab9
--- /dev/null
@@ -0,0 +1,174 @@
+Subject: [mad-dev] Some information about programming with MAD (in synchronous mode)
+
+As the author of mpg321, I too faced the problem of MAD not being
+documented. However, in looking at minimad.c, and re-writing mpg321 to
+use MAD, I came to understand it better. Here's some information which
+will help anybody start out with MAD:
+
+First, some basic information.
+MAD operates with callbacks for functions. Each of these functions is
+expected to return type enum mad_flow; this allows you to control the
+decoding process.
+MAD always outputs 32-bit (well, mad_fixed_t) little-endian data. Take
+this into account when outputting samples to the sound card.
+Related to the above, since MAD outputs type mad_fixed_t, unless you can
+output with 32-bit accuracy (most sound cards can't), you will have to
+quantize, round, dither, etc these samples to 16-bit (or whatever you
+need.) While there is a sample routine in minimad.c, if you want good
+quality you'll either want to roll your own or take a look in madplay's
+sources.
+Integral to understanding MAD: MAD is a decoding library only. You
+handle input and output; you're responsible for fast-forwarding and
+rewinding, if you want that type of functionality. All that MAD will do
+is take input from you, decode the MPEG frames, give you some
+information about them, and give you the decoded PCM data.
+
+Now, the nitty-gritty information.
+
+First, you need a mad_decoder struct. This holds all information about
+how you want your stream decoded, such as input/output functions, error
+handling functions, etc.
+
+mad_decoder_init() sets this structure up for you.
+
+struct mad_decoder decoder;
+struct my_playbuf playbuf;
+
+mad_decoder_init(&decoder, &playbuf, input_func, header_func, /*filter*/
+0, output_func, /*error*/ 0, /* message */ 0);
+
+In this example, the function called to get more data is set to
+input_func, the function called after MPEG headers have been decoded is
+header_func, the function called after all sound data has been decoded
+to PCM (for output) is output_func, and the filter, error, and message
+functions are unset.
+
+Now, MAD runs in a constant decoding loop. It runs something along the
+following lines:
+
+if I'm out of data
+       call input_func
+if input_func says there's no more data,
+       quit
+decode the header and call header_func
+decode the mpeg audio data
+call the filter function
+call the output function
+loop
+
+Now, this is an oversimplification obviously. The important thing to
+realise is that at every step of the process you can tell MAD what to
+do.
+
+Since all of these functions return enum mad_flow, you can tell MAD to
+do any of the following:
+
+enum mad_flow {
+  MAD_FLOW_CONTINUE = 0x0000, /* Keep decoding this stream */
+  MAD_FLOW_STOP     = 0x0010, /* Stop decoding this stream, but exit
+                                normally */
+  MAD_FLOW_BREAK    = 0x0011, /* Stop decoding this stream, and exit
+                                 with an error */
+  MAD_FLOW_IGNORE   = 0x0020  /* Don't decode this frame, 
+                                but continue afterwards */
+};
+
+Most of the time you'll probably want to return MAD_FLOW_CONTINUE. In
+every case, you'll have to return one of these values from the functions
+you define.
+
+This is the definition of each of the functions:
+
+enum mad_flow (*input_func)(void *, struct mad_stream *);
+enum mad_flow (*header_func)(void *, struct mad_header const *);
+enum mad_flow (*filter_func)(void *, struct mad_stream const *, struct
+mad_frame *);
+enum mad_flow (*output_func)(void *, struct mad_header const *, struct
+mad_pcm *);
+enum mad_flow (*error_func)(void *, struct mad_stream *, struct
+mad_frame *);
+enum mad_flow (*message_func)(void *, void *, unsigned int *);
+
+In each of these functions the void* pointer passed to the function is
+your "playbuf" structure. This can hold whatever you want - for example,
+song title, length, number of frames - just remember to re-cast it to
+the type you've defined.
+
+input_func takes a mad_stream pointer. Most of the time what you'll want
+to do is something along the lines of the following:
+
+if (more_data_available)
+  buffer = refill_buffer();
+  mad_stream_buffer(stream, buffer, length_of_buffer);
+  return MAD_FLOW_CONTINUE;
+else
+  return MAD_FLOW_STOP;
+
+(On many systems you'll want to use mmap() for this.)
+
+header_func takes a mad_header pointer. This contains most of the
+important information about a given frame; in constant bitrate files, it
+can contain most of the important information about the stream. It will
+give you the length of that frame, using mad_timer_t; the audio layer;
+extension; bitrate... the list is long. Read frame.h or mad.h in the
+frame.h area for more information.
+Again, return MAD_FLOW_{CONTINUE,STOP,BREAK} depending on outside
+conditions.
+
+The only other function I have firsthand information on is output_func;
+in this case, you are given a pointer to struct mad_pcm. This gives you
+the sampling rate, number of channels, and number of samples per
+channel; doing something like the following should work:
+
+mad_fixed_t *left_channel = pcm->samples[0], *right_channel =
+pcm->samples[1];
+int nsamples = pcm->length;
+signed int sample;
+unsigned char * buffer = some_buffer;
+unsigned char * ptr = buffer;
+
+while (nsamples--)
+{
+            sample = (signed int) do_downsample(*left_ch++)
+
+            *ptr++ = (unsigned char) (sample >> 0);
+            *ptr++ = (unsigned char) (sample >> 8);
+            
+            sample = (signed int) do_downsample(*right_ch++)
+
+            *ptr++ = (unsigned char) (sample >> 0);
+            *ptr++ = (unsigned char) (sample >> 8);
+}
+
+output buffer to device.
+
+Be sure to handle the big-endian case (autoconf can test for this), and
+also the mono (1 channel) case. See mad.c in mpg321, at the end of the
+file, for an example.
+
+Information on the other (error, filter, message) functions would be
+appreciated, though I think in knowing this information anyone should be
+able to puzzle it out.
+
+Now that the decoder is set up with all these callback functions, you
+call 
+
+mad_decoder_run(&decoder, MAD_DECODER_MODE_SYNC);
+
+and then
+
+mad_decoder_finish(&decoder);
+
+Once you've called mad_decoder_finish, you can re-use the decoder
+struct, if you're, for example, within a playlist. Incidentally, all MAD
+structures have similar mad_(whatever)_init and mad_(whatever)_finish
+functions.
+
+I hope this helps people get their feet wet with MAD. Read the source,
+and particularly mad.h - there are a lot of things there you might not
+expect. Rob has done a good job in making MAD a complete solution. :)
+
+-- 
+Joe Drew <hoserhead@woot.net> <drew@debian.org>
+
+Please encrypt email sent to me.
diff --git a/doc/mad/rob_leslie.txt b/doc/mad/rob_leslie.txt
new file mode 100644 (file)
index 0000000..fbe49e4
--- /dev/null
@@ -0,0 +1,124 @@
+From - Mon Nov  5 09:19:09 2001
+Return-Path: <mad-dev-admin@lists.mars.org>
+Received: from smtp01.wxs.nl ([195.121.5.15]) by po05.wxs.nl
+          (Netscape Messaging Server 4.15) with ESMTP id GLLMFJ00.3DF for
+          <jpsaman@wxs.nl>; Mon, 22 Oct 2001 10:33:19 +0200 
+Received: from surveyor.mars.org ([216.98.134.66]) by
+          smtp01.wxs.nl (Netscape Messaging Server 4.15) with ESMTP id
+          GLLMFZ00.C2Z for <jpsaman@wxs.nl>; Mon, 22 Oct 2001 10:33:35 +0200 
+Received: from surveyor.mars.org (localhost [127.0.0.1])
+       by surveyor.mars.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id BAA07654;
+       Mon, 22 Oct 2001 01:32:07 -0700
+Received: from mars.org (localhost [127.0.0.1])
+       by surveyor.mars.org (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id BAA07629
+       for <mad-dev@lists.mars.org>; Mon, 22 Oct 2001 01:31:30 -0700
+Message-Id: <200110220831.BAA07629@surveyor.mars.org>
+X-Authentication-Warning: surveyor.mars.org: Host localhost [127.0.0.1] claimed to be mars.org
+From: Rob Leslie <rob@mars.org>
+To: mad-dev@lists.mars.org
+Subject: Re: [mad-dev] Some information about programming with MAD (in synchronous mode)
+In-reply-to: Your message of "21 Oct 2001 16:13:19 EDT."
+       <1003695199.24019.56.camel@pisces>
+Mime-Version: 1.0 (generated by tm-edit 7.106)
+Content-Type: text/plain; charset=US-ASCII
+Sender: mad-dev-admin@lists.mars.org
+Errors-To: mad-dev-admin@lists.mars.org
+X-BeenThere: mad-dev@lists.mars.org
+X-Mailman-Version: 2.0.1
+Precedence: bulk
+List-Help: <mailto:mad-dev-request@lists.mars.org?subject=help>
+List-Post: <mailto:mad-dev@lists.mars.org>
+List-Subscribe: <http://www.mars.org/bin/mailman/listinfo/mad-dev>,
+       <mailto:mad-dev-request@lists.mars.org?subject=subscribe>
+List-Id: MAD developer's mailing list <mad-dev.lists.mars.org>
+List-Unsubscribe: <http://www.mars.org/bin/mailman/listinfo/mad-dev>,
+       <mailto:mad-dev-request@lists.mars.org?subject=unsubscribe>
+List-Archive: <http://www.mars.org/mailman/public/mad-dev/>
+Date: Mon, 22 Oct 2001 01:31:30 -0700
+X-Mozilla-Status: 8011
+X-Mozilla-Status2: 00000000
+X-UIDL: 1879-1001307689
+
+Joe Drew wrote some good info on the MAD high-level API that I hope will be
+helpful to others.
+
+By way of clarification, MAD also has a low-level API which does not use
+callbacks. You can control the entire decoding process yourself more or less
+as follows:
+
+  /* load buffer with your MPEG audio data */
+
+  mad_stream_buffer(&stream, buffer, buflen);
+
+  while (1) {
+    mad_frame_decode(&frame, &stream);
+    mad_synth_frame(&synth, &frame);
+
+    /* output PCM samples in synth.pcm */
+  }
+
+This is vastly simplified, but it shows the general idea. mad_frame_decode()
+decodes the next frame's header and subband samples. mad_synth_frame() takes
+those subband samples and synthesizes PCM samples.
+
+It is also possible to call mad_header_decode() before mad_frame_decode().
+This just gives you the frame's header info, in case that's all you want, or
+perhaps to help you decide whether you want to decode the rest of the frame.
+
+As Joe mentions, each of the stream, frame, and synth structs needs to be
+initialized and "finished" before and after use:
+
+  struct mad_stream stream;
+  struct mad_frame frame;
+  struct mad_synth synth;
+
+  mad_stream_init(&stream);
+  mad_frame_init(&frame);
+  mad_synth_init(&synth);
+
+  /* ... */
+
+  mad_synth_finish(&synth);
+  mad_frame_finish(&frame);
+  mad_stream_finish(&stream);
+
+You can work with just a struct mad_header instead of a struct mad_frame if
+you only want to decode frame headers.
+
+Joe writes:
+> MAD always outputs 32-bit (well, mad_fixed_t) little-endian data. Take
+> this into account when outputting samples to the sound card.
+
+This isn't quite right: the mad_fixed_t type is not necessarily little-endian.
+It's the same endianness as the native integer types. Also, it's only
+guaranteed to be *at least* 32 bits wide.
+
+The fixed-point sample format is important to understand, and I recommend
+reading the comments in libmad/fixed.h. The thing to remember when converting
+MAD's fixed-point integer samples to 16-bit PCM (or whatever) is that MAD
+encodes samples as numbers in the full-scale range [-1.0, +1.0) where the
+binary point is placed 28 (MAD_F_FRACBITS) bits to the left of the integer.
+However, you need to be prepared to handle clipping as some numbers may be
+less than -1.0 (-MAD_F_ONE) or greater than or equal to +1.0 (MAD_F_ONE, aka
+1 << MAD_F_FRACBITS).
+
+> Information on the other (error, filter, message) functions would be
+> appreciated, though I think in knowing this information anyone should be
+> able to puzzle it out.
+
+In the high-level API, the error callback function is called whenever a
+decoding error occurs. The error number is in stream->error.
+
+The filter callback function is called after decoding a frame, but before
+synthesis. Here it is possible to modify the frame's subband samples, for
+example to perform a uniform attenuation/amplification, or to do other special
+processing in the frequency domain.
+
+The message callback function is only used with MAD_DECODER_MODE_ASYNC, and is
+called whenever the parent process sends a message via mad_decoder_message().
+This callback can generate a reply by overwriting the message buffer that is
+passed to it. (The size of the reply must be the same or smaller than the
+message.)
+
+Cheers,
+  -rob
diff --git a/include/ac3_downmix.h b/include/ac3_downmix.h
deleted file mode 100644 (file)
index 8073795..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*****************************************************************************
- * ac3_downmix.h : AC3 downmix types
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_downmix.h,v 1.6 2002/07/31 20:56:50 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Renaud Dartus <reno@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-struct dm_par_t
-{
-    float unit;
-    float clev;
-    float slev;
-};
-
-struct downmix_t
-{
-    VLC_COMMON_MEMBERS
-
-    /* Module used and shortcuts */
-    module_t * p_module;
-    void (*pf_downmix_3f_2r_to_2ch)(float *, dm_par_t * dm_par);
-    void (*pf_downmix_3f_1r_to_2ch)(float *, dm_par_t * dm_par);
-    void (*pf_downmix_2f_2r_to_2ch)(float *, dm_par_t * dm_par);
-    void (*pf_downmix_2f_1r_to_2ch)(float *, dm_par_t * dm_par);
-    void (*pf_downmix_3f_0r_to_2ch)(float *, dm_par_t * dm_par);
-    void (*pf_stream_sample_2ch_to_s16)(s16 *, float *left, float *right);
-    void (*pf_stream_sample_1ch_to_s16)(s16 *, float *center);
-};
-
diff --git a/include/ac3_imdct.h b/include/ac3_imdct.h
deleted file mode 100644 (file)
index e6e101c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*****************************************************************************
- * ac3_imdct.h : AC3 IMDCT types
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct.h,v 1.10 2002/07/31 20:56:50 sam Exp $
- *
- * Authors: Michel Kaempf <maxx@via.ecp.fr>
- *          Renaud Dartus <reno@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-struct complex_t
-{
-    float real;
-    float imag;
-};
-
-#define N 512
-
-struct imdct_t
-{
-    VLC_COMMON_MEMBERS
-
-    complex_t * buf;
-    void *      buf_orig;                         /* pointer before memalign */
-
-    /* Delay buffer for time domain interleaving */
-    float * delay;
-    void *  delay_orig;                           /* pointer before memalign */
-    float * delay1;
-    void *  delay1_orig;                          /* pointer before memalign */
-
-    /* Twiddle factors for IMDCT */
-    float * xcos1;
-    void *  xcos1_orig;                           /* pointer before memalign */
-    float * xsin1;
-    void *  xsin1_orig;                           /* pointer before memalign */
-    float * xcos2;
-    void *  xcos2_orig;                           /* pointer before memalign */
-    float * xsin2;
-    void *  xsin2_orig;                           /* pointer before memalign */
-    float * xcos_sin_sse;
-    void *  xcos_sin_sse_orig;                    /* pointer before memalign */
-   
-    /* Twiddle factor LUT */
-    complex_t * w_2;
-    void *      w_2_orig;                         /* pointer before memalign */
-    complex_t * w_4;
-    void *      w_4_orig;                         /* pointer before memalign */
-    complex_t * w_8;
-    void *      w_8_orig;                         /* pointer before memalign */
-    complex_t * w_16;
-    void *      w_16_orig;                        /* pointer before memalign */
-    complex_t * w_32;
-    void *      w_32_orig;                        /* pointer before memalign */
-    complex_t * w_64;
-    void *      w_64_orig;                        /* pointer before memalign */
-    complex_t * w_1;
-    void *      w_1_orig;                         /* pointer before memalign */
-    
-    /* Module used and shortcuts */
-    module_t * p_module;
-    void (*pf_imdct_init)    ( imdct_t * );
-    //void (*pf_fft_64p) (complex_t *a);
-    void (*pf_imdct_256)     ( imdct_t *, float [], float [] );
-    void (*pf_imdct_256_nol) ( imdct_t *, float [], float [] );
-    void (*pf_imdct_512)     ( imdct_t *, float [], float [] );
-    void (*pf_imdct_512_nol) ( imdct_t *, float [], float [] );
-};
-
index 690053a..6257e4f 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.h : audio output thread interface
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.50 2002/07/31 20:56:50 sam Exp $
+ * $Id: audio_output.h,v 1.51 2002/08/04 17:23:41 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Cyril Deguet <asmax@via.ecp.fr>
@@ -163,7 +163,7 @@ struct aout_thread_t
 #define AOUT_FMT_S8          0x00000040
 #define AOUT_FMT_U16_LE      0x00000080                 /* Little endian U16 */
 #define AOUT_FMT_U16_BE      0x00000100                    /* Big endian U16 */
-#define AOUT_FMT_AC3         0x00000400                 /* Dolby Digital AC3 */
+#define AOUT_FMT_A52         0x00000400                 /* Dolby Digital A52 */
 
 #ifdef WORDS_BIGENDIAN
 #define AOUT_FMT_S16_NE      AOUT_FMT_S16_BE
@@ -171,8 +171,8 @@ struct aout_thread_t
 #define AOUT_FMT_S16_NE      AOUT_FMT_S16_LE
 #endif
 
-/* Number of samples in an AC3 frame */
-#define AC3_FRAME_SIZE      1536
+/* Number of samples in an A52 frame */
+#define A52_FRAME_SIZE      1536
 
 /* Size of a frame for spdif output */
 #define SPDIF_FRAME_SIZE    6144
index f5cdcd0..ff32291 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-dec.h: structures exported to the VideoLAN decoders
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_ext-dec.h,v 1.65 2002/07/31 20:56:50 sam Exp $
+ * $Id: input_ext-dec.h,v 1.66 2002/08/04 17:23:41 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Kaempf <maxx@via.ecp.fr>
@@ -32,7 +32,7 @@
 #define MPEG2_VIDEO_ES      0x02
 #define MPEG1_AUDIO_ES      0x03
 #define MPEG2_AUDIO_ES      0x04
-#define AC3_AUDIO_ES        0x81
+#define A52_AUDIO_ES        0x81
 /* These ones might violate the norm : */
 #define DVD_SPU_ES          0x82
 #define LPCM_AUDIO_ES       0x83
index f2d5b87..4b107b8 100644 (file)
@@ -4,7 +4,7 @@
  * control the pace of reading. 
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.73 2002/07/31 20:56:50 sam Exp $
+ * $Id: input_ext-intf.h,v 1.74 2002/08/04 17:23:41 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -31,7 +31,7 @@
  */
 /* FIXME ! */
 #define REQUESTED_MPEG         1
-#define REQUESTED_AC3          2
+#define REQUESTED_A52          2
 #define REQUESTED_LPCM         3
 #define REQUESTED_NOAUDIO    255
 
diff --git a/modules/access/.cvsignore b/modules/access/.cvsignore
new file mode 100644 (file)
index 0000000..435f39e
--- /dev/null
@@ -0,0 +1,4 @@
+.dep
+*.lo
+*.o.*
+*.lo.*
diff --git a/modules/access/Makefile b/modules/access/Makefile
new file mode 100644 (file)
index 0000000..fda8268
--- /dev/null
@@ -0,0 +1,3 @@
+file_SOURCES = file.c
+udp_SOURCES = udp.c
+http_SOURCES = http.c
diff --git a/modules/access/dvd/.cvsignore b/modules/access/dvd/.cvsignore
new file mode 100644 (file)
index 0000000..435f39e
--- /dev/null
@@ -0,0 +1,4 @@
+.dep
+*.lo
+*.o.*
+*.lo.*
diff --git a/modules/access/dvd/Makefile b/modules/access/dvd/Makefile
new file mode 100644 (file)
index 0000000..1a9f155
--- /dev/null
@@ -0,0 +1 @@
+dvd_SOURCES = dvd.c access.c demux.c seek.c es.c ifo.c udf.c summary.c
diff --git a/modules/access/dvd/access.c b/modules/access/dvd/access.c
new file mode 100644 (file)
index 0000000..267feba
--- /dev/null
@@ -0,0 +1,827 @@
+/* access.c: DVD access plugin.
+ *****************************************************************************
+ * This plugins should handle all the known specificities of the DVD format,
+ * especially the 2048 bytes logical block size.
+ * It depends on:
+ *  -libdvdcss for access and unscrambling
+ *  -ifo.* for ifo parsing and analyse
+ *  -udf.* to find files
+ *****************************************************************************
+ * Copyright (C) 1998-2001 VideoLAN
+ * $Id: access.c,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Author: Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include <vlc/input.h>
+
+#ifdef HAVE_UNISTD_H
+#   include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef STRNCASECMP_IN_STRINGS_H
+#   include <strings.h>
+#endif
+
+#ifdef GOD_DAMN_DMCA
+#   include "dvdcss.h"
+#else
+#   include <dvdcss/dvdcss.h>
+#endif
+
+#include "dvd.h"
+#include "es.h"
+#include "seek.h"
+#include "ifo.h"
+#include "summary.h"
+#include "iso_lang.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+
+/* called from outside */
+static int  DVDSetArea      ( input_thread_t *, input_area_t * );
+static int  DVDSetProgram   ( input_thread_t *, pgrm_descriptor_t * );
+static ssize_t DVDRead      ( input_thread_t *, byte_t *, size_t );
+static void DVDSeek         ( input_thread_t *, off_t );
+
+static char * DVDParse( input_thread_t * );
+
+/*
+ * Data access functions
+ */
+
+#define DVDTell   LB2OFF( p_dvd->i_vts_start + p_dvd->i_vts_lb ) \
+                  - p_input->stream.p_selected_area->i_start
+
+/*****************************************************************************
+ * DVDOpen: open dvd
+ *****************************************************************************/
+int E_(DVDOpen) ( vlc_object_t *p_this )
+{
+    input_thread_t *     p_input = (input_thread_t *)p_this;
+    char *               psz_device;
+    thread_dvd_data_t *  p_dvd;
+    input_area_t *       p_area;
+    int                  i;
+    char *               psz_dvdcss_env;
+
+    p_dvd = malloc( sizeof(thread_dvd_data_t) );
+    if( p_dvd == NULL )
+    {
+        msg_Err( p_input, "out of memory" );
+        return -1;
+    }
+    p_input->p_access_data = (void *)p_dvd;
+    
+    p_input->pf_read = DVDRead;
+    p_input->pf_seek = DVDSeek;
+    p_input->pf_set_area = DVDSetArea;
+    p_input->pf_set_program = DVDSetProgram;
+
+    /* Parse command line */
+    if( !( psz_device = DVDParse( p_input ) ) )
+    {
+        free( p_dvd );
+        return -1;
+    }
+    
+    /* 
+     * set up input
+     */ 
+    p_input->i_mtu = 0;
+
+    /* override environment variable DVDCSS_METHOD with config option
+     * (FIXME: this creates a small memory leak) */
+    psz_dvdcss_env = config_GetPsz( p_input, "dvd-css-method" );
+    if( psz_dvdcss_env && *psz_dvdcss_env )
+    {
+        char *psz_env;
+
+        psz_env = malloc( strlen("DVDCSS_METHOD=") +
+                          strlen( psz_dvdcss_env ) + 1 );
+
+        if( !psz_env )
+        {
+            free( p_dvd );
+            return -1;
+        }
+
+        sprintf( psz_env, "%s%s", "DVDCSS_METHOD=", psz_dvdcss_env );
+
+        putenv( psz_env );
+    }
+    if( psz_dvdcss_env ) free( psz_dvdcss_env );
+
+    /*
+     *  get plugin ready
+     */ 
+    p_dvd->dvdhandle = dvdcss_open( psz_device );
+    
+    /* free allocated string */
+    free( psz_device );
+
+    if( p_dvd->dvdhandle == NULL )
+    {
+        msg_Err( p_input, "dvdcss cannot open device" );
+        free( p_dvd );
+        return -1;
+    }
+
+    if( dvdcss_seek( p_dvd->dvdhandle, 0, DVDCSS_NOFLAGS ) < 0 )
+    {
+        msg_Err( p_input, "%s", dvdcss_error( p_dvd->dvdhandle ) );
+        dvdcss_close( p_dvd->dvdhandle );
+        free( p_dvd );
+        return -1;
+    }
+
+    /* Ifo allocation & initialisation */
+    if( IfoCreate( p_dvd ) < 0 )
+    {
+        msg_Err( p_input, "allcation error in ifo" );
+        dvdcss_close( p_dvd->dvdhandle );
+        free( p_dvd );
+        return -1;
+    }
+
+    if( IfoInit( p_dvd->p_ifo ) < 0 )
+    {
+        msg_Err( p_input, "fatal failure in ifo" );
+        IfoDestroy( p_dvd->p_ifo );
+        dvdcss_close( p_dvd->dvdhandle );
+        free( p_dvd );
+        return -1;
+    }
+
+    /* Set stream and area data */
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+
+    p_input->stream.i_method = INPUT_METHOD_DVD;
+    p_input->stream.b_pace_control = 1;
+    p_input->stream.b_seekable = 1;
+    p_input->stream.p_selected_area->i_size = 0;
+    p_input->stream.p_selected_area->i_tell = 0;
+
+    /* Initialize ES structures */
+    input_InitStream( p_input, sizeof( stream_ps_data_t ) );
+
+#define title_inf p_dvd->p_ifo->vmg.title_inf
+    msg_Dbg( p_input, "number of titles: %d", title_inf.i_title_nb );
+
+#define area p_input->stream.pp_areas
+    /* We start from 1 here since the default area 0
+     * is reserved for video_ts.vob */
+    for( i = 1 ; i <= title_inf.i_title_nb ; i++ )
+    {
+        input_AddArea( p_input );
+
+        /* Titles are Program Chains */
+        area[i]->i_id = i;
+
+        /* Absolute start offset and size 
+         * We can only set that with vts ifo, so we do it during the
+         * first call to DVDSetArea */
+        area[i]->i_start = 0;
+        area[i]->i_size = 0;
+
+        /* Number of chapters */
+        area[i]->i_part_nb = title_inf.p_attr[i-1].i_chapter_nb;
+        area[i]->i_part = 1;
+
+        /* Offset to vts_i_0.ifo */
+        area[i]->i_plugin_data = p_dvd->p_ifo->i_start +
+                       title_inf.p_attr[i-1].i_start_sector;
+    }   
+#undef area
+    
+    p_dvd->i_title = p_dvd->i_title <= title_inf.i_title_nb ?
+                     p_dvd->i_title : 1;
+#undef title_inf
+
+    p_area = p_input->stream.pp_areas[p_dvd->i_title];
+    
+    p_area->i_part = p_dvd->i_chapter <= p_area->i_part_nb ?
+                     p_dvd->i_chapter : 1;
+    p_dvd->i_chapter = 1;
+    
+    p_dvd->b_new_chapter = 0;
+    p_dvd->i_audio_nb = 0;
+    p_dvd->i_spu_nb = 0;
+    
+    /* set title, chapter, audio and subpic */
+    if( DVDSetArea( p_input, p_area ) < 0 )
+    {
+        vlc_mutex_unlock( &p_input->stream.stream_lock );
+        IfoDestroy( p_dvd->p_ifo );
+        dvdcss_close( p_dvd->dvdhandle );
+        free( p_dvd );
+        return -1;
+    }
+
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    p_input->psz_demux = "dvdold";
+
+    return 0;
+}
+
+/*****************************************************************************
+ * DVDClose: close dvd
+ *****************************************************************************/
+void E_(DVDClose) ( vlc_object_t *p_this )
+{
+    input_thread_t * p_input = (input_thread_t *)p_this;
+    thread_dvd_data_t *p_dvd = (thread_dvd_data_t*)p_input->p_access_data;
+
+    IfoDestroy( p_dvd->p_ifo );
+    dvdcss_close( p_dvd->dvdhandle );
+    free( p_dvd );
+}
+
+/*****************************************************************************
+ * DVDSetProgram: used to change angle
+ *****************************************************************************/
+static int DVDSetProgram( input_thread_t    * p_input,
+                          pgrm_descriptor_t * p_program ) 
+{
+    if( p_input->stream.p_selected_program != p_program )
+    {
+        thread_dvd_data_t *  p_dvd;
+        int                  i_angle;
+    
+        p_dvd   = (thread_dvd_data_t*)(p_input->p_access_data);
+        i_angle = p_program->i_number;
+
+        /* DVD is actually mono-program: we only need the current angle
+         * number, so copy the data between programs */
+        memcpy( p_program,
+                p_input->stream.p_selected_program,
+                sizeof(pgrm_descriptor_t) );
+        p_program->i_number                = i_angle;
+        p_input->stream.p_selected_program = p_program;
+
+#define title \
+    p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
+        if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
+        {
+            if( ( p_program->i_number - p_dvd->i_angle ) < 0 )
+            {
+                /* we have to go backwards */
+                p_dvd->i_map_cell = 0;
+            }
+            p_dvd->i_prg_cell += ( p_program->i_number - p_dvd->i_angle );
+            p_dvd->i_map_cell =  CellPrg2Map( p_dvd );
+            p_dvd->i_map_cell += p_dvd->i_angle_cell;
+            p_dvd->i_vts_lb   =  CellFirstSector( p_dvd );
+            p_dvd->i_last_lb  =  CellLastSector( p_dvd );
+            p_dvd->i_angle    =  p_program->i_number;
+        }
+        else
+        {
+            p_dvd->i_angle    =  p_program->i_number;
+        }
+#undef title
+        msg_Dbg( p_input, "angle %d selected", p_dvd->i_angle );
+    }
+
+    return 0;
+}
+
+/*****************************************************************************
+ * DVDSetArea: initialize input data for title x, chapter y.
+ * It should be called for each user navigation request.
+ *****************************************************************************
+ * Take care that i_title starts from 0 (vmg) and i_chapter start from 1.
+ * Note that you have to take the lock before entering here.
+ *****************************************************************************/
+#define vmg p_dvd->p_ifo->vmg
+#define vts p_dvd->p_ifo->vts
+
+static void DVDFlushStream( input_thread_t * p_input )
+{
+    if( p_input->stream.pp_programs != NULL )
+    {
+        /* We don't use input_EndStream here since
+         * we keep area structures */
+        while( p_input->stream.i_es_number )
+        {
+            input_DelES( p_input, p_input->stream.pp_es[0] );
+        }
+        
+        while( p_input->stream.i_pgrm_number )
+        {
+            input_DelProgram( p_input, p_input->stream.pp_programs[0] );
+        }
+
+        if( p_input->stream.pp_selected_es )
+        {
+            free( p_input->stream.pp_selected_es );
+            p_input->stream.pp_selected_es = NULL;
+        }
+        p_input->stream.i_selected_es_number = 0;
+    }
+
+    return;
+}
+
+static int DVDReadAngle( input_thread_t * p_input )
+{
+    thread_dvd_data_t * p_dvd;
+    int                 i_angle_nb;
+    int                 i;
+
+    p_dvd      = (thread_dvd_data_t*)(p_input->p_access_data);
+    i_angle_nb = vmg.title_inf.p_attr[p_dvd->i_title-1].i_angle_nb;
+    
+    input_AddProgram( p_input, 1, sizeof( stream_ps_data_t ) );
+    p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
+
+    for( i = 1 ; i < i_angle_nb ; i++ )
+    {
+        input_AddProgram( p_input, i+1, 0 );
+    }
+
+    return i_angle_nb;
+}
+
+static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
+{
+    thread_dvd_data_t *  p_dvd;
+
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+
+    /* we can't use the interface slider until initilization is complete */
+    p_input->stream.b_seekable = 0;
+
+    if( p_area != p_input->stream.p_selected_area )
+    {
+        int     i_vts_title;
+        u32     i_first;
+        u32     i_last;
+
+        /* Reset the Chapter position of the old title */
+        p_input->stream.p_selected_area->i_part = 1;
+        p_input->stream.p_selected_area         = p_area;
+
+        /*
+         *  We have to load all title information
+         */
+
+        /* title number as it appears in the interface list */
+        p_dvd->i_title      = p_area->i_id;
+        p_dvd->i_chapter_nb = p_area->i_part_nb;
+
+        if( IfoTitleSet( p_dvd->p_ifo, p_dvd->i_title ) < 0 )
+        {
+            msg_Err( p_input, "fatal error in vts ifo" );
+            free( p_dvd );
+            return -1;
+        }
+
+        /* title position inside the selected vts */
+        i_vts_title       = vmg.title_inf.p_attr[p_dvd->i_title-1].i_title_num;
+        p_dvd->i_title_id =
+            vts.title_inf.p_title_start[i_vts_title-1].i_title_id;
+
+        msg_Dbg( p_input, "title %d vts_title %d pgc %d",
+                          p_dvd->i_title, i_vts_title, p_dvd->i_title_id );
+
+        /* title set offset XXX: convert to block values */
+        p_dvd->i_vts_start =
+            vts.i_pos + vts.manager_inf.i_title_vob_start_sector;
+
+        /* last cell */
+        p_dvd->i_prg_cell = -1 +
+            vts.title_unit.p_title[p_dvd->i_title_id-1].title.i_cell_nb;
+        p_dvd->i_map_cell = 0;
+        p_dvd->i_map_cell = CellPrg2Map( p_dvd );
+        i_last            = CellLastSector( p_dvd );
+
+        /* first cell */
+        p_dvd->i_prg_cell   = 0;
+        p_dvd->i_map_cell   = 0;
+        p_dvd->i_angle_cell = 0;
+        p_dvd->i_map_cell   = CellPrg2Map    ( p_dvd );
+        p_dvd->i_vts_lb     = CellFirstSector( p_dvd );
+        p_dvd->i_last_lb    = CellLastSector ( p_dvd );
+
+        /* Force libdvdcss to check its title key.
+         * It is only useful for title cracking method. Methods using the
+         * decrypted disc key are fast enough to check the key at each seek */
+        i_first = dvdcss_seek( p_dvd->dvdhandle,
+                               p_dvd->i_vts_start + p_dvd->i_vts_lb,
+                               DVDCSS_SEEK_KEY );
+        if( i_first < 0 )
+        {
+            msg_Err( p_input, "%s", dvdcss_error( p_dvd->dvdhandle ) );
+            return -1;
+        }
+
+        /* Area definition */
+        p_input->stream.p_selected_area->i_start = LB2OFF( i_first );
+        p_input->stream.p_selected_area->i_size  =
+                                        LB2OFF( i_last + 1 - p_dvd->i_vts_lb );
+
+        /* Destroy obsolete ES by reinitializing programs */
+        DVDFlushStream( p_input );
+        
+        /* Angle management: angles are handled through programs */
+        p_dvd->i_angle_nb = DVDReadAngle( p_input );
+        if( ( p_dvd->i_angle <= 0 ) || p_dvd->i_angle > p_dvd->i_angle_nb )
+        {
+            p_dvd->i_angle = 1;
+        }
+       
+        DVDSetProgram( p_input,
+                       p_input->stream.pp_programs[p_dvd->i_angle-1] ); 
+
+        msg_Dbg( p_input, "title first %i, last %i, size %i",
+                          i_first, i_last, i_last + 1 - p_dvd->i_vts_lb );
+        IfoPrintTitle( p_dvd );
+
+        /* No PSM to read in DVD mode, we already have all information */
+        p_input->stream.p_selected_program->b_is_ok = 1;
+
+        /* Find all ES in title with ifo data */
+        DVDReadVideo( p_input );
+        DVDReadAudio( p_input );
+        DVDReadSPU  ( p_input );
+   
+        if( p_input->p_demux )
+        {
+            DVDLaunchDecoders( p_input );
+        }
+
+    } /* i_title >= 0 */
+    else
+    {
+        p_area = p_input->stream.p_selected_area;
+    }
+
+    /* Chapter selection */
+    p_dvd->i_chapter = DVDSetChapter( p_dvd, p_area->i_part );
+    
+    p_input->stream.p_selected_area->i_tell = DVDTell;
+
+    /* warn interface that something has changed */
+    p_input->stream.b_seekable = 1;
+    p_input->stream.b_changed  = 1;
+
+    return 0;
+}
+#undef vts
+#undef vmg
+
+#define title \
+    p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
+    
+/*****************************************************************************
+ * DVDRead: reads data packets.
+ *****************************************************************************
+ * Returns -1 in case of error, 0 in case of EOF, otherwise the number of
+ * bytes.
+ *****************************************************************************/
+static ssize_t DVDRead( input_thread_t * p_input,
+                        byte_t * p_buffer, size_t i_count )
+{
+    thread_dvd_data_t *     p_dvd;
+    int                     i_read;
+    int                     i_blocks;
+    int                     i_block_once = 0;
+
+    p_dvd = (thread_dvd_data_t *)(p_input->p_access_data);
+
+    i_read = 0;
+    i_blocks = OFF2LB(i_count);
+
+    while( i_blocks )
+    {
+        i_block_once = LbMaxOnce( p_dvd );
+        if( i_block_once > i_blocks )
+        {
+            i_block_once = i_blocks;
+        }
+        else if( i_block_once <= 0 )
+        {
+            /* EOT */
+            break;
+        }
+
+        if( i_block_once != dvdcss_read( p_dvd->dvdhandle, p_buffer,
+                                         i_block_once, DVDCSS_READ_DECRYPT ) )
+        {
+            return -1;
+        }
+
+        i_blocks -= i_block_once;
+        i_read += i_block_once;
+        p_buffer += LB2OFF( i_block_once );
+
+        /* Update global position */
+        p_dvd->i_vts_lb += i_block_once;
+    }
+
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+
+    p_input->stream.p_selected_area->i_tell += LB2OFF( i_read );
+    if( p_dvd->b_new_chapter )
+    {
+        p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
+        p_dvd->b_new_chapter                    = 0;
+    }
+
+    if( ( p_input->stream.p_selected_area->i_tell
+            >= p_input->stream.p_selected_area->i_size )
+       || ( i_block_once  <= 0 ) )
+    {
+        if( ( p_dvd->i_title + 1 ) >= p_input->stream.i_area_nb )
+        {
+            /* EOF */
+            vlc_mutex_unlock( &p_input->stream.stream_lock );
+            return 0;
+        }
+
+        /* EOT */
+        msg_Dbg( p_input, "new title" );
+        p_dvd->i_title++;
+        DVDSetArea( p_input, p_input->stream.pp_areas[p_dvd->i_title] );
+    }
+
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    return LB2OFF( i_read );
+}
+
+/*****************************************************************************
+ * DVDSeek : Goes to a given position on the stream.
+ *****************************************************************************
+ * This one is used by the input and translate chronological position from
+ * input to logical position on the device.
+ * The lock should be taken before calling this function.
+ *****************************************************************************/
+static void DVDSeek( input_thread_t * p_input, off_t i_off )
+{
+    thread_dvd_data_t *     p_dvd;
+    
+    p_dvd = ( thread_dvd_data_t * )(p_input->p_access_data);
+
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+    p_dvd->i_vts_lb = OFF2LB(i_off + p_input->stream.p_selected_area->i_start)
+                       - p_dvd->i_vts_start;
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    p_dvd->i_prg_cell = Lb2CellPrg( p_dvd );
+    p_dvd->i_map_cell = Lb2CellMap( p_dvd );
+    
+    if( CellIsInterleaved( p_dvd ) )
+    {
+        /* if we're inside a multi-angle zone, we have to choose i_sector
+         * in the current angle ; we can't do it all the time since cells
+         * can be very wide out of such zones */
+        p_dvd->i_vts_lb = CellFirstSector( p_dvd );
+    }
+    
+    p_dvd->i_last_lb  = CellLastSector( p_dvd );
+    p_dvd->i_chapter  = CellPrg2Chapter( p_dvd );
+
+    if( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_vts_start + p_dvd->i_vts_lb,
+                     DVDCSS_SEEK_MPEG ) < 0 )
+    {
+        msg_Err( p_input, "%s", dvdcss_error( p_dvd->dvdhandle ) );
+        p_input->b_error = 1;
+        return;
+    }
+
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+    p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
+    p_input->stream.p_selected_area->i_tell = DVDTell;
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    msg_Dbg( p_input, "program cell: %d cell: %d chapter: %d tell %lld",
+             p_dvd->i_prg_cell, p_dvd->i_map_cell, p_dvd->i_chapter, DVDTell );
+
+    return;
+}
+
+/*****************************************************************************
+ * DVDParse: parse command line
+ *****************************************************************************/
+static char * DVDParse( input_thread_t * p_input )
+{
+    thread_dvd_data_t *  p_dvd;
+    struct stat          stat_info;
+    char *               psz_parser;
+    char *               psz_device;
+    char *               psz_raw;
+    char *               psz_next;
+    vlc_bool_t           b_options = 0;
+    int                  i_title = 1;
+    int                  i_chapter = 1;
+    int                  i_angle = 1;
+    int                  i;
+
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+
+#ifdef WIN32
+    /* On Win32 we want the DVD access plugin to be explicitly requested,
+     * we end up with lots of problems otherwise */
+    if( !p_input->psz_access || !*p_input->psz_access ) return NULL;
+#endif
+
+    psz_parser = psz_device = strdup( p_input->psz_name );
+    if( !psz_parser )
+    {
+        return NULL;
+    }
+
+    /* Parse input string :
+     * [device][@rawdevice][@[title][,[chapter][,angle]]] */
+    while( *psz_parser && *psz_parser != '@' )
+    {
+        psz_parser++;
+    }
+
+    if( *psz_parser == '@' )
+    {
+        /* Maybe found raw device or option list */
+        *psz_parser = '\0';
+        psz_raw = ++psz_parser;
+    }
+    else
+    {
+        psz_raw = "";
+    }
+
+    if( *psz_parser && !strtol( psz_parser, NULL, 10 ) )
+    {
+        /* what we've found is either a raw device or a partial option
+         * list e.g. @,29 or both a device and a list ; search end of string */
+        while( *psz_parser && *psz_parser != '@' )
+        {
+            psz_parser++;
+        }
+        
+        if( *psz_parser == '@' )
+        {
+            /* found end of raw device, and beginning of options */
+            *psz_parser = '\0';
+            ++psz_parser;
+            b_options = 1;
+        }
+        else
+        {
+            psz_parser = psz_raw + 1;
+            for( i=0 ; i<3 ; i++ )
+            {
+                if( !*psz_parser )
+                {
+                    /* we have only a raw device */
+                    break;
+                }
+                if( strtol( psz_parser, NULL, 10 ) )
+                {
+                    /* we have only a partial list of options, no device */
+                    psz_parser = psz_raw;
+                    psz_raw = "";
+                    b_options = 1;
+                    break;
+                }
+                psz_parser++;
+            }
+        }
+    }
+    else
+    {
+        /* found beginning of options ; no raw device specified */
+        psz_raw = "";
+        b_options = 1;
+    }
+
+    if( b_options )
+    {
+        /* Found options */
+        i_title = (int)strtol( psz_parser, &psz_next, 10 );
+        if( *psz_next )
+        {
+            psz_parser = psz_next + 1;
+            i_chapter = (int)strtol( psz_parser, &psz_next, 10 );
+            if( *psz_next )
+            {
+                i_angle = (int)strtol( psz_next + 1, NULL, 10 );
+            }
+        }
+
+        p_dvd->i_title = i_title ? i_title : 1;
+        p_dvd->i_chapter = i_chapter ? i_chapter : 1;
+        p_dvd->i_angle = i_angle ? i_angle : 1;
+    }
+
+    if( *psz_raw )
+    {
+        if( *psz_raw )
+        {
+            /* check the raw device */
+            if( stat( psz_raw, &stat_info ) == -1 )
+            {
+                msg_Warn( p_input, "cannot stat() raw device `%s' (%s)",
+                                   psz_raw, strerror(errno));
+                /* put back '@' */
+                *(psz_raw - 1) = '@';
+                psz_raw = "";
+            }
+            else
+            {
+                char * psz_env;
+                
+#ifndef WIN32    
+                if( !S_ISCHR(stat_info.st_mode) )
+                {
+                    msg_Warn( p_input, "raw device %s is"
+                              " not a valid char device", psz_raw );
+                    /* put back '@' */
+                    *(psz_raw - 1) = '@';
+                    psz_raw = "";
+                }
+                else
+#endif
+                {
+                    psz_env = malloc( strlen("DVDCSS_RAW_DEVICE=")
+                                    + strlen( psz_raw ) + 1 );
+                    sprintf( psz_env, "DVDCSS_RAW_DEVICE=%s", psz_raw );
+                    putenv( psz_env );
+                }
+            }
+        }
+        else
+        {
+            psz_raw = "";
+        }
+    }
+    
+    if( !*psz_device )
+    {
+        free( psz_device );
+        
+        if( !p_input->psz_access )
+        {
+            /* no device and no access specified: we probably don't want DVD */
+            return NULL;
+        }
+        psz_device = config_GetPsz( p_input, "dvd" );
+    }
+
+#ifndef WIN32    
+    /* check block device */
+    if( stat( psz_device, &stat_info ) == -1 )
+    {
+        msg_Err( p_input, "cannot stat() device `%s' (%s)",
+                          psz_device, strerror(errno));
+        free( psz_device );
+        return NULL;                    
+    }
+    
+    if( !S_ISBLK(stat_info.st_mode) && !S_ISCHR(stat_info.st_mode) )
+    {
+        msg_Warn( p_input,
+                  "dvd module discarded (not a valid block device)" );
+        free( psz_device );
+        return NULL;
+    }
+#endif
+    
+    msg_Dbg( p_input, "dvd=%s raw=%s title=%d chapter=%d angle=%d",
+                      psz_device, psz_raw, p_dvd->i_title,
+                      p_dvd->i_chapter, p_dvd->i_angle );
+
+    return psz_device;
+} 
diff --git a/modules/access/dvd/demux.c b/modules/access/dvd/demux.c
new file mode 100644 (file)
index 0000000..b2c7bdc
--- /dev/null
@@ -0,0 +1,112 @@
+/* demux.c: DVD demux functions.
+ *****************************************************************************
+ * Copyright (C) 1998-2001 VideoLAN
+ * $Id: demux.c,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Author: Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include <vlc/input.h>
+
+#ifdef HAVE_UNISTD_H
+#   include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef STRNCASECMP_IN_STRINGS_H
+#   include <strings.h>
+#endif
+
+/* how many packets DVDDemux will read in each loop */
+#define DVD_READ_ONCE 64
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  DVDDemux   ( input_thread_t * );
+
+void DVDLaunchDecoders( input_thread_t * );
+
+/*
+ * Data demux functions
+ */
+
+/*****************************************************************************
+ * DVDInit: initializes DVD structures
+ *****************************************************************************/
+int E_(DVDInit) ( vlc_object_t *p_this )
+{
+    input_thread_t *p_input = (input_thread_t *)p_this;
+
+    if( p_input->stream.i_method != INPUT_METHOD_DVD )
+    {
+        return -1;
+    }
+
+    p_input->pf_demux = DVDDemux;
+    p_input->pf_rewind = NULL;
+
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+    
+    DVDLaunchDecoders( p_input );
+    
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+    return 0;
+}
+
+/*****************************************************************************
+ * DVDDemux
+ *****************************************************************************/
+static int DVDDemux( input_thread_t * p_input )
+{
+    data_packet_t *     p_data;
+    ssize_t             i_result;
+    int                 i;
+
+    /* Read headers to compute payload length */
+    for( i = 0 ; i < DVD_READ_ONCE ; i++ )
+    {
+        i_result = input_ReadPS( p_input, &p_data );
+
+        if( i_result < 0 )
+        {
+            return i_result;
+        }
+        else if( i_result == 0 )
+        {
+            return i;
+        }
+
+        input_DemuxPS( p_input, p_data );
+    }
+    
+    return i;
+}
diff --git a/modules/access/dvd/dvd.c b/modules/access/dvd/dvd.c
new file mode 100644 (file)
index 0000000..c229f70
--- /dev/null
@@ -0,0 +1,336 @@
+/*****************************************************************************
+ * dvd.c : DVD input module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000-2001 VideoLAN
+ * $Id: dvd.c,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>                                              /* strdup() */
+
+#include <vlc/vlc.h>
+
+#ifdef GOD_DAMN_DMCA
+#   include <stdio.h>
+#   include <fcntl.h>
+#   include <unistd.h>
+#   include <sys/types.h>
+#   include <sys/stat.h>
+#   include <sys/uio.h>                                      /* struct iovec */
+#   include <sys/ioctl.h>
+#   include <dlfcn.h>
+#   include <netinet/in.h>
+#   include <linux/cdrom.h>
+
+#   include "dvdcss.h"
+#endif
+
+/*****************************************************************************
+ * Local prototypes.
+ *****************************************************************************/
+int  E_(DVDOpen)   ( vlc_object_t * );
+void E_(DVDClose)  ( vlc_object_t * );
+
+int  E_(DVDInit)   ( vlc_object_t * );
+
+#ifdef GOD_DAMN_DMCA
+static void *p_libdvdcss;
+static void ProbeLibDVDCSS  ( void );
+static void UnprobeLibDVDCSS( void );
+#endif
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+#define CSSMETHOD_TEXT N_("Method to use by libdvdcss for key decryption")
+#define CSSMETHOD_LONGTEXT N_( \
+    "title: decrypted title key is guessed from the encrypted sectors of " \
+           "the stream. Thus it should work with a file as well as the " \
+           "DVD device. But it sometimes takes much time to decrypt a title " \
+           "key and may even fail. With this method, the key is only checked "\
+           "at the beginning of each title, so it won't work if the key " \
+           "changes in the middle of a title.\n" \
+    "disc: the disc key is first cracked, then all title keys can be " \
+           "decrypted instantly, which allows us to check them often.\n" \
+    "key: the same as \"disc\" if you don't have a file with player keys " \
+           "at compilation time. If you do, the decryption of the disc key " \
+           "will be faster with this method. It is the one that was used by " \
+           "libcss.\n" \
+    "The default method is: key.")
+
+static char *cssmethod_list[] = { "title", "disc", "key", NULL };
+
+vlc_module_begin();
+    int i;
+    add_category_hint( N_("[dvd:][device][@raw_device][@[title][,[chapter][,angle]]]"), NULL );
+    add_string_from_list( "dvd-css-method", NULL, cssmethod_list, NULL,
+                          CSSMETHOD_TEXT, CSSMETHOD_LONGTEXT );
+#ifdef GOD_DAMN_DMCA
+    set_description( _("DVD input module, uses libdvdcss if installed") );
+    i = 90;
+#else
+    set_description( _("DVD input module, uses libdvdcss") );
+    i = 100;
+#endif
+    add_shortcut( "dvdold" );
+    add_submodule();
+        set_capability( "access", i );
+        set_callbacks( E_(DVDOpen), E_(DVDClose) );
+    add_submodule();
+        set_capability( "demux", 0 );
+        set_callbacks( E_(DVDInit), NULL );
+#ifdef GOD_DAMN_DMCA
+    ProbeLibDVDCSS();
+#endif
+vlc_module_end();
+
+#if 0 /* FIXME */
+    UnprobeLibDVDCSS();
+#endif
+
+/* Following functions are local */
+
+#ifdef GOD_DAMN_DMCA
+/*****************************************************************************
+ * ProbeLibDVDCSS: look for a libdvdcss object.
+ *****************************************************************************
+ * This functions looks for libdvdcss, using dlopen(), and fills function
+ * pointers with what it finds. On failure, uses the dummy libdvdcss
+ * replacement provided by vlc.
+ *****************************************************************************/
+static void ProbeLibDVDCSS( void )
+{
+    static char *pp_filelist[] = { "libdvdcss.so.2",
+                                   "./libdvdcss.so.2",
+                                   "./lib/libdvdcss.so.2",
+                                   "libdvdcss.so.1",
+                                   "./libdvdcss.so.1",
+                                   "./lib/libdvdcss.so.1",
+                                   NULL };
+    char **pp_file = pp_filelist;
+
+    /* Try to open the dynamic object */
+    do
+    {
+        p_libdvdcss = dlopen( *pp_file, RTLD_LAZY );
+        if( p_libdvdcss != NULL )
+        {
+//X            intf_WarnMsg( 2, "module: builtin module `dvd' found libdvdcss "
+//X                             "in `%s'", *pp_file );
+            break;
+        }
+        pp_file++;
+
+    } while( *pp_file != NULL );
+
+    /* If libdvdcss.so was found, check that it's valid */
+    if( p_libdvdcss == NULL )
+    {
+//X        intf_ErrMsg( "dvd warning: libdvdcss.so.2 not present" );
+    }
+    else
+    {
+        ____dvdcss_open = dlsym( p_libdvdcss, "dvdcss_open" );
+        ____dvdcss_close = dlsym( p_libdvdcss, "dvdcss_close" );
+        ____dvdcss_title = dlsym( p_libdvdcss, "dvdcss_title" );
+        ____dvdcss_seek = dlsym( p_libdvdcss, "dvdcss_seek" );
+        ____dvdcss_read = dlsym( p_libdvdcss, "dvdcss_read" );
+        ____dvdcss_readv = dlsym( p_libdvdcss, "dvdcss_readv" );
+        ____dvdcss_error = dlsym( p_libdvdcss, "dvdcss_error" );
+
+        if( ____dvdcss_open == NULL || ____dvdcss_close == NULL
+             || ____dvdcss_title == NULL || ____dvdcss_seek == NULL
+             || ____dvdcss_read == NULL || ____dvdcss_readv == NULL
+             || ____dvdcss_error == NULL )
+        {
+//X            intf_ErrMsg( "dvd warning: missing symbols in libdvdcss.so.2, "
+//X                         "this shouldn't happen !" );
+            dlclose( p_libdvdcss );
+            p_libdvdcss = NULL;
+        }
+    }
+
+    /* If libdvdcss was not found or was not valid, use the dummy
+     * replacement functions. */
+    if( p_libdvdcss == NULL )
+    {
+//X        intf_ErrMsg( "dvd warning: no valid libdvdcss found, "
+//X                     "I will only play unencrypted DVDs" );
+//X        intf_ErrMsg( "dvd warning: get libdvdcss at "
+//X                     "http://www.videolan.org/libdvdcss/" );
+
+        ____dvdcss_open = dummy_dvdcss_open;
+        ____dvdcss_close = dummy_dvdcss_close;
+        ____dvdcss_title = dummy_dvdcss_title;
+        ____dvdcss_seek = dummy_dvdcss_seek;
+        ____dvdcss_read = dummy_dvdcss_read;
+        ____dvdcss_readv = dummy_dvdcss_readv;
+        ____dvdcss_error = dummy_dvdcss_error;
+    }
+}
+
+/*****************************************************************************
+ * UnprobeLibDVDCSS: free resources allocated by ProbeLibDVDCSS, if any.
+ *****************************************************************************/
+static void UnprobeLibDVDCSS( void )
+{
+    if( p_libdvdcss != NULL )
+    {
+        dlclose( p_libdvdcss );
+        p_libdvdcss = NULL;
+    }
+}
+
+/* Dummy libdvdcss with minimal DVD access. */
+
+/*****************************************************************************
+ * Local structure
+ *****************************************************************************/
+struct dvdcss_s
+{
+    /* File descriptor */
+    int i_fd;
+};
+
+/*****************************************************************************
+ * dvdcss_open: initialize library, open a DVD device, crack CSS key
+ *****************************************************************************/
+extern dvdcss_handle dummy_dvdcss_open ( char *psz_target )
+{
+    dvdcss_handle dvdcss;
+    dvd_struct    dvd;
+
+    /* Allocate the library structure */
+    dvdcss = malloc( sizeof( struct dvdcss_s ) );
+    if( dvdcss == NULL )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not allocate memory\n" );
+        return NULL;
+    }
+
+    /* Open the device */
+    dvdcss->i_fd = open( psz_target, 0 );
+    if( dvdcss->i_fd < 0 )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not open device\n" );
+        free( dvdcss );
+        return NULL;
+    }
+
+    /* Check for encryption or ioctl failure */
+    dvd.type = DVD_STRUCT_COPYRIGHT;
+    dvd.copyright.layer_num = 0;
+    if( ioctl( dvdcss->i_fd, DVD_READ_STRUCT, &dvd ) != 0
+         || dvd.copyright.cpst )
+    {
+        fprintf( stderr, "dvd error: "
+                         "dummy libdvdcss could not decrypt disc\n" );
+        close( dvdcss->i_fd );
+        free( dvdcss );
+        return NULL;
+    }
+
+    return dvdcss;
+}
+
+/*****************************************************************************
+ * dvdcss_error: return the last libdvdcss error message
+ *****************************************************************************/
+extern char * dummy_dvdcss_error ( dvdcss_handle dvdcss )
+{
+    return "generic error";
+}
+
+/*****************************************************************************
+ * dvdcss_seek: seek into the device
+ *****************************************************************************/
+extern int dummy_dvdcss_seek ( dvdcss_handle dvdcss, int i_blocks,
+                                                     int i_flags )
+{
+    off_t i_read;
+
+    i_read = lseek( dvdcss->i_fd,
+                    (off_t)i_blocks * (off_t)DVDCSS_BLOCK_SIZE, SEEK_SET );
+
+    return i_read / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_title: crack the current title key if needed
+ *****************************************************************************/
+extern int dummy_dvdcss_title ( dvdcss_handle dvdcss, int i_block )
+{
+    return 0;
+}
+
+/*****************************************************************************
+ * dvdcss_read: read data from the device, decrypt if requested
+ *****************************************************************************/
+extern int dummy_dvdcss_read ( dvdcss_handle dvdcss, void *p_buffer,
+                                                     int i_blocks,
+                                                     int i_flags )
+{
+    int i_bytes;
+
+    i_bytes = read( dvdcss->i_fd, p_buffer,
+                    (size_t)i_blocks * DVDCSS_BLOCK_SIZE );
+
+    return i_bytes / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_readv: read data to an iovec structure, decrypt if reaquested
+ *****************************************************************************/
+extern int dummy_dvdcss_readv ( dvdcss_handle dvdcss, void *p_iovec,
+                                                      int i_blocks,
+                                                      int i_flags )
+{
+    int i_read;
+
+    i_read = readv( dvdcss->i_fd, (struct iovec*)p_iovec, i_blocks );
+
+    return i_read / DVDCSS_BLOCK_SIZE;
+}
+
+/*****************************************************************************
+ * dvdcss_close: close the DVD device and clean up the library
+ *****************************************************************************/
+extern int dummy_dvdcss_close ( dvdcss_handle dvdcss )
+{
+    int i_ret;
+
+    i_ret = close( dvdcss->i_fd );
+
+    if( i_ret < 0 )
+    {
+        return i_ret;
+    }
+
+    free( dvdcss );
+
+    return 0;
+}
+
+#endif
+
diff --git a/modules/access/dvd/dvd.h b/modules/access/dvd/dvd.h
new file mode 100644 (file)
index 0000000..edd7efd
--- /dev/null
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * dvd.h: thread structure of the DVD plugin
+ *****************************************************************************
+ * Copyright (C) 1999-2001 VideoLAN
+ * $Id: dvd.h,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Author: Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+/* Logical block size for DVD-VIDEO */
+#define DVD_LB_SIZE 2048
+#define LB2OFF(x) ((off_t)(x) * (off_t)(DVD_LB_SIZE))
+#define OFF2LB(x) ((x) >> 11)
+
+/*****************************************************************************
+ * thread_dvd_data_t: extension of input_thread_t for DVD specificity.
+ *****************************************************************************/
+typedef struct thread_dvd_data_s
+{
+    dvdcss_handle           dvdhandle;                   /* libdvdcss handle */
+
+    int                     i_audio_nb;
+    int                     i_spu_nb;
+
+    /* Navigation information */
+    int                     i_title;
+    int                     i_title_id;
+
+    int                     i_chapter_nb;
+    int                     i_chapter;
+    vlc_bool_t              b_new_chapter;
+
+    int                     i_angle_nb;
+    int                     i_angle;
+
+    int                     i_map_cell;   /* cell index in adress map */
+    int                     i_prg_cell;   /* cell index in program map */
+    int                     i_angle_cell; /* cell index in the current angle */
+
+    int                     i_vts_start;  /* offset to beginning of vts */
+    int                     i_vts_lb;     /* sector in vts */
+    int                     i_last_lb;    /* last sector of current cell */
+
+    /* Structure that contains all information of the DVD */
+    struct ifo_s *          p_ifo;
+
+} thread_dvd_data_t;
+
diff --git a/modules/access/dvd/dvdcss.h b/modules/access/dvd/dvdcss.h
new file mode 100644 (file)
index 0000000..3a27482
--- /dev/null
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * dvdcss.h: Dummy libdvdcss header.
+ *****************************************************************************
+ * Copyright (C) 2001 VideoLAN
+ * $Id: dvdcss.h,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * The libdvdcss structure
+ *****************************************************************************/
+typedef struct dvdcss_s* dvdcss_handle;
+
+/*****************************************************************************
+ * Defines and flags
+ *****************************************************************************/
+#define DVDCSS_BLOCK_SIZE      2048
+
+#define DVDCSS_NOFLAGS         0
+#define DVDCSS_READ_DECRYPT    (1 << 0)
+#define DVDCSS_SEEK_MPEG       (1 << 0)
+#define DVDCSS_SEEK_KEY        (1 << 1)
+
+/*****************************************************************************
+ * Exported prototypes
+ *****************************************************************************/
+dvdcss_handle dummy_dvdcss_open  ( char * );
+int           dummy_dvdcss_close ( dvdcss_handle );
+int           dummy_dvdcss_title ( dvdcss_handle, int );
+int           dummy_dvdcss_seek  ( dvdcss_handle, int, int );
+int           dummy_dvdcss_read  ( dvdcss_handle, void *, int, int );
+int           dummy_dvdcss_readv ( dvdcss_handle, void *, int, int );
+char *        dummy_dvdcss_error ( dvdcss_handle );
+
+/*****************************************************************************
+ * Pointers which will be filled either with dummy_dvdcss functions or
+ * with the dlopen()ed ones.
+ *****************************************************************************/
+#define ____dvdcss_open  dvdcss_open
+#define ____dvdcss_close dvdcss_close
+#define ____dvdcss_title dvdcss_title
+#define ____dvdcss_seek  dvdcss_seek
+#define ____dvdcss_read  dvdcss_read
+#define ____dvdcss_readv dvdcss_readv
+#define ____dvdcss_error dvdcss_error
+
+dvdcss_handle (* ____dvdcss_open )   ( char * );
+int           (* ____dvdcss_close )  ( dvdcss_handle );
+int           (* ____dvdcss_title )  ( dvdcss_handle, int );
+int           (* ____dvdcss_seek )   ( dvdcss_handle, int, int );
+int           (* ____dvdcss_read )   ( dvdcss_handle, void *, int, int );
+int           (* ____dvdcss_readv )  ( dvdcss_handle, void *, int, int );
+char *        (* ____dvdcss_error )  ( dvdcss_handle );
+
+
diff --git a/modules/access/dvd/es.c b/modules/access/dvd/es.c
new file mode 100644 (file)
index 0000000..baf7df9
--- /dev/null
@@ -0,0 +1,323 @@
+/* es.c: functions to find and select ES
+ *****************************************************************************
+ * Copyright (C) 1998-2001 VideoLAN
+ * $Id: es.c,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Author: Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include <vlc/input.h>
+
+#ifdef HAVE_UNISTD_H
+#   include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+
+#ifdef STRNCASECMP_IN_STRINGS_H
+#   include <strings.h>
+#endif
+
+#ifdef GOD_DAMN_DMCA
+#   include "dvdcss.h"
+#else
+#   include <dvdcss/dvdcss.h>
+#endif
+
+#include "dvd.h"
+#include "ifo.h"
+#include "summary.h"
+#include "iso_lang.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+
+void DVDLaunchDecoders( input_thread_t * p_input );
+
+#define vmg p_dvd->p_ifo->vmg
+#define vts p_dvd->p_ifo->vts
+
+#define ADDES( stream_id, private_id, fourcc, cat, lang, size )         \
+    i_id = ( (private_id) << 8 ) | (stream_id);                         \
+    p_es = input_AddES( p_input, NULL, i_id, size );                    \
+    p_es->i_stream_id = (stream_id);                                    \
+    p_es->i_fourcc = (fourcc);                                          \
+    p_es->i_cat = (cat);                                                \
+    if( lang )                                                          \
+    {                                                                   \
+        strcpy( p_es->psz_desc, DecodeLanguage( lang ) );               \
+    }
+
+
+/*****************************************************************************
+ * DVDReadVideo: read video ES
+ *****************************************************************************/
+void DVDReadVideo( input_thread_t * p_input )
+{
+    thread_dvd_data_t * p_dvd;
+    es_descriptor_t *   p_es;
+    int                 i_id;
+    int                 i_ratio;
+
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+
+    /* ES 0 -> video MPEG2 */
+    IfoPrintVideo( p_dvd );
+    i_ratio = vts.manager_inf.video_attr.i_ratio;
+    
+    if( i_ratio )
+    {
+        ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
+        *(int*)(p_es->p_demux_data) = i_ratio;
+    }
+    else
+    {
+        ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
+    }
+        
+}
+
+/*****************************************************************************
+ * DVDReadAudio: read audio ES
+ *****************************************************************************/
+#define audio_status \
+    vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_audio_status[i-1]
+    
+void DVDReadAudio( input_thread_t * p_input )
+{
+    thread_dvd_data_t * p_dvd;
+    es_descriptor_t *   p_es;
+    int                 i_lang;
+    int                 i_id;
+    int                 i;
+
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+    p_dvd->i_audio_nb = 0;
+    
+    /* Audio ES, in the order they appear in .ifo */
+    for( i = 1 ; i <= vts.manager_inf.i_audio_nb ; i++ )
+    {
+        IfoPrintAudio( p_dvd, i );
+
+        /* audio channel is active if first byte is 0x80 */
+        if( audio_status.i_available )
+        {
+            p_dvd->i_audio_nb++;
+            i_lang = vts.manager_inf.p_audio_attr[i-1].i_lang_code;
+            i_id = audio_status.i_position;
+
+            switch( vts.manager_inf.p_audio_attr[i-1].i_coding_mode )
+            {
+            case 0x00:              /* A52 */
+                ADDES( 0xbd, 0x80 + audio_status.i_position,
+                       VLC_FOURCC('a','5','2',' '), AUDIO_ES, i_lang, 0 );
+                strcat( p_es->psz_desc, " (A52)" );
+
+                break;
+            case 0x02:
+            case 0x03:              /* MPEG audio */
+                ADDES( 0xc0 + audio_status.i_position, 0,
+                       VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
+                strcat( p_es->psz_desc, " (mpeg)" );
+
+                break;
+            case 0x04:              /* LPCM */
+                ADDES( 0xbd, 0xa0 + audio_status.i_position,
+                       VLC_FOURCC('l','p','c','m'), AUDIO_ES, i_lang, 0 );
+                strcat( p_es->psz_desc, " (lpcm)" );
+
+                break;
+            case 0x06:              /* DTS */
+                i_id = ( ( 0x88 + audio_status.i_position ) << 8 ) | 0xbd;
+                msg_Err( p_input, "DTS audio not handled yet (0x%x)", i_id );
+                break;
+            default:
+                i_id = 0;
+                msg_Err( p_input, "unknown audio type %.2x",
+                         vts.manager_inf.p_audio_attr[i-1].i_coding_mode );
+            }
+        }
+    }
+}
+#undef audio_status
+
+/*****************************************************************************
+ * DVDReadSPU: read subpictures ES
+ *****************************************************************************/
+#define spu_status \
+    vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_spu_status[i-1]
+#define palette \
+    vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_yuv_color
+
+void DVDReadSPU( input_thread_t * p_input )
+{
+    thread_dvd_data_t * p_dvd;
+    es_descriptor_t *   p_es;
+    int                 i_id;
+    int                 i;
+           
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+    p_dvd->i_spu_nb = 0;
+
+    for( i = 1 ; i <= vts.manager_inf.i_spu_nb; i++ )
+    {
+        IfoPrintSpu( p_dvd, i );
+
+        if( spu_status.i_available )
+        {
+            p_dvd->i_spu_nb++;
+
+            /*  there are several streams for one spu */
+            if(  vts.manager_inf.video_attr.i_ratio )
+            {
+                /* 16:9 */
+                switch( vts.manager_inf.video_attr.i_perm_displ )
+                {
+                case 1:
+                    i_id = spu_status.i_position_pan;
+                    break;
+                case 2:
+                    i_id = spu_status.i_position_letter;
+                    break;
+                default:
+                    i_id = spu_status.i_position_wide;
+                    break;
+                }
+            }
+            else
+            {
+                /* 4:3 */
+                i_id = spu_status.i_position_43;
+            }
+
+            if( vmg.title.pi_yuv_color )
+            {
+                ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
+                       vts.manager_inf.p_spu_attr[i-1].i_lang_code,
+                       sizeof(int) + 16*sizeof(u32) );
+                *(int*)p_es->p_demux_data = 0xBeeF;
+                memcpy( (char*)p_es->p_demux_data + sizeof(int),
+                        palette, 16*sizeof(u32) ); 
+            }
+            else
+            {
+                ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
+                   vts.manager_inf.p_spu_attr[i-1].i_lang_code, 0 );
+            }
+        }
+    }
+}
+#undef palette
+#undef spu_status
+
+#undef vts
+#undef vmg
+
+/*****************************************************************************
+ * DVDLaunchDecoders: select ES for video, audio and spu
+ *****************************************************************************/
+void DVDLaunchDecoders( input_thread_t * p_input )
+{
+    thread_dvd_data_t *  p_dvd;
+    int                  i_audio;
+    int                  i_spu;
+
+    p_dvd = (thread_dvd_data_t*)(p_input->p_access_data);
+
+    /* Select Video stream (always 0) */
+    if( config_GetInt( p_input, "video" ) )
+    {
+        input_SelectES( p_input, p_input->stream.pp_es[0] );
+    }
+
+    /* Select audio stream */
+    if( p_dvd->i_audio_nb > 0 && config_GetInt( p_input, "audio" ) )
+    {
+        /* For audio: first one if none or a not existing one specified */
+        i_audio = config_GetInt( p_input, "audio-channel" );
+        if( i_audio <= 0 || i_audio > p_dvd->i_audio_nb )
+        {
+            config_PutInt( p_input, "audio-channel", 1 );
+            i_audio = 1;
+        }
+        
+        if( ( config_GetInt( p_input, "audio-type" )
+               == REQUESTED_A52 ) )
+        {
+            int     i_a52 = i_audio;
+            while( ( p_input->stream.pp_es[i_a52]->i_fourcc !=
+                     VLC_FOURCC('a','5','2',' ') ) && ( i_a52 <=
+                     p_dvd->p_ifo->vts.manager_inf.i_audio_nb ) )
+            {
+                i_a52++;
+            }
+            if( p_input->stream.pp_es[i_a52]->i_fourcc
+                 == VLC_FOURCC('a','5','2',' ') )
+            {
+                input_SelectES( p_input,
+                                p_input->stream.pp_es[i_a52] );
+            }
+        }
+        else
+        {
+            input_SelectES( p_input,
+                            p_input->stream.pp_es[i_audio] );
+        }
+    }
+
+    /* Select subtitle */
+    if( p_dvd->i_spu_nb > 0 && config_GetInt( p_input, "video" ) )
+    {
+        /* for spu, default is none */
+        i_spu = config_GetInt( p_input, "spu-channel" );
+        if( i_spu < 0 || i_spu > p_dvd->i_spu_nb )
+        {
+            config_PutInt( p_input, "spu-channel", 0 );
+            i_spu = 0;
+        }
+        if( i_spu > 0 )
+        {
+            int i = 0, j = 0;
+            for( i = 0; i < p_input->stream.i_es_number; i++ )
+            {
+                if ( p_input->stream.pp_es[i]->i_fourcc
+                      == VLC_FOURCC('s','p','u',' ') )
+                {
+                    j++;
+                    if ( i_spu == j ) break;
+                }
+            }
+            if( i_spu == j )
+            {
+                input_SelectES( p_input, p_input->stream.pp_es[i] );
+            }
+        }
+    }
+}
diff --git a/modules/access/dvd/es.h b/modules/access/dvd/es.h
new file mode 100644 (file)
index 0000000..f908b0a
--- /dev/null
@@ -0,0 +1,27 @@
+/* dvd_es.h: functions to find and select ES
+ *****************************************************************************
+ * Copyright (C) 1998-2001 VideoLAN
+ * $Id: es.h,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Author: Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+void DVDLaunchDecoders  ( input_thread_t * );
+void DVDReadVideo       ( input_thread_t * );
+void DVDReadAudio       ( input_thread_t * );
+void DVDReadSPU         ( input_thread_t * );
+
diff --git a/modules/access/dvd/ifo.c b/modules/access/dvd/ifo.c
new file mode 100644 (file)
index 0000000..9eea56e
--- /dev/null
@@ -0,0 +1,2183 @@
+/*****************************************************************************
+ * ifo.c: Functions for ifo parsing
+ *****************************************************************************
+ * Copyright (C) 1999-2001 VideoLAN
+ * $Id: ifo.c,v 1.1 2002/08/04 17:23:41 sam Exp $
+ *
+ * Authors: Stéphane Borel <stef@via.ecp.fr>
+ *          German Tischler <tanis@gaspode.franken.de>
+ *
+ * based on:
+ *  - libifo by Thomas Mirlacher <dent@cosy.sbg.ac.at>
+ *  - IFO structure documentation by Thomas Mirlacher, Björn Englund,
+ *  Håkan Hjort
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <vlc/vlc.h>
+
+#ifdef HAVE_UNISTD_H
+#   include <unistd.h>
+#elif defined( _MSC_VER ) && defined( _WIN32 )
+#   include <io.h>
+#endif
+
+#include <string.h>
+#include <fcntl.h>
+
+#ifdef GOD_DAMN_DMCA
+#   include "dvdcss.h"
+#else
+#   include <dvdcss/dvdcss.h>
+#endif
+
+#include "dvd.h"
+#include "ifo.h"
+#include "udf.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+void            CommandRead     ( command_desc_t );
+static int      ReadTitle       ( ifo_t * , title_t *, int, int );
+static int      FreeTitle       ( title_t * );
+static int      ReadUnitInf     ( ifo_t * , unit_inf_t *, int, int );
+static int      FreeUnitInf     ( unit_inf_t * );
+static int      ReadTitleUnit   ( ifo_t * , title_unit_t *, int );
+static int      FreeTitleUnit   ( title_unit_t * );
+static int      ReadVobuMap     ( ifo_t * , vobu_map_t *, int );
+static int      FreeVobuMap     ( vobu_map_t * );
+static int      ReadCellInf     ( ifo_t * , cell_inf_t *, int );
+static int      FreeCellInf     ( cell_inf_t * );
+static int      FreeTitleSet    ( vts_t * );
+
+static u8*      FillBuffer      ( ifo_t *, u8 *, int );
+static u8       ReadByte        ( ifo_t *, u8 *, u8 ** );
+static void     ReadBytes       ( ifo_t *, u8 *, u8 **, u8 *, int );
+static void     DumpBytes       ( ifo_t *, u8 *, u8 **, int );
+static u16      ReadWord        ( ifo_t *, u8 *, u8 ** );
+static u32      ReadDouble      ( ifo_t *, u8 *, u8 ** );
+static u64      ReadQuad        ( ifo_t *, u8 *, u8 ** );
+
+/*
+ * IFO Management.
+ */
+
+/*****************************************************************************
+ * IfoCreate : Creates an ifo structure and prepares for parsing directly
+ *             on DVD device
+ *****************************************************************************/
+int IfoCreate( thread_dvd_data_t * p_dvd )
+{
+    p_dvd->p_ifo = malloc( sizeof(ifo_t) );
+    if( p_dvd->p_ifo == NULL )
+    {
+//X        intf_Err( p_input, "unable to allocate memory. aborting" );
+        return -1;
+    }
+
+    /* if we are here the dvd device has already been opened */
+    p_dvd->p_ifo->dvdhandle = p_dvd->dvdhandle;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * IfoInit : Reads information from the management table.
+ *****************************************************************************/
+int IfoInit( ifo_t * p_ifo )
+{
+    u8                  p_buf[DVD_LB_SIZE];
+    u8*                 p_tmp;
+    u64                 i_temp;
+    int                 i, j, k;
+    int                 i_start;
+
+    /* find the start sector of video information on the dvd */
+    p_ifo->i_start = DVDUDFFindFile( p_ifo->dvdhandle, "/VIDEO_TS/VIDEO_TS.IFO" );
+    if( !p_ifo->i_start ) return -1;
+
+    p_tmp = FillBuffer( p_ifo, p_buf, p_ifo->i_start );
+    //i_start = p_ifo->i_pos;
+
+    /*
+     * read the video manager information table
+     */
+#define MGINF     p_ifo->vmg.manager_inf
+    //fprintf( stderr, "VMGI\n" );
+
+    ReadBytes( p_ifo, p_buf, &p_tmp, MGINF.psz_id, 12 );
+    MGINF.psz_id[12] = '\0';
+    MGINF.i_vmg_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 12 );
+    MGINF.i_vmg_inf_end_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 1 );
+    MGINF.i_spec_ver = ReadByte( p_ifo, p_buf, &p_tmp );
+    MGINF.i_cat = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_volume_nb = ReadWord( p_ifo, p_buf, &p_tmp );
+    MGINF.i_volume = ReadWord( p_ifo, p_buf, &p_tmp );
+    MGINF.i_disc_side = ReadByte( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 19 );
+    MGINF.i_title_set_nb = ReadWord( p_ifo, p_buf, &p_tmp );
+    ReadBytes( p_ifo, p_buf, &p_tmp, MGINF.ps_provider_id, 32 );
+    MGINF.i_pos_code = ReadQuad( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 24 );
+    MGINF.i_vmg_inf_end_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_first_play_title_start_byte = ReadDouble( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 56 );
+    MGINF.i_vob_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_title_inf_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_title_unit_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_parental_inf_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_vts_inf_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_text_data_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_cell_inf_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    MGINF.i_vobu_map_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 32 );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 2 );
+    DumpBytes( p_ifo, p_buf, &p_tmp, 1 );
+    MGINF.i_audio_nb = ReadByte( p_ifo, p_buf, &p_tmp );
+    //fprintf( stderr, "vmgi audio nb : %d\n", MGINF.i_audio_nb );
+
+    for( i = 0 ; i < 8 ; i++ )
+    {
+        i_temp = ReadQuad( p_ifo, p_buf, &p_tmp );
+    }
+
+    DumpBytes( p_ifo, p_buf, &p_tmp, 17 );
+    MGINF.i_spu_nb = ReadByte( p_ifo, p_buf, &p_tmp );
+    //fprintf( stderr, "vmgi subpic nb : %d\n", MGINF.i_spu_nb );
+
+    for( i = 0 ; i < MGINF.i_spu_nb ; i++ )
+    {
+        ReadBytes( p_ifo, p_buf, &p_tmp, (u8*)(&i_temp), 6 );
+        /* FIXME : take care of endianness */
+    }
+
+    /*
+     * read first play title.
+     */
+    //fprintf(stderr,"readtitle %i\n", MGINF.i_first_play_title_start_byte & 0x7ff );
+    if( ReadTitle( p_ifo, &p_ifo->vmg.title, p_ifo->i_start
+                           + OFF2LB( MGINF.i_first_play_title_start_byte ),
+                   MGINF.i_first_play_title_start_byte & 0x7ff ) < 0 )
+    {
+        return -1;
+    }
+
+    /*
+     * fills the title information structure.
+     */
+#define TITINF       p_ifo->vmg.title_inf
+    if( MGINF.i_title_inf_start_sector )
+    {
+        p_tmp = FillBuffer( p_ifo, p_buf,
+