Commit 57e189eb authored by Sam Hocevar's avatar Sam Hocevar

Bon, puisque �a semble commiter sous BeOS, je commite.

Voil� le changelog appoximatif :

 . fichier INSTALL plus clair
 . vir� quelques warnings
 . *PATH sont maintenant d�finis dans config.h
 . quelques fautes d'orthographe
 . l'option --enable-ppro n'est pas mise par d�faut car elle ne fonctionne
  pas sur un K6-2
 . nouvelle API des plugins
 . le client framebuffer ne d�truit plus la console quand on quitte
 . r�paration de la YUV 8 bits
 . mise des YUV en plugins
 . transfo YUV 32bits MMX chour�e dans la libmpeg2
parent 3cbfc06d
Tue Jun 20 14:17:56 CEST 2000 [insert date here]
0.1.99d : 0.1.99d :
* fixed RPM build * fixed RPM build
* .deb is now more lintian-friendly * .deb is now more lintian-friendly
* fixed vlc.spec to install nicely
* PLUGIN_PATH and DATA_PATH now in include/*.h
* removed a few useless warning messages
* removed remaining header stuff related to the old non-free decoder
* fixed the MGA build (doesn't work yet, though)
* new plugin API
* updated the INSTALL document
* plugin auto-detection
* fixed a few misspellings in the code
* removed the default --enable-ppro option because it didn't work on K6-2
* the framebuffer client now leaves the console in a working state
* the dithered 8 bpp YUV transformation works again (blame bbp !)
* the YUV transformations are now plugins as well
* alternative symlinks like gvlc, fbvlc are now created at compile time
* borrowed libmpeg2's GPLed MMX YUV transformations (16 and 32 bits)
Sun Jun 18 18:54:48 CEST 2000 Sun Jun 18 18:54:48 CEST 2000
0.1.99c : 0.1.99c :
* fixed Makefile.in for debug version * fixed Makefile.in for debug version
* caught Delete Window event in Gnome and X11 modes * caught Delete Window event in Gnome and X11 modes
* fixed manpage * fixed man page
* GGI output now works * GGI output now works
* fixed a segfault on exit for the Gnome plugin * fixed a segfault on exit for the Gnome plugin
* fixed compile problems for BeOS * fixed compile problems for BeOS
...@@ -24,3 +39,8 @@ Sat Jun 17 03:35:02 CEST 2000 ...@@ -24,3 +39,8 @@ Sat Jun 17 03:35:02 CEST 2000
* new VLAN changing code * new VLAN changing code
* created the ChangeLog file :) * created the ChangeLog file :)
Thu Jun 15 20:48:54 CEST 2000
0.1.99a :
* first public release
...@@ -6,7 +6,7 @@ Building VideoLAN ...@@ -6,7 +6,7 @@ Building VideoLAN
A typical way to configure the vlc is : A typical way to configure the vlc is :
./configure --prefix=/usr --enable-ppro --enable-mmx --enable-gnome ./configure --prefix=/usr --enable-mmx --enable-gnome
See `./configure --help' for more information. See `./configure --help' for more information.
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
################################################################################ ################################################################################
default: default:
@echo "This Makefile should not be called directly - see notes at end of" @echo "This Makefile should not be called directly,"
@echo "main Makefile." @echo "see notes at end of main Makefile."
################################################################################ ################################################################################
# Dependancies creation # Dependancies creation
...@@ -30,6 +30,7 @@ $(dependancies): .dep/%.d: %.c ...@@ -30,6 +30,7 @@ $(dependancies): .dep/%.d: %.c
@test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*) @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
#@echo "generating dependancies for $*.c" #@echo "generating dependancies for $*.c"
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) $< \ @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
.dep\/$(subst /,\/,$*).d : /g'\'' > $@; \ .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@' [ -s $@ ] || rm -f $@'
...@@ -41,8 +41,6 @@ PROGRAM_BUILD = `date` $(USER) ...@@ -41,8 +41,6 @@ PROGRAM_BUILD = `date` $(USER)
# DEFINE will contain some of the constants definitions decided in Makefile, # DEFINE will contain some of the constants definitions decided in Makefile,
# including SYS_xx. It will be passed to C compiler. # including SYS_xx. It will be passed to C compiler.
DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z A-Z) DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z A-Z)
DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
################################################################################ ################################################################################
# Tuning and other variables - do not change anything except if you know # Tuning and other variables - do not change anything except if you know
...@@ -211,6 +209,7 @@ video_decoder_obj = video_decoder/video_decoder.o \ ...@@ -211,6 +209,7 @@ video_decoder_obj = video_decoder/video_decoder.o \
misc_obj = misc/mtime.o \ misc_obj = misc/mtime.o \
misc/rsc_files.o \ misc/rsc_files.o \
misc/netutils.o \ misc/netutils.o \
misc/playlist.o \
misc/plugins.o \ misc/plugins.o \
misc/decoder_fifo.o misc/decoder_fifo.o
...@@ -248,42 +247,68 @@ endif ...@@ -248,42 +247,68 @@ endif
# #
PLUGINS := $(PLUGINS:%=lib/%.so) PLUGINS := $(PLUGINS:%=lib/%.so)
PLUGIN_BEOS = plugins/beos/aout_beos.o \ PLUGIN_BEOS = plugins/beos/beos.o \
plugins/beos/aout_beos.o \
plugins/beos/intf_beos.o \ plugins/beos/intf_beos.o \
plugins/beos/vout_beos.o plugins/beos/vout_beos.o
PLUGIN_DSP = plugins/dsp/aout_dsp.o PLUGIN_DSP = plugins/dsp/dsp.o \
plugins/dsp/aout_dsp.o \
PLUGIN_DUMMY = plugins/dummy/aout_dummy.o \ PLUGIN_DUMMY = plugins/dummy/dummy.o \
plugins/dummy/aout_dummy.o \
plugins/dummy/intf_dummy.o \ plugins/dummy/intf_dummy.o \
plugins/dummy/vout_dummy.o plugins/dummy/vout_dummy.o
PLUGIN_ESD = plugins/esd/aout_esd.o PLUGIN_ESD = plugins/esd/esd.o \
plugins/esd/aout_esd.o
PLUGIN_FB = plugins/fb/intf_fb.o \ PLUGIN_FB = plugins/fb/fb.o \
plugins/fb/intf_fb.o \
plugins/fb/vout_fb.o plugins/fb/vout_fb.o
PLUGIN_GGI = plugins/ggi/intf_ggi.o \ PLUGIN_GGI = plugins/ggi/ggi.o \
plugins/ggi/intf_ggi.o \
plugins/ggi/vout_ggi.o plugins/ggi/vout_ggi.o
PLUGIN_GLIDE = plugins/glide/intf_glide.o \ PLUGIN_GLIDE = plugins/glide/glide.o \
plugins/glide/intf_glide.o \
plugins/glide/vout_glide.o plugins/glide/vout_glide.o
PLUGIN_GNOME = plugins/gnome/intf_gnome.o \ PLUGIN_GNOME = plugins/gnome/gnome.o \
plugins/gnome/intf_gnome.o \
plugins/gnome/intf_gnome_callbacks.o \ plugins/gnome/intf_gnome_callbacks.o \
plugins/gnome/intf_gnome_interface.o \ plugins/gnome/intf_gnome_interface.o \
plugins/gnome/intf_gnome_support.o \ plugins/gnome/intf_gnome_support.o \
plugins/gnome/vout_gnome.o plugins/gnome/vout_gnome.o
PLUGIN_MGA = plugins/mga/intf_mga.o \ PLUGIN_MGA = plugins/mga/mga.o \
plugins/fb/vout_mga.o plugins/mga/intf_mga.o \
plugins/mga/vout_mga.o
PLUGIN_X11 = plugins/x11/intf_x11.o \ PLUGIN_X11 = plugins/x11/x11.o \
plugins/x11/intf_x11.o \
plugins/x11/vout_x11.o plugins/x11/vout_x11.o
PLUGIN_YUV = plugins/yuv/yuv.o \
plugins/yuv/video_yuv.o \
plugins/yuv/video_yuv8.o \
plugins/yuv/video_yuv15.o \
plugins/yuv/video_yuv16.o \
plugins/yuv/video_yuv24.o \
plugins/yuv/video_yuv32.o
PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
plugins/yuvmmx/video_yuv.o \
plugins/yuvmmx/video_yuv8.o \
plugins/yuvmmx/video_yuv15.o \
plugins/yuvmmx/video_yuv16.o \
plugins/yuvmmx/video_yuv24.o \
plugins/yuvmmx/video_yuv32.o
PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \ PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \
$(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \ $(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \
$(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX)
# #
# Other lists of files # Other lists of files
# #
...@@ -303,32 +328,32 @@ export ...@@ -303,32 +328,32 @@ export
# #
# Virtual targets # Virtual targets
# #
all: vlc plugins all: vlc @ALIASES@ plugins
clean: clean:
rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ) rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
rm -f vlc @ALIASES@ lib/*.so
distclean: clean distclean: clean
rm -f src/*/*.o plugins/*/*.o lib/*.so **/*~ *.log rm -f src/*/*.o plugins/*/*.o **/*~ *.log
rm -f Makefile include/defs.h include/config.h rm -f Makefile include/defs.h include/config.h
rm -f config.status config.cache config.log rm -f config.status config.cache config.log
rm -f vlc gmon.out core build-stamp rm -f gmon.out core build-stamp
rm -rf .dep rm -rf .dep
install: install:
$(INSTALL) vlc $(prefix)/bin $(INSTALL) vlc $(prefix)/bin
mkdir -p $(prefix)/lib/videolan/vlc mkdir -p $(prefix)/lib/videolan/vlc
mkdir -p $(prefix)/share/videolan/vlc mkdir -p $(prefix)/share/videolan
$(INSTALL) -m 644 $(PLUGINS) $(prefix)/lib/videolan/vlc $(INSTALL) -m 644 $(PLUGINS) $(prefix)/lib/videolan/vlc
$(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan/vlc $(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
$(INSTALL) -m 644 share/*.png $(prefix)/share/videolan/vlc $(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
show: show:
@echo "Command line for C objects:" @echo CC: $(CC)
@echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>" @echo CCFLAGS: $(CCFLAGS)
@echo @echo DCFLAGS: $(DCFLAGS)
@echo "Command line for assembler objects:" @echo LCFLAGS: $(CCFLAGS)
@echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
# ugliest of all, but I have no time to do it -- sam # ugliest of all, but I have no time to do it -- sam
snapshot: snapshot:
...@@ -359,6 +384,9 @@ else ...@@ -359,6 +384,9 @@ else
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif endif
gvlc xvlc fbvlc ggivlc glidevlc: vlc
rm -f $@ && ln -s vlc $@
plugins: $(PLUGINS) plugins: $(PLUGINS)
# #
...@@ -382,11 +410,9 @@ $(ASM_OBJ): %.o: %.S ...@@ -382,11 +410,9 @@ $(ASM_OBJ): %.o: %.S
#$(PLUGIN_OBJ): %.so: Makefile.dep #$(PLUGIN_OBJ): %.so: Makefile.dep
#$(PLUGIN_OBJ): %.so: .dep/%.d #$(PLUGIN_OBJ): %.so: .dep/%.d
#$(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
lib/beos.so: $(PLUGIN_BEOS) lib/beos.so: $(PLUGIN_BEOS)
ld -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
$(PLUGIN_BEOS): %.o: %.c $(PLUGIN_BEOS): %.o: %.cpp
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/esd.so: $(PLUGIN_ESD) lib/esd.so: $(PLUGIN_ESD)
...@@ -398,6 +424,11 @@ endif ...@@ -398,6 +424,11 @@ endif
$(PLUGIN_ESD): %.o: %.c $(PLUGIN_ESD): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/dsp.so: $(PLUGIN_DSP)
ld -shared -o $@ $^
$(PLUGIN_DSP): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/dummy.so: $(PLUGIN_DUMMY) lib/dummy.so: $(PLUGIN_DUMMY)
ld -shared -o $@ $^ ld -shared -o $@ $^
$(PLUGIN_DUMMY): %.o: %.c $(PLUGIN_DUMMY): %.o: %.c
...@@ -421,7 +452,7 @@ $(PLUGIN_MGA): %.o: %.c ...@@ -421,7 +452,7 @@ $(PLUGIN_MGA): %.o: %.c
lib/gnome.so: $(PLUGIN_GNOME) lib/gnome.so: $(PLUGIN_GNOME)
ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^ ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^
$(PLUGIN_GNOME): %.o: %.c $(PLUGIN_GNOME): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) `gnome-config --cflags gnomeui`-c -o $@ $< $(CC) $(CCFLAGS) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
lib/glide.so: $(PLUGIN_GLIDE) lib/glide.so: $(PLUGIN_GLIDE)
ld -shared -lglide2x -o $@ $^ ld -shared -lglide2x -o $@ $^
...@@ -433,6 +464,16 @@ lib/ggi.so: $(PLUGIN_GGI) ...@@ -433,6 +464,16 @@ lib/ggi.so: $(PLUGIN_GGI)
$(PLUGIN_GGI): %.o: %.c $(PLUGIN_GGI): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/yuv.so: $(PLUGIN_YUV)
ld -shared -o $@ $^
$(PLUGIN_YUV): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ld -shared -o $@ $^
$(PLUGIN_YUVMMX): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
################################################################################ ################################################################################
# Note on generic rules and dependancies # Note on generic rules and dependancies
################################################################################ ################################################################################
......
...@@ -4,7 +4,9 @@ README for vlc, the VideoLAN Client ...@@ -4,7 +4,9 @@ README for vlc, the VideoLAN Client
Introduction Introduction
============ ============
[ nothing appropriate yet ] The vlc is part of the VideoLAN project, a full MPEG2 client/server
solution. The VideoLAN Client can also be used as a standalone program
to play MPEG2 streams from a hard disk or a DVD.
Building, Installing and Running VideoLAN Building, Installing and Running VideoLAN
...@@ -38,7 +40,13 @@ distribution, what plugins you were trying, and so on). ...@@ -38,7 +40,13 @@ distribution, what plugins you were trying, and so on).
Resources Resources
========= =========
[ nothing appropriate yet ] The VideoLAN web site at http://www.videolan.org/ is a good start for
information about MPEG and DVD playing. Have a look at the documentation
section, as well as the bookmarks.
You can also try the OpenDVD site at http://www.opendvd.org/ or the
the LiVid project at http://www.linuxvideo.org/. They have lots of
information, too.
The team The team
......
...@@ -12,9 +12,13 @@ ac_help= ...@@ -12,9 +12,13 @@ ac_help=
ac_default_prefix=/usr/local ac_default_prefix=/usr/local
# Any additions from configure.in: # Any additions from configure.in:
ac_help="$ac_help ac_help="$ac_help
--enable-dsp Linux /dev/dsp support (default enabled)" --enable-ppro Enable PentiumPro optimizations (default is no)"
ac_help="$ac_help
--enable-mmx Enable MMX optimizations (default is no)"
ac_help="$ac_help ac_help="$ac_help
--enable-dummy dummy audio and video support (default enabled)" --enable-dummy dummy audio and video support (default enabled)"
ac_help="$ac_help
--enable-dsp Linux /dev/dsp support (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-esd Esound library support (default disabled)" --enable-esd Esound library support (default disabled)"
ac_help="$ac_help ac_help="$ac_help
...@@ -27,10 +31,6 @@ ac_help="$ac_help ...@@ -27,10 +31,6 @@ ac_help="$ac_help
--enable-gnome Gnome support (default disabled)" --enable-gnome Gnome support (default disabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-x11 X11 support (default enabled)" --enable-x11 X11 support (default enabled)"
ac_help="$ac_help
--enable-ppro Enable PentiumPro optimizations (default is no)"
ac_help="$ac_help
--enable-mmx Enable MMX optimizations (default is no)"
# Initialize some variables set by options. # Initialize some variables set by options.
# The variables have the same names as the options, with # The variables have the same names as the options, with
...@@ -3041,13 +3041,30 @@ EOF ...@@ -3041,13 +3041,30 @@ EOF
fi fi
# Check whether --enable-dsp or --disable-dsp was given. PLUGINS=${PLUGINS}"yuv ";
if test "${enable_dsp+set}" = set; then
enableval="$enable_dsp" ARCH=${host_cpu}
: # Check whether --enable-ppro or --disable-ppro was given.
if test "${enable_ppro+set}" = set; then
enableval="$enable_ppro"
if test x$enableval = xyes; then ARCH=${ARCH}" pentiumpro"; fi
fi fi
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi # Check whether --enable-mmx or --disable-mmx was given.
if test "${enable_mmx+set}" = set; then
enableval="$enable_mmx"
if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi
fi
SYS=${host_os}
# special cases
if test x$host_os = xbeos; then
PLUGINS=${PLUGINS}"dummy beos "
else
# Check whether --enable-dummy or --disable-dummy was given. # Check whether --enable-dummy or --disable-dummy was given.
if test "${enable_dummy+set}" = set; then if test "${enable_dummy+set}" = set; then
enableval="$enable_dummy" enableval="$enable_dummy"
...@@ -3055,6 +3072,13 @@ if test "${enable_dummy+set}" = set; then ...@@ -3055,6 +3072,13 @@ if test "${enable_dummy+set}" = set; then
fi fi
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
# Check whether --enable-dsp or --disable-dsp was given.
if test "${enable_dsp+set}" = set; then
enableval="$enable_dsp"
:
fi
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
# Check whether --enable-esd or --disable-esd was given. # Check whether --enable-esd or --disable-esd was given.
if test "${enable_esd+set}" = set; then if test "${enable_esd+set}" = set; then
enableval="$enable_esd" enableval="$enable_esd"
...@@ -3064,25 +3088,25 @@ fi ...@@ -3064,25 +3088,25 @@ fi
# Check whether --enable-fb or --disable-fb was given. # Check whether --enable-fb or --disable-fb was given.
if test "${enable_fb+set}" = set; then if test "${enable_fb+set}" = set; then
enableval="$enable_fb" enableval="$enable_fb"
if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi
fi fi
# Check whether --enable-ggi or --disable-ggi was given. # Check whether --enable-ggi or --disable-ggi was given.
if test "${enable_ggi+set}" = set; then if test "${enable_ggi+set}" = set; then
enableval="$enable_ggi" enableval="$enable_ggi"
if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; ALIASES=${ALIASES}"ggivlc "; fi
fi fi
# Check whether --enable-glide or --disable-glide was given. # Check whether --enable-glide or --disable-glide was given.
if test "${enable_glide+set}" = set; then if test "${enable_glide+set}" = set; then
enableval="$enable_glide" enableval="$enable_glide"
if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; ALIASES=${ALIASES}"glidevlc "; fi
fi fi
# Check whether --enable-gnome or --disable-gnome was given. # Check whether --enable-gnome or --disable-gnome was given.
if test "${enable_gnome+set}" = set; then if test "${enable_gnome+set}" = set; then
enableval="$enable_gnome" enableval="$enable_gnome"
if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; fi if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi
fi fi
# Check whether --enable-x11 or --disable-x11 was given. # Check whether --enable-x11 or --disable-x11 was given.
...@@ -3091,29 +3115,11 @@ if test "${enable_x11+set}" = set; then ...@@ -3091,29 +3115,11 @@ if test "${enable_x11+set}" = set; then
: :
fi fi
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; ALIASES=${ALIASES}"xvlc "; fi
ARCH=${host_cpu}
# Check whether --enable-ppro or --disable-ppro was given.
if test "${enable_ppro+set}" = set; then
enableval="$enable_ppro"
if test x$enableval = xyes; then ARCH=${ARCH}" pentiumpro"; fi
fi
# Check whether --enable-mmx or --disable-mmx was given.
if test "${enable_mmx+set}" = set; then
enableval="$enable_mmx"
if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; fi
fi fi
SYS=${host_os}
# special cases
if test x$host_os = xbeos; then
PLUGINS="dummy beos"
fi
...@@ -3268,6 +3274,7 @@ s%@LIBOBJS@%$LIBOBJS%g ...@@ -3268,6 +3274,7 @@ s%@LIBOBJS@%$LIBOBJS%g
s%@SYS@%$SYS%g s%@SYS@%$SYS%g
s%@ARCH@%$ARCH%g s%@ARCH@%$ARCH%g
s%@PLUGINS@%$PLUGINS%g s%@PLUGINS@%$PLUGINS%g
s%@ALIASES@%$ALIASES%g
CEOF CEOF
EOF EOF
...@@ -3495,4 +3502,5 @@ vlc version : ${VLC_VERSION} ...@@ -3495,4 +3502,5 @@ vlc version : ${VLC_VERSION}
system : ${SYS} system : ${SYS}
architecture : ${ARCH} architecture : ${ARCH}
plugins : ${PLUGINS} plugins : ${PLUGINS}
vlc aliases : ${ALIASES}
" "
...@@ -58,49 +58,57 @@ AC_C_CONST ...@@ -58,49 +58,57 @@ AC_C_CONST
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_HEADER_TIME AC_HEADER_TIME
AC_ARG_ENABLE(dsp, dnl default plugins
[ --enable-dsp Linux /dev/dsp support (default enabled)]) PLUGINS=${PLUGINS}"yuv ";
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
ARCH=${host_cpu}
AC_ARG_ENABLE(ppro,
[ --enable-ppro Enable PentiumPro optimizations (default is no)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" pentiumpro"; fi ])
AC_ARG_ENABLE(mmx,
[ --enable-mmx Enable MMX optimizations (default is no)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ])
SYS=${host_os}
# special cases
if test x$host_os = xbeos; then
PLUGINS=${PLUGINS}"dummy beos "
dnl default case
else
AC_ARG_ENABLE(dummy, AC_ARG_ENABLE(dummy,
[ --enable-dummy dummy audio and video support (default enabled)]) [ --enable-dummy dummy audio and video support (default enabled)])
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(dsp,
[ --enable-dsp Linux /dev/dsp support (default enabled)])
if test x$enable_dsp != xno; then PLUGINS=${PLUGINS}"dsp "; fi
AC_ARG_ENABLE(esd, AC_ARG_ENABLE(esd,
[ --enable-esd Esound library support (default disabled)], [ --enable-esd Esound library support (default disabled)],
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"esd "; fi]) [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"esd "; fi])
AC_ARG_ENABLE(fb, AC_ARG_ENABLE(fb,
[ --enable-fb Linux framebuffer support (default disabled)], [ --enable-fb Linux framebuffer support (default disabled)],
[if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; fi]) [if test x$enable_fb = xyes; then PLUGINS=${PLUGINS}"fb "; ALIASES=${ALIASES}"fbvlc "; fi])
AC_ARG_ENABLE(ggi, AC_ARG_ENABLE(ggi,
[ --enable-ggi GGI support (default disabled)], [ --enable-ggi GGI support (default disabled)],
[if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; fi]) [if test x$enable_ggi = xyes; then PLUGINS=${PLUGINS}"ggi "; ALIASES=${ALIASES}"ggivlc "; fi])
AC_ARG_ENABLE(glide, AC_ARG_ENABLE(glide,
[ --enable-glide Glide (3dfx) support (default disabled)], [ --enable-glide Glide (3dfx) support (default disabled)],
[if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; fi]) [if test x$enable_glide = xyes; then PLUGINS=${PLUGINS}"glide "; ALIASES=${ALIASES}"glidevlc "; fi])
AC_ARG_ENABLE(gnome, AC_ARG_ENABLE(gnome,
[ --enable-gnome Gnome support (default disabled)], [ --enable-gnome Gnome support (default disabled)],
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; fi]) [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
AC_ARG_ENABLE(x11, AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (default enabled)]) [ --enable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; ALIASES=${ALIASES}"xvlc "; fi
ARCH=${host_cpu}
AC_ARG_ENABLE(ppro,
[ --enable-ppro Enable PentiumPro optimizations (default is no)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" pentiumpro"; fi ])
AC_ARG_ENABLE(mmx,
[ --enable-mmx Enable MMX optimizations (default is no)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; fi ])
SYS=${host_os}
# special cases
if test x$host_os = xbeos; then
PLUGINS="dummy beos"
fi fi
AC_SUBST(SYS) AC_SUBST(SYS)
AC_SUBST(ARCH) AC_SUBST(ARCH)
AC_SUBST(PLUGINS) AC_SUBST(PLUGINS)
AC_SUBST(ALIASES)
AC_OUTPUT([Makefile include/config.h]) AC_OUTPUT([Makefile include/config.h])
...@@ -111,4 +119,5 @@ vlc version : ${VLC_VERSION} ...@@ -111,4 +119,5 @@ vlc version : ${VLC_VERSION}
system : ${SYS} system : ${SYS}
architecture : ${ARCH} architecture : ${ARCH}
plugins : ${PLUGINS} plugins : ${PLUGINS}
vlc aliases : ${ALIASES}
" "
...@@ -2,7 +2,7 @@ vlc (0.1.99d) unstable; urgency=low ...@@ -2,7 +2,7 @@ vlc (0.1.99d) unstable; urgency=low
* .deb is now more lintian-friendly * .deb is now more lintian-friendly
-- Samuel Hocevar <sam@via.ecp.fr> Tue, 20 Jun 2000 14:17:33 +0200 -- Samuel Hocevar <sam@via.ecp.fr> [Insert date here]
vlc (0.1.99c) unstable; urgency=low vlc (0.1.99c) unstable; urgency=low
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* *
* Authors: * Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* *
* Authors: * Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* *
* Authors: * Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* *
* Authors: * Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* *
* Authors: * Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
...@@ -191,7 +192,6 @@ typedef struct aout_thread_s ...@@ -191,7 +192,6 @@ typedef struct aout_thread_s
aout_fifo_t fifo[ AOUT_MAX_FIFOS ]; aout_fifo_t fifo[ AOUT_MAX_FIFOS ];
/* Plugins */ /* Plugins */
plugin_id_t aout_plugin; /* video output plugin */
aout_sys_open_t * p_sys_open; aout_sys_open_t * p_sys_open;
aout_sys_reset_t * p_sys_reset; aout_sys_reset_t * p_sys_reset;
aout_sys_setformat_t * p_sys_setformat; aout_sys_setformat_t * p_sys_setformat;
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
extern "C" { extern "C" {
#endif #endif
void beos_Init( void ); void beos_Create( void );
void beos_Clean( void ); void beos_Destroy( void );
char * beos_GetProgramPath( void ); char * beos_GetProgramPath( void );
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -47,6 +47,18 @@ typedef unsigned long count_t; ...@@ -47,6 +47,18 @@ typedef unsigned long count_t;
* Classes declaration * Classes declaration
*****************************************************************************/ *****************************************************************************/
/* Plugins */
struct plugin_bank_s;
struct plugin_info_s;
typedef struct plugin_bank_s * p_plugin_bank_t;
typedef struct plugin_info_s * p_plugin_info_t;
/* Playlist */
struct playlist_s;
typedef struct playlist_s * p_playlist_t;
/* Interface */ /* Interface */
struct intf_thread_s; struct intf_thread_s;
struct intf_sys_s; struct intf_sys_s;
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
* - Symbols should begin with a prefix indicating in which module they are * - Symbols should begin with a prefix indicating in which module they are
* used, such as INTF_, VOUT_ or ADEC_. * used, such as INTF_, VOUT_ or ADEC_.
* *
* - Regarding environment variables, which are used as initialization parameters * - Regarding environment variables, which are used as initialization
* for threads : * parameters for threads :
* + variable names should end with '_VAR' * + variable names should end with '_VAR'
* + environment variable default value should end with '_DEFAULT' * + environment variable default value should end with '_DEFAULT'
* + values having a special meaning with '_VAL' * + values having a special meaning with '_VAL'
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/* Program version and copyright message */ /* Program version and copyright message */
#define VERSION_MESSAGE "vlc @VLC_VERSION@ @VLC_CODENAME@ " \ #define VERSION_MESSAGE "vlc @VLC_VERSION@ @VLC_CODENAME@ " \
/* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \ /* "(" PROGRAM_BUILD ") (" PROGRAM_OPTIONS ")\n" */ \
"Copyright 1996-2000 VideoLAN\n" "Copyright 1996-2000 VideoLAN\n"
#define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \ #define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \
" @VLC_CODENAME@ - (c)1996-2000 VideoLAN" " @VLC_CODENAME@ - (c)1996-2000 VideoLAN"
...@@ -113,6 +113,14 @@ ...@@ -113,6 +113,14 @@
/* Size of the FIFO. FIFO_SIZE+1 must be a power of 2 */ /* Size of the FIFO. FIFO_SIZE+1 must be a power of 2 */
#define FIFO_SIZE 1023 #define FIFO_SIZE 1023
/*
* Paths
*/
#define DATA_PATH "@prefix@/share/videolan"
#define PLUGIN_PATH "@prefix@/lib/videolan/vlc"
#define MAX_PLUGIN_COUNT 32
/***************************************************************************** /*****************************************************************************
* Interface configuration * Interface configuration
...@@ -271,11 +279,11 @@ ...@@ -271,11 +279,11 @@
#define VOUT_DISPLAY_VAR "vlc_display" #define VOUT_DISPLAY_VAR "vlc_display"
/* Default dimensions for display window - these dimensions are enough for the /* Default dimensions for display window - these dimensions are enough for the
* standard width and height broadcasted MPEG-2 streams */ * standard width and height broadcasted MPEG-2 streams or DVDs */
#define VOUT_WIDTH_VAR "vlc_width" #define VOUT_WIDTH_VAR "vlc_width"
#define VOUT_HEIGHT_VAR "vlc_height" #define VOUT_HEIGHT_VAR "vlc_height"
#define VOUT_WIDTH_DEFAULT 720 #define VOUT_WIDTH_DEFAULT 360
#define VOUT_HEIGHT_DEFAULT 576 #define VOUT_HEIGHT_DEFAULT 288
/* Maximum width of a scaled source picture - this should be relatively high, /* Maximum width of a scaled source picture - this should be relatively high,
* since higher stream values will result in no display at all. */ * since higher stream values will result in no display at all. */
...@@ -349,7 +357,7 @@ ...@@ -349,7 +357,7 @@
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember /* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */ * that raising this level dramatically lengthens the compilation time. */
#define VPAR_OPTIM_LEVEL 1 #define VPAR_OPTIM_LEVEL 2
/* The following directives only apply if you define VDEC_SMP below. */ /* The following directives only apply if you define VDEC_SMP below. */
......
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
*****************************************************************************/ *****************************************************************************/
/* FIXME: move to inline functions ??*/ /* FIXME: move to inline functions ??*/
#define DECODER_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end ) #define DECODER_FIFO_ISEMPTY( fifo ) ( (fifo).i_start == (fifo).i_end )
#define DECODER_FIFO_ISFULL( fifo ) ( ( ( (fifo).i_end + 1 - (fifo).i_start ) \ #define DECODER_FIFO_ISFULL( fifo ) ( ( ((fifo).i_end + 1 - (fifo).i_start)\
& FIFO_SIZE ) == 0 ) & FIFO_SIZE ) == 0 )
#define DECODER_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] ) #define DECODER_FIFO_START( fifo ) ( (fifo).buffer[ (fifo).i_start ] )
#define DECODER_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1)\ #define DECODER_FIFO_INCSTART( fifo ) ( (fifo).i_start = ((fifo).i_start + 1)\
& FIFO_SIZE )
#define DECODER_FIFO_END( fifo ) ( (fifo).buffer[ (fifo).i_end ] )
#define DECODER_FIFO_INCEND( fifo ) ( (fifo).i_end = ((fifo).i_end + 1) \
& FIFO_SIZE ) & FIFO_SIZE )
#define DECODER_FIFO_END( fifo ) ( (fifo).buffer[ (fifo).i_end ] )
#define DECODER_FIFO_INCEND( fifo ) ( (fifo).i_end = ((fifo).i_end + 1) \
& FIFO_SIZE )
/***************************************************************************** /*****************************************************************************
* decoder_fifo_t * decoder_fifo_t
...@@ -239,5 +239,6 @@ static __inline__ u32 GetBits32( bit_stream_t * p_bit_stream ) ...@@ -239,5 +239,6 @@ static __inline__ u32 GetBits32( bit_stream_t * p_bit_stream )
*****************************************************************************/ *****************************************************************************/
static __inline__ void RealignBits( bit_stream_t * p_bit_stream ) static __inline__ void RealignBits( bit_stream_t * p_bit_stream )
{ {
DumpBits( p_bit_stream, p_bit_stream->fifo.i_available & 7 ); DumpBits( p_bit_stream, p_bit_stream->fifo.i_available & 0x7 );
} }
...@@ -57,16 +57,12 @@ typedef struct intf_thread_s ...@@ -57,16 +57,12 @@ typedef struct intf_thread_s
p_intf_sys_t p_sys; /* system interface */ p_intf_sys_t p_sys; /* system interface */
/* Plugin */ /* Plugin */
plugin_id_t intf_plugin; /* interface plugin */
intf_sys_create_t * p_sys_create; /* create interface thread */ intf_sys_create_t * p_sys_create; /* create interface thread */
intf_sys_manage_t * p_sys_manage; /* main loop */ intf_sys_manage_t * p_sys_manage; /* main loop */
intf_sys_destroy_t * p_sys_destroy; /* destroy interface */ intf_sys_destroy_t * p_sys_destroy; /* destroy interface */
/* XXX: Channels array - new API */ /* XXX: Channels array - new API */
//p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */ //p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
/* file list - quick hack */
char **p_playlist;
int i_list_index;
/* Channels array - NULL if not used */ /* Channels array - NULL if not used */
p_intf_channel_t p_channel; /* description of channels */ p_intf_channel_t p_channel; /* description of channels */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
* it when you can access the members you need in an other way. In fact, it * it when you can access the members you need in an other way. In fact, it
* should only be used by interface thread. * should only be used by interface thread.
*****************************************************************************/ *****************************************************************************/
typedef struct typedef struct
{ {
/* Global properties */ /* Global properties */
...@@ -49,6 +50,8 @@ typedef struct ...@@ -49,6 +50,8 @@ typedef struct
/* Shared data - these structures are accessed directly from p_main by /* Shared data - these structures are accessed directly from p_main by
* several modules */ * several modules */
p_plugin_bank_t p_bank; /* plugin bank */
p_playlist_t p_playlist; /* plugin bank */
p_intf_msg_t p_msg; /* messages interface data */ p_intf_msg_t p_msg; /* messages interface data */
p_input_vlan_t p_vlan; /* vlan library data */ p_input_vlan_t p_vlan; /* vlan library data */
} main_t; } main_t;
...@@ -63,3 +66,4 @@ int main_GetIntVariable( char *psz_name, int i_default ); ...@@ -63,3 +66,4 @@ int main_GetIntVariable( char *psz_name, int i_default );
char * main_GetPszVariable( char *psz_name, char *psz_default ); char * main_GetPszVariable( char *psz_name, char *psz_default );
void main_PutIntVariable( char *psz_name, int i_value ); void main_PutIntVariable( char *psz_name, int i_value );
void main_PutPszVariable( char *psz_name, char *psz_value ); void main_PutPszVariable( char *psz_name, char *psz_value );
/*****************************************************************************
* playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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.
*****************************************************************************/
typedef struct playlist_s
{
int i_index;
char** p_list;
} playlist_t;
playlist_t * playlist_Create ( void );
void playlist_Init ( playlist_t * p_playlist, int i_optind );
void playlist_Destroy ( playlist_t * p_playlist );
...@@ -22,11 +22,36 @@ ...@@ -22,11 +22,36 @@
#ifdef SYS_BEOS #ifdef SYS_BEOS
typedef int plugin_id_t; typedef int plugin_id_t;
#define GET_PLUGIN( p_func, plugin_id, psz_name ) \
get_image_symbol( plugin_id, psz_name, B_SYMBOL_TYPE_TEXT, &p_func );
#else #else
typedef void* plugin_id_t; typedef void *plugin_id_t;
#define GET_PLUGIN( p_func, plugin_id, psz_name ) \
p_func = dlsym( plugin_id, psz_name );
#endif #endif
int RequestPlugin ( plugin_id_t * p_plugin, char * psz_name ); typedef struct plugin_info_s
void TrashPlugin ( plugin_id_t p_plugin ); {
void * GetPluginFunction ( plugin_id_t plugin, char *name ); plugin_id_t plugin_id;
char * psz_filename;
char * psz_name;
char * psz_version;
char * psz_author;
void * aout_GetPlugin;
void * vout_GetPlugin;
void * intf_GetPlugin;
void * yuv_GetPlugin;
} plugin_info_t;
typedef struct plugin_bank_s
{
int i_plugin_count;
plugin_info_t * p_info[ MAX_PLUGIN_COUNT ];
} plugin_bank_t;
plugin_bank_t * bank_Create ( void );
void bank_Init ( plugin_bank_t * p_bank );
void bank_Destroy ( plugin_bank_t * p_bank );
/*****************************************************************************
* plugins_export.h : exporting plugins structure
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Prototypes
*****************************************************************************/
/* audio output */
int aout_SysOpen ( aout_thread_t *p_aout );
int aout_SysReset ( aout_thread_t *p_aout );
int aout_SysSetFormat ( aout_thread_t *p_aout );
int aout_SysSetChannels ( aout_thread_t *p_aout );
int aout_SysSetRate ( aout_thread_t *p_aout );
long aout_SysGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_SysPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_SysClose ( aout_thread_t *p_aout );
/* video output */
int vout_SysCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_SysInit ( p_vout_thread_t p_vout );
void vout_SysEnd ( p_vout_thread_t p_vout );
void vout_SysDestroy ( p_vout_thread_t p_vout );
int vout_SysManage ( p_vout_thread_t p_vout );
void vout_SysDisplay ( p_vout_thread_t p_vout );
void vout_SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* interface */
int intf_SysCreate ( p_intf_thread_t p_intf );
void intf_SysDestroy ( p_intf_thread_t p_intf );
void intf_SysManage ( p_intf_thread_t p_intf );
/* YUV transformations */
int yuv_SysInit ( p_vout_thread_t p_vout );
int yuv_SysReset ( p_vout_thread_t p_vout );
void yuv_SysEnd ( p_vout_thread_t p_vout );
...@@ -50,6 +50,18 @@ typedef struct spudec_thread_s ...@@ -50,6 +50,18 @@ typedef struct spudec_thread_s
} spudec_thread_t; } spudec_thread_t;
/*****************************************************************************
* SPU commands
*****************************************************************************/
#define SPU_CMD_FORCE_DISPLAY 0x00
#define SPU_CMD_START_DISPLAY 0x01
#define SPU_CMD_STOP_DISPLAY 0x02
#define SPU_CMD_SET_PALETTE 0x03
#define SPU_CMD_SET_ALPHACHANNEL 0x04
#define SPU_CMD_SET_COORDINATES 0x05
#define SPU_CMD_SET_OFFSETS 0x06
#define SPU_CMD_END 0xff
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
......
...@@ -50,17 +50,6 @@ typedef struct vdec_thread_s ...@@ -50,17 +50,6 @@ typedef struct vdec_thread_s
/* XXX?? */ /* XXX?? */
// int *pi_status; // int *pi_status;
#ifdef OLD_DECODER
/* Input properties */
decoder_fifo_t fifo; /* PES input fifo */
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
/* Output properties */
vout_thread_t * p_vout; /* video output thread */
int i_stream; /* video stream id */
#else
/* idct iformations */ /* idct iformations */
dctelem_t p_pre_idct[64*64]; dctelem_t p_pre_idct[64*64];
...@@ -72,18 +61,11 @@ typedef struct vdec_thread_s ...@@ -72,18 +61,11 @@ typedef struct vdec_thread_s
u8 pi_crop_buf[VDEC_CROPRANGE]; u8 pi_crop_buf[VDEC_CROPRANGE];
u8 * pi_crop; u8 * pi_crop;
//#endif //#endif
#endif
#ifdef STATS #ifdef STATS
/* Statistics */ /* Statistics */
count_t c_loops; /* number of loops */ count_t c_loops; /* number of loops */
count_t c_idle_loops; /* number of idle loops */ count_t c_idle_loops; /* number of idle loops */
#ifdef OLD_DECODER
count_t c_pictures; /* number of pictures read */
count_t c_i_pictures; /* number of I pictures read */
count_t c_p_pictures; /* number of P pictures read */
count_t c_b_pictures; /* number of B pictures read */
#endif
count_t c_decoded_pictures; /* number of pictures decoded */ count_t c_decoded_pictures; /* number of pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */ count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */ count_t c_decoded_p_pictures; /* number of P pictures decoded */
...@@ -94,21 +76,17 @@ typedef struct vdec_thread_s ...@@ -94,21 +76,17 @@ typedef struct vdec_thread_s
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
#ifndef OLD_DECODER
struct vpar_thread_s; struct vpar_thread_s;
struct macroblock_s; struct macroblock_s;
#endif
/* Thread management functions */ /* Thread management functions */
#ifdef OLD_DECODER
p_vdec_thread_t vdec_CreateThread ( /* video_cfg_t *p_cfg, */ input_thread_t *p_input /*,
vout_thread_t *p_vout, int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*, int *pi_status */ );
#else
#ifndef VDEC_SMP #ifndef VDEC_SMP
int vdec_InitThread ( struct vdec_thread_s *p_vdec ); int vdec_InitThread ( struct vdec_thread_s *p_vdec );
void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec, struct macroblock_s *p_mb ); void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec,
#endif struct macroblock_s *p_mb );
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*, int *pi_status */ );
#endif #endif
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*,
int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*,
int *pi_status */ );
...@@ -109,9 +109,14 @@ typedef void (vout_sys_end_t) ( p_vout_thread_t p_vout ); ...@@ -109,9 +109,14 @@ typedef void (vout_sys_end_t) ( p_vout_thread_t p_vout );
typedef void (vout_sys_destroy_t) ( p_vout_thread_t p_vout ); typedef void (vout_sys_destroy_t) ( p_vout_thread_t p_vout );
typedef int (vout_sys_manage_t) ( p_vout_thread_t p_vout ); typedef int (vout_sys_manage_t) ( p_vout_thread_t p_vout );
typedef void (vout_sys_display_t) ( p_vout_thread_t p_vout ); typedef void (vout_sys_display_t) ( p_vout_thread_t p_vout );
typedef void (vout_set_palette_t) ( p_vout_thread_t p_vout, u16 *red, typedef void (vout_set_palette_t) ( p_vout_thread_t p_vout, u16 *red,
u16 *green, u16 *blue, u16 *transp ); u16 *green, u16 *blue, u16 *transp );
typedef int (yuv_sys_init_t) ( p_vout_thread_t p_vout );
typedef int (yuv_sys_reset_t) ( p_vout_thread_t p_vout );
typedef void (yuv_sys_end_t) ( p_vout_thread_t p_vout );
typedef struct vout_thread_s typedef struct vout_thread_s
{ {
/* Thread properties and lock */ /* Thread properties and lock */
...@@ -152,14 +157,18 @@ typedef struct vout_thread_s ...@@ -152,14 +157,18 @@ typedef struct vout_thread_s
u32 i_blue_pixel; /* blue */ u32 i_blue_pixel; /* blue */
/* Plugins */ /* Plugins */
plugin_id_t vout_plugin; /* video output plugin */
vout_sys_create_t * p_sys_create; /* allocate output method */ vout_sys_create_t * p_sys_create; /* allocate output method */
vout_sys_init_t * p_sys_init; /* initialize output method */ vout_sys_init_t * p_sys_init; /* initialize output method */
vout_sys_end_t * p_sys_end; /* terminate output method */ vout_sys_end_t * p_sys_end; /* terminate output method */
vout_sys_destroy_t * p_sys_destroy; /* destroy output method */ vout_sys_destroy_t * p_sys_destroy; /* destroy output method */
vout_sys_manage_t * p_sys_manage; /* handle events */ vout_sys_manage_t * p_sys_manage; /* handle events */
vout_sys_display_t * p_sys_display; /* display rendered image */ vout_sys_display_t * p_sys_display; /* display rendered image */
vout_set_palette_t * p_set_palette; /* sets 8bpp palette */
vout_set_palette_t * p_set_palette; /* set 8bpp palette */
yuv_sys_init_t * p_yuv_init; /* initialize YUV tables */
yuv_sys_reset_t * p_yuv_reset; /* reset YUV tables */
yuv_sys_end_t * p_yuv_end; /* free YUV tables */
/* Pictures and rendering properties */ /* Pictures and rendering properties */
boolean_t b_grayscale; /* color or grayscale display */ boolean_t b_grayscale; /* color or grayscale display */
......
...@@ -33,71 +33,49 @@ ...@@ -33,71 +33,49 @@
* "video_fifo.h" * "video_fifo.h"
*****************************************************************************/ *****************************************************************************/
#define POLUX_SYNCHRO #define SAM_SYNCHRO
//#define POLUX_SYNCHRO
//#define MEUUH_SYNCHRO
/***************************************************************************** /*****************************************************************************
* video_synchro_t and video_synchro_tab_s : timers for the video synchro * video_synchro_t and video_synchro_tab_s : timers for the video synchro
*****************************************************************************/ *****************************************************************************/
#ifdef SAM_SYNCHRO #ifdef SAM_SYNCHRO
typedef struct video_synchro_tab_s
{
double mean;
double deviation;
} video_synchro_tab_t;
typedef struct video_synchro_fifo_s
{
/* type of image to be decoded, and decoding date */
int i_image_type;
mtime_t i_decode_date;
mtime_t i_pts;
} video_synchro_fifo_t;
typedef struct video_synchro_s typedef struct video_synchro_s
{ {
/* fifo containing decoding dates */ /* fifo containing decoding dates */
video_synchro_fifo_t fifo[16]; mtime_t i_date_fifo[16];
unsigned int i_fifo_start; unsigned int i_start;
unsigned int i_fifo_stop; unsigned int i_stop;
/* mean decoding time */ /* mean decoding time */
mtime_t i_mean_decode_time; mtime_t i_delay;
/* dates */ mtime_t i_theorical_delay;
mtime_t i_last_display_pts; /* pts of the last displayed image */
mtime_t i_last_decode_pts; /* pts of the last decoded image */
mtime_t i_last_i_pts; /* pts of the last I image */
mtime_t i_last_nondropped_i_pts; /* pts of last non-dropped I image */
unsigned int i_images_since_pts;
/* il manquait un compteur */ /* dates */
unsigned int modulo; mtime_t i_last_pts; /* pts of the last displayed image */
mtime_t i_last_seen_I_pts; /* date of the last I we decoded */
mtime_t i_last_kept_I_pts; /* pts of last non-dropped I image */
/* P images since the last I */ /* P images since the last I */
unsigned int current_p_count; unsigned int i_P_seen;
unsigned int nondropped_p_count; unsigned int i_P_kept;
double p_count_predict;
/* B images since the last I */ /* B images since the last I */
unsigned int current_b_count; unsigned int i_B_seen;
unsigned int nondropped_b_count; unsigned int i_B_kept;
double b_count_predict;
/* can we display pictures ? */ /* can we display pictures ? */
unsigned int can_display_i; boolean_t b_all_I;
unsigned int can_display_p; boolean_t b_all_P;
double displayable_p; double displayable_p;
unsigned int can_display_b; boolean_t b_all_B;
double displayable_b; double displayable_b;
/* 1 for linear count, 2 for binary count, 3 for ternary count */ } video_synchro_t;
video_synchro_tab_t tab_p[6];
video_synchro_tab_t tab_b[6];
double theorical_fps; #define FIFO_INCREMENT( i_counter ) \
double actual_fps; p_vpar->synchro.i_counter = (p_vpar->synchro.i_counter + 1) & 0xf;
} video_synchro_t;
#endif #endif
#ifdef MEUUH_SYNCHRO #ifdef MEUUH_SYNCHRO
...@@ -140,15 +118,15 @@ typedef struct video_synchro_s ...@@ -140,15 +118,15 @@ typedef struct video_synchro_s
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
boolean_t vpar_SynchroChoose( struct vpar_thread_s * p_vpar, int i_coding_type, boolean_t vpar_SynchroChoose ( struct vpar_thread_s * p_vpar,
int i_structure ); int i_coding_type, int i_structure );
void vpar_SynchroTrash( struct vpar_thread_s * p_vpar, int i_coding_type, void vpar_SynchroTrash ( struct vpar_thread_s * p_vpar,
int i_structure ); int i_coding_type, int i_structure );
void vpar_SynchroDecode( struct vpar_thread_s * p_vpar, int i_coding_type, void vpar_SynchroDecode ( struct vpar_thread_s * p_vpar,
int i_structure ); int i_coding_type, int i_structure );
void vpar_SynchroEnd( struct vpar_thread_s * p_vpar ); void vpar_SynchroEnd ( struct vpar_thread_s * p_vpar );
mtime_t vpar_SynchroDate( struct vpar_thread_s * p_vpar ); mtime_t vpar_SynchroDate ( struct vpar_thread_s * p_vpar );
#ifndef SAM_SYNCHRO #ifndef SAM_SYNCHRO
void vpar_SynchroKludge( struct vpar_thread_s *, mtime_t ); void vpar_SynchroKludge ( struct vpar_thread_s *, mtime_t );
#endif #endif
/*****************************************************************************
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
extern "C"
{
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "BeOS";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* the BeOS plugin always works under BeOS :) */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
}
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
} /* extern "C" */
/*****************************************************************************
* dsp.c : OSS /dev/dsp plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "OSS /dev/dsp";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->vout_GetPlugin = NULL;
p_info->intf_GetPlugin = NULL;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: check if suitable */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
}
/*****************************************************************************
* dummy.c : dummy plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Dummy";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* the dummy plugin always works */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
}
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
#include "intf_msg.h" #include "intf_msg.h"
#define WIDTH 128 #define WIDTH 16
#define HEIGHT 64 #define HEIGHT 16
#define BITS_PER_PLANE 16 #define BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 2 #define BYTES_PER_PIXEL 2
......
/*****************************************************************************
* esd.c : Esound plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Esound";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->vout_GetPlugin = NULL;
p_info->intf_GetPlugin = NULL;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: check if suitable */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_SysOpen;
p_aout->p_sys_reset = aout_SysReset;
p_aout->p_sys_setformat = aout_SysSetFormat;
p_aout->p_sys_setchannels = aout_SysSetChannels;
p_aout->p_sys_setrate = aout_SysSetRate;
p_aout->p_sys_getbufinfo = aout_SysGetBufInfo;
p_aout->p_sys_playsamples = aout_SysPlaySamples;
p_aout->p_sys_close = aout_SysClose;
}
/*****************************************************************************
* fb.c : Linux framebuffer plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Linux framebuffer";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect the framebuffer ioctl()s in the kernel */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
/* optional functions */
p_vout->p_set_palette = vout_SetPalette;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
...@@ -104,9 +104,14 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -104,9 +104,14 @@ int intf_SysCreate( intf_thread_t *p_intf )
/* set keyboard settings */ /* set keyboard settings */
if (tcgetattr(0, &p_intf->p_sys->old_termios) == -1) if (tcgetattr(0, &p_intf->p_sys->old_termios) == -1)
{
intf_ErrMsg( "intf error: tcgetattr" ); intf_ErrMsg( "intf error: tcgetattr" );
}
if (tcgetattr(0, &p_intf->p_sys->new_termios) == -1) if (tcgetattr(0, &p_intf->p_sys->new_termios) == -1)
{
intf_ErrMsg( "intf error: tcgetattr" ); intf_ErrMsg( "intf error: tcgetattr" );
}
p_intf->p_sys->new_termios.c_lflag &= ~ (ICANON | ISIG); p_intf->p_sys->new_termios.c_lflag &= ~ (ICANON | ISIG);
p_intf->p_sys->new_termios.c_lflag |= (ECHO | ECHOCTL); p_intf->p_sys->new_termios.c_lflag |= (ECHO | ECHOCTL);
...@@ -115,7 +120,9 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -115,7 +120,9 @@ int intf_SysCreate( intf_thread_t *p_intf )
p_intf->p_sys->new_termios.c_cc[VTIME] = 0; p_intf->p_sys->new_termios.c_cc[VTIME] = 0;
if (tcsetattr(0, TCSAFLUSH, &p_intf->p_sys->new_termios) == -1) if (tcsetattr(0, TCSAFLUSH, &p_intf->p_sys->new_termios) == -1)
{
intf_ErrMsg( "intf error: tcsetattr" ); intf_ErrMsg( "intf error: tcsetattr" );
}
ioctl(p_intf->p_sys->i_tty_dev, VT_RELDISP, VT_ACKACQ); ioctl(p_intf->p_sys->i_tty_dev, VT_RELDISP, VT_ACKACQ);
...@@ -126,17 +133,22 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -126,17 +133,22 @@ int intf_SysCreate( intf_thread_t *p_intf )
if( sigaction( SIGUSR1, &sig_tty, &p_intf->p_sys->sig_usr1 ) || if( sigaction( SIGUSR1, &sig_tty, &p_intf->p_sys->sig_usr1 ) ||
sigaction( SIGUSR2, &sig_tty, &p_intf->p_sys->sig_usr2 ) ) sigaction( SIGUSR2, &sig_tty, &p_intf->p_sys->sig_usr2 ) )
{ {
intf_ErrMsg("intf error: can't set up signal handler (%s)\n", strerror(errno) ); intf_ErrMsg( "intf error: can't set up signal handler (%s)\n",
strerror(errno) );
tcsetattr(0, 0, &p_intf->p_sys->old_termios);
FBTextMode( p_intf->p_sys->i_tty_dev ); FBTextMode( p_intf->p_sys->i_tty_dev );
return( 1 ); return( 1 );
} }
/* Set-up tty according to new signal handler */ /* Set-up tty according to new signal handler */
if( ioctl(p_intf->p_sys->i_tty_dev, VT_GETMODE, &p_intf->p_sys->vt_mode) == -1 ) if( ioctl(p_intf->p_sys->i_tty_dev, VT_GETMODE, &p_intf->p_sys->vt_mode)
== -1 )
{ {
intf_ErrMsg("intf error: cant get terminal mode (%s)\n", strerror(errno) ); intf_ErrMsg( "intf error: cant get terminal mode (%s)\n",
strerror(errno) );
sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL ); sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL );
sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL ); sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL );
tcsetattr(0, 0, &p_intf->p_sys->old_termios);
FBTextMode( p_intf->p_sys->i_tty_dev ); FBTextMode( p_intf->p_sys->i_tty_dev );
return( 1 ); return( 1 );
} }
...@@ -148,9 +160,11 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -148,9 +160,11 @@ int intf_SysCreate( intf_thread_t *p_intf )
if( ioctl(p_intf->p_sys->i_tty_dev, VT_SETMODE, &vt_mode) == -1 ) if( ioctl(p_intf->p_sys->i_tty_dev, VT_SETMODE, &vt_mode) == -1 )
{ {
intf_ErrMsg("intf error: can't set terminal mode (%s)\n", strerror(errno) ); intf_ErrMsg( "intf error: can't set terminal mode (%s)\n",
strerror(errno) );
sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL ); sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL );
sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL ); sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL );
tcsetattr(0, 0, &p_intf->p_sys->old_termios);
FBTextMode( p_intf->p_sys->i_tty_dev ); FBTextMode( p_intf->p_sys->i_tty_dev );
return( 1 ); return( 1 );
} }
...@@ -160,14 +174,17 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -160,14 +174,17 @@ int intf_SysCreate( intf_thread_t *p_intf )
{ {
p_intf->p_vout = vout_CreateThread( NULL, 0, p_intf->p_vout = vout_CreateThread( NULL, 0,
p_intf->p_sys->i_width, p_intf->p_sys->i_width,
p_intf->p_sys->i_height, NULL, 0, NULL ); p_intf->p_sys->i_height,
NULL, 0, NULL );
if( p_intf->p_vout == NULL ) /* XXX?? error */ if( p_intf->p_vout == NULL ) /* XXX?? error */
{ {
intf_ErrMsg("intf error: can't create output thread\n" ); intf_ErrMsg("intf error: can't create output thread\n" );
ioctl(p_intf->p_sys->i_tty_dev, VT_SETMODE, &p_intf->p_sys->vt_mode); ioctl( p_intf->p_sys->i_tty_dev, VT_SETMODE,
&p_intf->p_sys->vt_mode );
sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL ); sigaction( SIGUSR1, &p_intf->p_sys->sig_usr1, NULL );
sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL ); sigaction( SIGUSR2, &p_intf->p_sys->sig_usr2, NULL );
free( p_intf->p_sys ); free( p_intf->p_sys );
tcsetattr(0, 0, &p_intf->p_sys->old_termios);
FBTextMode( p_intf->p_sys->i_tty_dev ); FBTextMode( p_intf->p_sys->i_tty_dev );
return( 1 ); return( 1 );
} }
...@@ -224,8 +241,8 @@ void intf_SysManage( intf_thread_t *p_intf ) ...@@ -224,8 +241,8 @@ void intf_SysManage( intf_thread_t *p_intf )
/***************************************************************************** /*****************************************************************************
* FBSwitchDisplay: VT change signal handler * FBSwitchDisplay: VT change signal handler
***************************************************************************** *****************************************************************************
* This function activate or desactivate the output of the thread. It is called * This function activates or deactivates the output of the thread. It is
* by the VT driver, on terminal change. * called by the VT driver, on terminal change.
*****************************************************************************/ *****************************************************************************/
static void FBSwitchDisplay(int i_signal) static void FBSwitchDisplay(int i_signal)
{ {
......
...@@ -73,8 +73,6 @@ typedef struct vout_sys_s ...@@ -73,8 +73,6 @@ typedef struct vout_sys_s
*****************************************************************************/ *****************************************************************************/
static int FBOpenDisplay ( vout_thread_t *p_vout ); static int FBOpenDisplay ( vout_thread_t *p_vout );
static void FBCloseDisplay ( vout_thread_t *p_vout ); static void FBCloseDisplay ( vout_thread_t *p_vout );
static void FBSetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/***************************************************************************** /*****************************************************************************
* vout_SysCreate: allocates FB video thread output method * vout_SysCreate: allocates FB video thread output method
...@@ -108,7 +106,6 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, ...@@ -108,7 +106,6 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
*****************************************************************************/ *****************************************************************************/
int vout_SysInit( vout_thread_t *p_vout ) int vout_SysInit( vout_thread_t *p_vout )
{ {
p_vout->p_set_palette = FBSetPalette;
return( 0 ); return( 0 );
} }
...@@ -186,6 +183,20 @@ void vout_SysDisplay( vout_thread_t *p_vout ) ...@@ -186,6 +183,20 @@ void vout_SysDisplay( vout_thread_t *p_vout )
ioctl( p_vout->p_sys->i_fb_dev, FBIOPAN_DISPLAY, &p_vout->p_sys->var_info ); ioctl( p_vout->p_sys->i_fb_dev, FBIOPAN_DISPLAY, &p_vout->p_sys->var_info );
} }
/*****************************************************************************
* vout_SetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
void vout_SetPalette( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
ioctl( p_vout->p_sys->i_fb_dev, FBIOPUTCMAP, &cmap );
}
/* following functions are local */ /* following functions are local */
/***************************************************************************** /*****************************************************************************
...@@ -349,17 +360,4 @@ static void FBCloseDisplay( vout_thread_t *p_vout ) ...@@ -349,17 +360,4 @@ static void FBCloseDisplay( vout_thread_t *p_vout )
close( p_vout->p_sys->i_fb_dev ); close( p_vout->p_sys->i_fb_dev );
} }
/*****************************************************************************
* FBSetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
static void FBSetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
struct fb_cmap cmap = { 0, 256, red, green, blue, transp };
ioctl( p_vout->p_sys->i_fb_dev, FBIOPUTCMAP, &cmap );
}
/*****************************************************************************
* ggi.c : GGI plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "GGI";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect GGI_DISPLAY or whatever */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
...@@ -100,8 +100,6 @@ int intf_SysCreate( intf_thread_t *p_intf ) ...@@ -100,8 +100,6 @@ int intf_SysCreate( intf_thread_t *p_intf )
NULL, 0, NULL, 0,
(void *)&p_intf->p_sys->p_display ); (void *)&p_intf->p_sys->p_display );
fprintf(stderr, "display is %i\n", p_intf->p_sys->p_display);
if( p_intf->p_vout == NULL ) /* error */ if( p_intf->p_vout == NULL ) /* error */
{ {
intf_ErrMsg("error: can't create video output thread\n" ); intf_ErrMsg("error: can't create video output thread\n" );
......
...@@ -203,7 +203,6 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -203,7 +203,6 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
} }
/* give the data back to the interface */ /* give the data back to the interface */
fprintf(stderr, "display is %i\n", p_vout->p_sys->p_display);
*(ggi_visual_t *)p_data = p_vout->p_sys->p_display; *(ggi_visual_t *)p_data = p_vout->p_sys->p_display;
/* Find most appropriate mode */ /* Find most appropriate mode */
...@@ -237,7 +236,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat ...@@ -237,7 +236,7 @@ static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display, void *p_dat
{ {
/* Get buffer address */ /* Get buffer address */
p_vout->p_sys->p_buffer[ i_index ] = p_vout->p_sys->p_buffer[ i_index ] =
ggiDBGetBuffer( p_vout->p_sys->p_display, i_index ); (ggi_directbuffer *)ggiDBGetBuffer( p_vout->p_sys->p_display, i_index );
if( p_vout->p_sys->p_buffer[ i_index ] == NULL ) if( p_vout->p_sys->p_buffer[ i_index ] == NULL )
{ {
intf_ErrMsg("error: double buffering is not possible\n"); intf_ErrMsg("error: double buffering is not possible\n");
......
/*****************************************************************************
* glide.c : 3dfx Glide plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "3dfx Glide";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect a 3dfx card */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
/*****************************************************************************
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Gnome";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect an X display or Gnome libs */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
/* optional functions */
p_vout->p_set_palette = vout_SetPalette;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
...@@ -89,8 +89,6 @@ static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage, ...@@ -89,8 +89,6 @@ static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage,
XShmSegmentInfo *p_shm_info ); XShmSegmentInfo *p_shm_info );
static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage, static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage,
XShmSegmentInfo *p_shm_info ); XShmSegmentInfo *p_shm_info );
static void X11SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/***************************************************************************** /*****************************************************************************
* vout_SysCreate: allocate X11 video thread output method * vout_SysCreate: allocate X11 video thread output method
...@@ -134,9 +132,6 @@ int vout_SysInit( vout_thread_t *p_vout ) ...@@ -134,9 +132,6 @@ int vout_SysInit( vout_thread_t *p_vout )
{ {
int i_err; int i_err;
/* Initialize palette changing procedure */
p_vout->p_set_palette = X11SetPalette;
/* Create XImages using XShm extension - on failure, fall back to regular /* Create XImages using XShm extension - on failure, fall back to regular
* way (and destroy the first image if it was created successfully) */ * way (and destroy the first image if it was created successfully) */
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
...@@ -157,7 +152,7 @@ int vout_SysInit( vout_thread_t *p_vout ) ...@@ -157,7 +152,7 @@ int vout_SysInit( vout_thread_t *p_vout )
} }
if( i_err ) /* an error occured */ if( i_err ) /* an error occured */
{ {
intf_Msg("XShm video sextension desactivated\n" ); intf_Msg("XShm video extension deactivated\n" );
p_vout->p_sys->b_shm = 0; p_vout->p_sys->b_shm = 0;
} }
} }
...@@ -303,6 +298,37 @@ void vout_SysDisplay( vout_thread_t *p_vout ) ...@@ -303,6 +298,37 @@ void vout_SysDisplay( vout_thread_t *p_vout )
} }
} }
/*****************************************************************************
* vout_SetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
void vout_SetPalette( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
int i;
XColor color[255];
intf_DbgMsg( "Palette change called\n" );
/* allocate palette */
for( i = 0; i < 255; i++ )
{
/* kludge: colors are indexed reversely because color 255 seems
* to be reserved for black even if we try to set it to white */
color[i].pixel = 255-i;
color[i].pad = 0;
color[i].flags = DoRed|DoGreen|DoBlue;
color[i].red = red[255-i];
color[i].blue = blue[255-i];
color[i].green = green[255-i];
}
XStoreColors( p_vout->p_sys->p_display, p_vout->p_sys->colormap, color, 256 );
}
/* following functions are local */ /* following functions are local */
/***************************************************************************** /*****************************************************************************
...@@ -659,34 +685,4 @@ static void X11DestroyShmImage( vout_thread_t *p_vout, XImage *p_ximage, ...@@ -659,34 +685,4 @@ static void X11DestroyShmImage( vout_thread_t *p_vout, XImage *p_ximage,
} }
} }
/*****************************************************************************
* X11SetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
static void X11SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
int i;
XColor color[255];
intf_DbgMsg( "Palette change called\n" );
/* allocate palette */
for( i = 0; i < 255; i++ )
{
/* kludge: colors are indexed reversely because color 255 seems
* to be reserved for black even if we try to set it to white */
color[i].pixel = 255-i;
color[i].pad = 0;
color[i].flags = DoRed|DoGreen|DoBlue;
color[i].red = red[255-i];
color[i].blue = blue[255-i];
color[i].green = green[255-i];
}
XStoreColors( p_vout->p_sys->p_display, p_vout->p_sys->colormap, color, 256 );
}
/*****************************************************************************
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Matrox Acceleration";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect an MGA card ? */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
...@@ -112,7 +112,7 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, ...@@ -112,7 +112,7 @@ int vout_SysCreate( vout_thread_t *p_vout, char *psz_display,
*****************************************************************************/ *****************************************************************************/
int vout_SysInit( vout_thread_t *p_vout ) int vout_SysInit( vout_thread_t *p_vout )
{ {
int i_err, i_dummy; int i_err;
/* create the MGA output */ /* create the MGA output */
p_vout->p_sys->p_mga->src_width = p_vout->i_width; p_vout->p_sys->p_mga->src_width = p_vout->i_width;
...@@ -180,7 +180,7 @@ int vout_SysInit( vout_thread_t *p_vout ) ...@@ -180,7 +180,7 @@ int vout_SysInit( vout_thread_t *p_vout )
} }
if( i_err ) /* an error occured */ if( i_err ) /* an error occured */
{ {
intf_Msg("XShm video sextension desactivated\n" ); intf_Msg("XShm video sextension deactivated\n" );
p_vout->p_sys->b_shm = 0; p_vout->p_sys->b_shm = 0;
} }
} }
......
...@@ -89,8 +89,6 @@ static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage, ...@@ -89,8 +89,6 @@ static int X11CreateShmImage ( vout_thread_t *p_vout, XImage **pp_ximage,
XShmSegmentInfo *p_shm_info ); XShmSegmentInfo *p_shm_info );
static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage, static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage,
XShmSegmentInfo *p_shm_info ); XShmSegmentInfo *p_shm_info );
static void X11SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/***************************************************************************** /*****************************************************************************
* vout_SysCreate: allocate X11 video thread output method * vout_SysCreate: allocate X11 video thread output method
...@@ -134,9 +132,6 @@ int vout_SysInit( vout_thread_t *p_vout ) ...@@ -134,9 +132,6 @@ int vout_SysInit( vout_thread_t *p_vout )
{ {
int i_err; int i_err;
/* Initialize palette changing procedure */
p_vout->p_set_palette = X11SetPalette;
/* Create XImages using XShm extension - on failure, fall back to regular /* Create XImages using XShm extension - on failure, fall back to regular
* way (and destroy the first image if it was created successfully) */ * way (and destroy the first image if it was created successfully) */
if( p_vout->p_sys->b_shm ) if( p_vout->p_sys->b_shm )
...@@ -157,7 +152,7 @@ int vout_SysInit( vout_thread_t *p_vout ) ...@@ -157,7 +152,7 @@ int vout_SysInit( vout_thread_t *p_vout )
} }
if( i_err ) /* an error occured */ if( i_err ) /* an error occured */
{ {
intf_Msg("XShm video sextension desactivated\n" ); intf_Msg("XShm video sextension deactivated\n" );
p_vout->p_sys->b_shm = 0; p_vout->p_sys->b_shm = 0;
} }
} }
...@@ -234,7 +229,8 @@ int vout_SysManage( vout_thread_t *p_vout ) ...@@ -234,7 +229,8 @@ int vout_SysManage( vout_thread_t *p_vout )
/* /*
* Color/Grayscale or gamma change: in 8bpp, just change the colormap * Color/Grayscale or gamma change: in 8bpp, just change the colormap
*/ */
if( (p_vout->i_changes & VOUT_GRAYSCALE_CHANGE) && (p_vout->i_screen_depth == 8) ) if( (p_vout->i_changes & VOUT_GRAYSCALE_CHANGE)
&& (p_vout->i_screen_depth == 8) )
{ {
/* FIXME: clear flags ?? */ /* FIXME: clear flags ?? */
} }
...@@ -262,7 +258,8 @@ int vout_SysManage( vout_thread_t *p_vout ) ...@@ -262,7 +258,8 @@ int vout_SysManage( vout_thread_t *p_vout )
} }
/* Tell the video output thread that it will need to rebuild YUV /* Tell the video output thread that it will need to rebuild YUV
* tables. This is needed since conversion buffer size may have changed */ * tables. This is needed since conversion buffer size may have
* changed */
p_vout->i_changes |= VOUT_YUV_CHANGE; p_vout->i_changes |= VOUT_YUV_CHANGE;
intf_Msg("Video display resized (%dx%d)\n", p_vout->i_width, p_vout->i_height); intf_Msg("Video display resized (%dx%d)\n", p_vout->i_width, p_vout->i_height);
} }
...@@ -303,6 +300,37 @@ void vout_SysDisplay( vout_thread_t *p_vout ) ...@@ -303,6 +300,37 @@ void vout_SysDisplay( vout_thread_t *p_vout )
} }
} }
/*****************************************************************************
* vout_SetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
void vout_SetPalette( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
int i;
XColor color[255];
intf_DbgMsg( "Palette change called\n" );
/* allocate palette */
for( i = 0; i < 255; i++ )
{
/* kludge: colors are indexed reversely because color 255 seems
* to be reserved for black even if we try to set it to white */
color[i].pixel = 255-i;
color[i].pad = 0;
color[i].flags = DoRed|DoGreen|DoBlue;
color[i].red = red[255-i];
color[i].blue = blue[255-i];
color[i].green = green[255-i];
}
XStoreColors( p_vout->p_sys->p_display, p_vout->p_sys->colormap, color, 256 );
}
/* following functions are local */ /* following functions are local */
/***************************************************************************** /*****************************************************************************
...@@ -661,34 +689,4 @@ static void X11DestroyShmImage( vout_thread_t *p_vout, XImage *p_ximage, ...@@ -661,34 +689,4 @@ static void X11DestroyShmImage( vout_thread_t *p_vout, XImage *p_ximage,
} }
} }
/*****************************************************************************
* X11SetPalette: sets an 8 bpp palette
*****************************************************************************
* This function sets the palette given as an argument. It does not return
* anything, but could later send information on which colors it was unable
* to set.
*****************************************************************************/
static void X11SetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp )
{
int i;
XColor color[255];
intf_DbgMsg( "Palette change called\n" );
/* allocate palette */
for( i = 0; i < 255; i++ )
{
/* kludge: colors are indexed reversely because color 255 seems
* to be reserved for black even if we try to set it to white */
color[i].pixel = 255-i;
color[i].pad = 0;
color[i].flags = DoRed|DoGreen|DoBlue;
color[i].red = red[255-i];
color[i].blue = blue[255-i];
color[i].green = green[255-i];
}
XStoreColors( p_vout->p_sys->p_display, p_vout->p_sys->colormap, color, 256 );
}
/*****************************************************************************
* x11.c : X11 plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout );
void intf_GetPlugin( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "X Window System";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
/* TODO: detect an X display */
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_SysCreate;
p_vout->p_sys_init = vout_SysInit;
p_vout->p_sys_end = vout_SysEnd;
p_vout->p_sys_destroy = vout_SysDestroy;
p_vout->p_sys_manage = vout_SysManage;
p_vout->p_sys_display = vout_SysDisplay;
/* optional functions */
p_vout->p_set_palette = vout_SetPalette;
}
void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_SysCreate;
p_intf->p_sys_destroy = intf_SysDestroy;
p_intf->p_sys_manage = intf_SysManage;
}
This diff is collapsed.
/*****************************************************************************
* video_yuv.h: YUV transformation functions
* Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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-1307, USA.
*****************************************************************************/
/*****************************************************************************
* Constants
*****************************************************************************/
/* Margins and offsets in conversion tables - Margins are used in case a RGB
* RGB conversion would give a value outside the 0-255 range. Offsets have been
* calculated to avoid using the same cache line for 2 tables. conversion tables
* are 2*MARGIN + 256 long and stores pixels.*/
#define RED_MARGIN 178
#define GREEN_MARGIN 135
#define BLUE_MARGIN 224
#define RED_OFFSET 1501 /* 1323 to 1935 */
#define GREEN_OFFSET 135 /* 0 to 526 */
#define BLUE_OFFSET 818 /* 594 to 1298 */
#define RGB_TABLE_SIZE 1935 /* total table size */
#define GRAY_MARGIN 384
#define GRAY_TABLE_SIZE 1024 /* total table size */
#define PALETTE_TABLE_SIZE 2176 /* YUV -> 8bpp palette lookup table */
/* macros used for YUV pixel conversions */
#define SHIFT 20
#define U_GREEN_COEF ((int)(-0.391 * (1<<SHIFT) / 1.164))
#define U_BLUE_COEF ((int)(2.018 * (1<<SHIFT) / 1.164))
#define V_RED_COEF ((int)(1.596 * (1<<SHIFT) / 1.164))
#define V_GREEN_COEF ((int)(-0.813 * (1<<SHIFT) / 1.164))
/* argument lists for YUV functions */
#define YUV_ARGS_8BPP p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_16BPP p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_24BPP p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_32BPP p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
/*****************************************************************************
* Local prototypes
*****************************************************************************/
void SetGammaTable ( int *pi_table, double f_gamma );
void SetYUV ( vout_thread_t *p_vout );
void SetOffset ( int i_width, int i_height, int i_pic_width,
int i_pic_height, boolean_t *pb_h_scaling,
int *pi_v_scaling, int *p_offset );
void ConvertY4Gray8 ( YUV_ARGS_8BPP );
void ConvertYUV420RGB8 ( YUV_ARGS_8BPP );
void ConvertYUV422RGB8 ( YUV_ARGS_8BPP );
void ConvertYUV444RGB8 ( YUV_ARGS_8BPP );
void ConvertY4Gray16 ( YUV_ARGS_16BPP );
void ConvertYUV420RGB16 ( YUV_ARGS_16BPP );
void ConvertYUV422RGB16 ( YUV_ARGS_16BPP );
void ConvertYUV444RGB16 ( YUV_ARGS_16BPP );
void ConvertY4Gray24 ( YUV_ARGS_24BPP );
void ConvertYUV420RGB24 ( YUV_ARGS_24BPP );
void ConvertYUV422RGB24 ( YUV_ARGS_24BPP );
void ConvertYUV444RGB24 ( YUV_ARGS_24BPP );
void ConvertY4Gray32 ( YUV_ARGS_32BPP );
void ConvertYUV420RGB32 ( YUV_ARGS_32BPP );
void ConvertYUV422RGB32 ( YUV_ARGS_32BPP );
void ConvertYUV444RGB32 ( YUV_ARGS_32BPP );
This diff is collapsed.
/*****************************************************************************
* video_yuv24.c: YUV transformation functions for 24 bpp
* Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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-1307, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <math.h> /* exp(), pow() */
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "video.h"
#include "video_output.h"
#include "video_yuv.h"
#include "video_yuv_macros.h"
#include "intf_msg.h"
/*****************************************************************************
* ConvertY4Gray24: grayscale YUV 4:x:x to RGB 2 Bpp
*****************************************************************************/
void ConvertY4Gray24( YUV_ARGS_24BPP )
{
intf_ErrMsg( "yuv error: unhandled function, grayscale, bpp = 24\n" );
}
/*****************************************************************************
* ConvertYUV420RGB24: color YUV 4:2:0 to RGB 2 Bpp
*****************************************************************************/
void ConvertYUV420RGB24( YUV_ARGS_24BPP )
{
intf_ErrMsg( "yuv error: unhandled function, chroma = 420, bpp = 24\n" );
}
/*****************************************************************************
* ConvertYUV422RGB24: color YUV 4:2:2 to RGB 2 Bpp
*****************************************************************************/
void ConvertYUV422RGB24( YUV_ARGS_24BPP )
{
intf_ErrMsg( "yuv error: unhandled function, chroma = 422, bpp = 24\n" );
}
/*****************************************************************************
* ConvertYUV444RGB24: color YUV 4:4:4 to RGB 2 Bpp
*****************************************************************************/
void ConvertYUV444RGB24( YUV_ARGS_24BPP )
{
intf_ErrMsg( "yuv error: unhandled function, chroma = 444, bpp = 24\n" );
}
This diff is collapsed.
/*****************************************************************************
* video_yuv8.c: YUV transformation functions for 8bpp
* Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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-1307, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <math.h> /* exp(), pow() */
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "video.h"
#include "video_output.h"
#include "video_yuv.h"
#include "video_yuv_macros.h"
#include "video_yuv_macros_8bpp.h"
#include "intf_msg.h"
/*****************************************************************************
* ConvertY4Gray8: grayscale YUV 4:x:x to RGB 8 bpp
*****************************************************************************/
void ConvertY4Gray8( YUV_ARGS_8BPP )
{
boolean_t b_horizontal_scaling; /* horizontal scaling type */
int i_vertical_scaling; /* vertical scaling type */
int i_x, i_y; /* horizontal and vertical indexes */
int i_scale_count; /* scale modulo counter */
int i_chroma_width; /* chroma width, not used */
u8 * p_gray; /* base conversion table */
u8 * p_pic_start; /* beginning of the current line for copy */
u8 * p_buffer_start; /* conversion buffer start */
u8 * p_buffer; /* conversion buffer pointer */
int * p_offset_start; /* offset array start */
int * p_offset; /* offset array pointer */
/*
* Initialize some values - i_pic_line_width will store the line skip
*/
i_pic_line_width -= i_pic_width;
p_gray = p_vout->yuv.yuv.p_gray8;
p_buffer_start = p_vout->yuv.p_buffer;
p_offset_start = p_vout->yuv.p_offset;
SetOffset( i_width, i_height, i_pic_width, i_pic_height,
&b_horizontal_scaling, &i_vertical_scaling, p_offset_start );
/*
* Perform conversion
*/
i_scale_count = i_pic_height;
for( i_y = 0; i_y < i_height; i_y++ )
{
/* Mark beginnning of line for possible later line copy, and initialize
* buffer */
p_pic_start = p_pic;
p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic;
/* Do YUV conversion to buffer - YUV picture is always formed of 16
* pixels wide blocks */
for( i_x = i_width / 16; i_x--; )
{
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
*p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
}
/* Do horizontal and vertical scaling */
SCALE_WIDTH;
SCALE_HEIGHT(400, 1);
}
}
/*****************************************************************************
* ConvertYUV420RGB8: color YUV 4:2:0 to RGB 8 bpp
*****************************************************************************/
void ConvertYUV420RGB8( YUV_ARGS_8BPP )
{
boolean_t b_horizontal_scaling; /* horizontal scaling type */
int i_vertical_scaling; /* vertical scaling type */
int i_x, i_y; /* horizontal and vertical indexes */
int i_scale_count; /* scale modulo counter */
int b_jump_uv; /* should we jump u and v ? */
int i_real_y; /* y % 4 */
u8 * p_lookup; /* lookup table */
int i_chroma_width; /* chroma width */
int * p_offset_start; /* offset array start */
int * p_offset; /* offset array pointer */
/*
* The dither matrices
*/
int dither10[4] = { 0x0, 0x8, 0x2, 0xa };
int dither11[4] = { 0xc, 0x4, 0xe, 0x6 };
int dither12[4] = { 0x3, 0xb, 0x1, 0x9 };
int dither13[4] = { 0xf, 0x7, 0xd, 0x5 };
int dither20[4] = { 0x0, 0x10, 0x4, 0x14 };
int dither21[4] = { 0x18, 0x8, 0x1c, 0xc };
int dither22[4] = { 0x6, 0x16, 0x2, 0x12 };
int dither23[4] = { 0x1e, 0xe, 0x1a, 0xa };
return;
/*
* Initialize some values - i_pic_line_width will store the line skip
*/
i_pic_line_width -= i_pic_width;
i_chroma_width = i_width / 2;
p_offset_start = p_vout->yuv.p_offset;
p_lookup = p_vout->yuv.p_base;
SetOffset( i_width, i_height, i_pic_width, i_pic_height,
&b_horizontal_scaling, &i_vertical_scaling, p_offset_start );
/*
* Perform conversion
*/
i_scale_count = i_pic_height;
i_real_y = 0;
for( i_y = 0; i_y < i_height; i_y++ )
{
/* Do horizontal and vertical scaling */
SCALE_WIDTH_DITHER( 420 );
SCALE_HEIGHT_DITHER( 420 );
}
}
/*****************************************************************************
* ConvertYUV422RGB8: color YUV 4:2:2 to RGB 8 bpp
*****************************************************************************/
void ConvertYUV422RGB8( YUV_ARGS_8BPP )
{
intf_ErrMsg( "yuv error: unhandled function, chroma = 422, bpp = 8\n" );
}
/*****************************************************************************
* ConvertYUV444RGB8: color YUV 4:4:4 to RGB 8 bpp
*****************************************************************************/
void ConvertYUV444RGB8( YUV_ARGS_8BPP )
{
intf_ErrMsg( "yuv error: unhandled function, chroma = 444, bpp = 8\n" );
}
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* yuv.c : C YUV functions for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
*
* 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 "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "plugins_export.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
void yuv_GetPlugin( p_vout_thread_t p_vout );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "C YUV to RGB transformations";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = NULL;
p_info->intf_GetPlugin = NULL;
p_info->yuv_GetPlugin = yuv_GetPlugin;
return( p_info );
}
/*****************************************************************************
* Test: tests if the plugin can be launched
*****************************************************************************/
int Test( void )
{
return( 1 );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
void yuv_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_yuv_init = yuv_SysInit;
p_vout->p_yuv_reset = yuv_SysReset;
p_vout->p_yuv_end = yuv_SysEnd;
}
This diff is collapsed.
/*****************************************************************************
* video_yuv.h: YUV transformation functions
* Provides functions to perform the YUV conversion. The functions provided here
* are a complete and portable C implementation, and may be replaced in certain
* case by optimized functions.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
*
* 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-1307, USA.
*****************************************************************************/
/*****************************************************************************
* Constants
*****************************************************************************/
/* Margins and offsets in conversion tables - Margins are used in case a RGB
* RGB conversion would give a value outside the 0-255 range. Offsets have been
* calculated to avoid using the same cache line for 2 tables. conversion tables
* are 2*MARGIN + 256 long and stores pixels.*/
#define RED_MARGIN 178
#define GREEN_MARGIN 135
#define BLUE_MARGIN 224
#define RED_OFFSET 1501 /* 1323 to 1935 */
#define GREEN_OFFSET 135 /* 0 to 526 */
#define BLUE_OFFSET 818 /* 594 to 1298 */
#define RGB_TABLE_SIZE 1935 /* total table size */
#define GRAY_MARGIN 384
#define GRAY_TABLE_SIZE 1024 /* total table size */
#define PALETTE_TABLE_SIZE 2176 /* YUV -> 8bpp palette lookup table */
/* macros used for YUV pixel conversions */
#define SHIFT 20
#define U_GREEN_COEF ((int)(-0.391 * (1<<SHIFT) / 1.164))
#define U_BLUE_COEF ((int)(2.018 * (1<<SHIFT) / 1.164))
#define V_RED_COEF ((int)(1.596 * (1<<SHIFT) / 1.164))
#define V_GREEN_COEF ((int)(-0.813 * (1<<SHIFT) / 1.164))
/* argument lists for YUV functions */
#define YUV_ARGS_8BPP p_vout_thread_t p_vout, u8 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_16BPP p_vout_thread_t p_vout, u16 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_24BPP p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
#define YUV_ARGS_32BPP p_vout_thread_t p_vout, u32 *p_pic, yuv_data_t *p_y, \
yuv_data_t *p_u, yuv_data_t *p_v, int i_width, int i_height, int i_pic_width, \
int i_pic_height, int i_pic_line_width, int i_matrix_coefficients
/*****************************************************************************
* Local prototypes
*****************************************************************************/
void SetGammaTable ( int *pi_table, double f_gamma );
void SetYUV ( vout_thread_t *p_vout );
void SetOffset ( int i_width, int i_height, int i_pic_width,
int i_pic_height, boolean_t *pb_h_scaling,
int *pi_v_scaling, int *p_offset );
void ConvertY4Gray8 ( YUV_ARGS_8BPP );
void ConvertYUV420RGB8 ( YUV_ARGS_8BPP );
void ConvertYUV422RGB8 ( YUV_ARGS_8BPP );
void ConvertYUV444RGB8 ( YUV_ARGS_8BPP );
void ConvertY4Gray16 ( YUV_ARGS_16BPP );
void ConvertYUV420RGB16 ( YUV_ARGS_16BPP );
void ConvertYUV422RGB16 ( YUV_ARGS_16BPP );
void ConvertYUV444RGB16 ( YUV_ARGS_16BPP );
void ConvertY4Gray24 ( YUV_ARGS_24BPP );
void ConvertYUV420RGB24 ( YUV_ARGS_24BPP );
void ConvertYUV422RGB24 ( YUV_ARGS_24BPP );
void ConvertYUV444RGB24 ( YUV_ARGS_24BPP );
void ConvertY4Gray32 ( YUV_ARGS_32BPP );
void ConvertYUV420RGB32 ( YUV_ARGS_32BPP );
void ConvertYUV422RGB32 ( YUV_ARGS_32BPP );
void ConvertYUV444RGB32 ( YUV_ARGS_32BPP );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -23,11 +23,14 @@ ...@@ -23,11 +23,14 @@
#include <stdio.h> /* "intf_msg.h" */ #include <stdio.h> /* "intf_msg.h" */
#include "int_types.h" #include "common.h"
#include "ac3_decoder.h" #include "ac3_decoder.h"
#include "ac3_internal.h" #include "ac3_internal.h"
#include "ac3_bit_stream.h" #include "ac3_bit_stream.h"
#include "intf_msg.h"
#define Q0 ((-2 << 15) / 3.0) #define Q0 ((-2 << 15) / 3.0)
#define Q1 (0) #define Q1 (0)
#define Q2 ((2 << 15) / 3.0) #define Q2 ((2 << 15) / 3.0)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment