mirror of
https://github.com/videolan/vlc.git
synced 2025-01-21 07:08:35 +08:00
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly do what remains to be fixed during the weekend. Changes in vlc: =============== * vlc is now a very small program (20 lines) which uses the libvlc API; it is quite simple for the moment but can be extended in the future. * interfaces, decoders, video outputs, etc. are now almost the same objects (yes, I know, this is C++ redone in C) and are structured in a tree. More about this later, but basically it allows the following nice features: - several interfaces - several playlists with several outputs - input plugins spawning helper interfaces (will be used for DVD menus) - anything spawning anything; I swear there are useful uses for this! * libvlc can be used in other programs; I'm currently writing a Mozilla plugin for my employer. Things currently broken: ======================== * most interfaces, most ports * the playlist handling (almost finished rewriting this though). This means no file can be played from the GUI, you need to use the commandline. This also means it segfaults at EOF, when exiting the program, and it sometimes refuses to open a file when asked to.
This commit is contained in:
parent
36c0b1516d
commit
9e3ab283c2
@ -5,8 +5,8 @@ conftest
|
||||
conftest.*
|
||||
.dep
|
||||
gmon.out
|
||||
vlc-debug.log
|
||||
vlc-debug.ct
|
||||
vlc-debug.*
|
||||
vlc-log.*
|
||||
config.log
|
||||
config.cache
|
||||
config.status
|
||||
|
9
BUGS
9
BUGS
@ -1,4 +1,4 @@
|
||||
List of known vlc bugs $Id: BUGS,v 1.13 2002/05/20 22:30:19 sam Exp $
|
||||
List of known vlc bugs $Id: BUGS,v 1.14 2002/06/01 12:31:57 sam Exp $
|
||||
|
||||
Please try to keep this file up to date. Also, grep for FIXME in the
|
||||
source files for more and more bugs to fix.
|
||||
@ -63,3 +63,10 @@ Misc:
|
||||
|
||||
* The Jin-Roh DVD seems to segfault.
|
||||
|
||||
|
||||
From: David Legg <David.Legg@legg.uklinux.net>
|
||||
If I change the value of AOUT_FIFO_SIZE from 255 to 511, vlc segmentation
|
||||
faults.
|
||||
|
||||
|
||||
|
||||
|
87
Makefile
87
Makefile
@ -96,10 +96,11 @@ PLUGINS_TARGETS := a52/a52 \
|
||||
esd/esd \
|
||||
fb/fb \
|
||||
ffmpeg/ffmpeg \
|
||||
filter/filter_clone \
|
||||
filter/filter_deinterlace \
|
||||
filter/filter_transform \
|
||||
filter/filter_invert \
|
||||
filter/filter_distort \
|
||||
filter/filter_invert \
|
||||
filter/filter_transform \
|
||||
filter/filter_wall \
|
||||
filter/filter_clone \
|
||||
fx/fx_scope \
|
||||
@ -132,7 +133,7 @@ PLUGINS_TARGETS := a52/a52 \
|
||||
motion/motionmmxext \
|
||||
motion/motion3dnow \
|
||||
motion/motionaltivec \
|
||||
mpeg_system/mpeg_audio \
|
||||
mpeg_system/mpeg_audio \
|
||||
mpeg_system/mpeg_es \
|
||||
mpeg_system/mpeg_ps \
|
||||
mpeg_system/mpeg_ts \
|
||||
@ -159,27 +160,36 @@ PLUGINS_TARGETS := a52/a52 \
|
||||
#
|
||||
# C Objects
|
||||
#
|
||||
INTERFACE := main interface intf_msg intf_playlist intf_eject
|
||||
VLC := vlc
|
||||
LIBVLC := libvlc
|
||||
INTERFACE := interface intf_eject
|
||||
PLAYLIST := playlist
|
||||
INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
|
||||
VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
|
||||
AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
|
||||
MISC := mtime modules configuration netutils iso_lang
|
||||
MISC := mtime modules threads cpu configuration netutils iso_lang messages objects
|
||||
|
||||
C_OBJ := $(INTERFACE:%=src/interface/%.o) \
|
||||
LIBVLC_OBJ := $(LIBVLC:%=src/%.o) \
|
||||
$(INTERFACE:%=src/interface/%.o) \
|
||||
$(PLAYLIST:%=src/playlist/%.o) \
|
||||
$(INPUT:%=src/input/%.o) \
|
||||
$(VIDEO_OUTPUT:%=src/video_output/%.o) \
|
||||
$(AUDIO_OUTPUT:%=src/audio_output/%.o) \
|
||||
$(MISC:%=src/misc/%.o)
|
||||
|
||||
VLC_OBJ := $(VLC:%=src/%.o)
|
||||
|
||||
C_OBJ := $(VLC_OBJ) $(LIBVLC_OBJ)
|
||||
|
||||
#
|
||||
# Misc Objects
|
||||
#
|
||||
ifeq ($(NEED_GETOPT),1)
|
||||
C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
|
||||
LIBVLC_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o
|
||||
endif
|
||||
|
||||
ifeq ($(NEED_SYMBOLS),1)
|
||||
C_OBJ += src/misc/symbols.o
|
||||
LIBVLC_OBJ += src/misc/symbols.o
|
||||
endif
|
||||
|
||||
ifeq ($(SYS),beos)
|
||||
@ -187,15 +197,16 @@ CPP_OBJ := src/misc/beos_specific.o
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring darwin,$(SYS)))
|
||||
C_OBJ += src/misc/darwin_specific.o
|
||||
LIBVLC_OBJ += src/misc/darwin_specific.o
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring mingw32,$(SYS)))
|
||||
C_OBJ += src/misc/win32_specific.o
|
||||
LIBVLC_OBJ += src/misc/win32_specific.o
|
||||
RESOURCE_OBJ := share/vlc_win32_rc.o
|
||||
endif
|
||||
|
||||
VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
|
||||
LIBVLC_OBJ += $(CPP_OBJ) $(M_OBJ) $(BUILTIN_OBJ)
|
||||
VLC_OBJ += $(RESOURCE_OBJ)
|
||||
|
||||
#
|
||||
# Generated header
|
||||
@ -262,7 +273,7 @@ clean: plugins-clean po-clean vlc-clean
|
||||
rm -f src/*/*.o extras/*/*.o
|
||||
rm -f lib/*.so* lib/*.a
|
||||
rm -f plugins/*.so plugins/*.a plugins/*.lib plugins/*.tds
|
||||
rm -rf extras/MacOSX/build
|
||||
rm -Rf extras/MacOSX/build
|
||||
|
||||
po-clean:
|
||||
-cd po && $(MAKE) clean
|
||||
@ -302,28 +313,28 @@ vlc-install:
|
||||
ifneq (,$(ALIASES))
|
||||
for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
|
||||
endif
|
||||
mkdir -p $(DESTDIR)$(datadir)/videolan
|
||||
$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
|
||||
$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
|
||||
$(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
|
||||
mkdir -p $(DESTDIR)$(datadir)/vlc
|
||||
$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/vlc
|
||||
$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/vlc
|
||||
$(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/vlc
|
||||
|
||||
vlc-uninstall:
|
||||
rm -f $(DESTDIR)$(bindir)/vlc
|
||||
ifneq (,$(ALIASES))
|
||||
for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
|
||||
endif
|
||||
rm -f $(DESTDIR)$(datadir)/videolan/*.psf
|
||||
rm -f $(DESTDIR)$(datadir)/videolan/*.png
|
||||
rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
|
||||
rm -f $(DESTDIR)$(datadir)/vlc/*.psf
|
||||
rm -f $(DESTDIR)$(datadir)/vlc/*.png
|
||||
rm -f $(DESTDIR)$(datadir)/vlc/*.xpm
|
||||
|
||||
plugins-install:
|
||||
mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
|
||||
mkdir -p $(DESTDIR)$(libdir)/vlc
|
||||
ifneq (,$(PLUGINS))
|
||||
$(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
|
||||
$(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/vlc
|
||||
endif
|
||||
|
||||
plugins-uninstall:
|
||||
rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
|
||||
rm -f $(DESTDIR)$(libdir)/vlc/*.so
|
||||
|
||||
po-install:
|
||||
-cd po && $(MAKE) install
|
||||
@ -386,7 +397,9 @@ dist:
|
||||
cp $$file tmp/vlc/share ; done
|
||||
# Build archives
|
||||
F=vlc-${VERSION}; \
|
||||
mv tmp/vlc tmp/$$F; (cd tmp ; tar czf ../$$F.tar.gz $$F); \
|
||||
mv tmp/vlc tmp/$$F; (cd tmp ; \
|
||||
cd $$F && $(MAKE) distclean && cd .. ; \
|
||||
tar czf ../$$F.tar.gz $$F);
|
||||
# Clean up
|
||||
rm -Rf tmp
|
||||
|
||||
@ -495,8 +508,8 @@ FORCE:
|
||||
#
|
||||
# Generic rules (see below)
|
||||
#
|
||||
$(H_OBJ): Makefile.opts Makefile.dep Makefile
|
||||
# @echo "regenerating $@"
|
||||
src/misc/modules_builtin.h: Makefile.opts Makefile
|
||||
@echo "make[$(MAKELEVEL)]: Creating \`$@'"
|
||||
@rm -f $@ && cp $@.in $@
|
||||
ifneq (,$(BUILTINS))
|
||||
@for i in $(BUILTINS) ; do \
|
||||
@ -550,25 +563,41 @@ endif
|
||||
#
|
||||
# Main application target
|
||||
#
|
||||
vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
|
||||
vlc: Makefile.config Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $(VLC_OBJ) lib/libvlc.a $(BUILTIN_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) $(builtins_LDFLAGS)
|
||||
ifeq ($(SYS),beos)
|
||||
xres -o $@ ./share/vlc_beos.rsrc
|
||||
mimeset -f $@
|
||||
endif
|
||||
|
||||
# here are the rules for a dynamic link of libvlc:
|
||||
#vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) lib/libvlc.so $(BUILTIN_OBJ)
|
||||
# $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(builtins_LDFLAGS) -L./lib -lvlc
|
||||
|
||||
#
|
||||
# Main library target
|
||||
#
|
||||
lib/libvlc.a: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
|
||||
rm -f $@
|
||||
ar rc $@ $(LIBVLC_OBJ)
|
||||
$(RANLIB) $@
|
||||
|
||||
#lib/libvlc.so: Makefile.opts Makefile.dep Makefile $(LIBVLC_OBJ)
|
||||
# $(CC) -shared $(LIBVLC_OBJ) $(LDFLAGS) $(vlc_LDFLAGS) -o $@
|
||||
# chmod a-x $@
|
||||
|
||||
#
|
||||
# Plugins target
|
||||
#
|
||||
plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
|
||||
$(PLUGIN_OBJ): FORCE
|
||||
$(PLUGIN_OBJ): $(H_OBJ) FORCE
|
||||
@cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
|
||||
|
||||
#
|
||||
# Built-in modules target
|
||||
#
|
||||
builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
|
||||
$(BUILTIN_OBJ): FORCE
|
||||
$(BUILTIN_OBJ): $(H_OBJ) FORCE
|
||||
@cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
|
||||
|
||||
#
|
||||
|
@ -49,7 +49,7 @@ CFLAGS += -DMAKE_DEP
|
||||
|
||||
$(C_DEP): .dep/%.d: %.c
|
||||
@test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*)
|
||||
#@echo "regenerating dependencies for $*.c"
|
||||
@echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.c'"
|
||||
@$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \
|
||||
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
||||
.dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
|
||||
@ -57,7 +57,7 @@ $(C_DEP): .dep/%.d: %.c
|
||||
|
||||
$(CPP_DEP): .dep/%.dpp: %.cpp
|
||||
@test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*)
|
||||
#@echo "regenerating dependencies for $*.cpp"
|
||||
@echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.cpp'"
|
||||
@$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \
|
||||
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
||||
.dep\/$(subst /,\/,$*).dpp : /g'\'' > $@; \
|
||||
@ -65,7 +65,7 @@ $(CPP_DEP): .dep/%.dpp: %.cpp
|
||||
|
||||
$(M_DEP): .dep/%.dm: %.m
|
||||
@test -d .dep/$(dir $*) || mkdir -p $(shell dirname .dep/$*)
|
||||
#@echo "regenerating dependencies for $*.m"
|
||||
@echo "make[$(MAKELEVEL)]: Generating dependencies for \`$*.m'"
|
||||
@$(SHELL) -ec '$(CC) -M $(CFLAGS) 2>/dev/null $< \
|
||||
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
|
||||
.dep\/$(subst /,\/,$*).dm : /g'\'' > $@; \
|
||||
|
@ -53,7 +53,7 @@ all:
|
||||
clean:
|
||||
# rm -f $(PLUGIN_ALL) $(BUILTIN_ALL)
|
||||
rm -f *.o *.o.* *.lo *.lo.* *.obj *.moc *.moc.* *.bak
|
||||
rm -rf .dep
|
||||
rm -Rf .dep
|
||||
|
||||
FORCE:
|
||||
|
||||
|
@ -167,8 +167,8 @@ CFLAGS += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_LARGEFILE64_SOURCE
|
||||
CFLAGS += -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
# Data and plugin location
|
||||
CFLAGS += -DDATA_PATH=\"@prefix@/share/videolan\"
|
||||
CFLAGS += -DPLUGIN_PATH=\"@prefix@/lib/videolan/vlc\"
|
||||
CFLAGS += -DDATA_PATH=\"@prefix@/share/vlc\"
|
||||
CFLAGS += -DPLUGIN_PATH=\"@prefix@/lib/vlc\"
|
||||
|
||||
###############################################################################
|
||||
# Tuning and other variables - do not change anything except if you know
|
||||
@ -183,13 +183,15 @@ CFLAGS += -Iinclude -Iextras
|
||||
#
|
||||
# C compiler flags: mainstream compilation
|
||||
#
|
||||
CFLAGS += -D_REENTRANT
|
||||
CFLAGS += -D_REENTRANT -D_THREAD_SAFE
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
|
||||
ifeq ($(RELEASE),1)
|
||||
CFLAGS += -DHAVE_RELEASE
|
||||
endif
|
||||
|
||||
CFLAGS += -D__VLC__
|
||||
|
||||
# Optimizations : don't compile debug versions with them
|
||||
ifeq ($(OPTIMS),1)
|
||||
CFLAGS += @CFLAGS_OPTIM@
|
||||
@ -241,9 +243,8 @@ endif
|
||||
#
|
||||
# C compiler flags: plugins and builtins compilation
|
||||
#
|
||||
vlc_CFLAGS += -D__VLC__
|
||||
plugins_CFLAGS += -D__VLC__ -D__PLUGIN__ -I../../include -I../../extras
|
||||
builtins_CFLAGS += -D__VLC__ -D__BUILTIN__ -I../../include -I../../extras
|
||||
plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras
|
||||
builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras
|
||||
|
||||
#
|
||||
# Linker flags: plugins and builtins linking
|
||||
|
96
bootstrap.sh
Executable file
96
bootstrap.sh
Executable file
@ -0,0 +1,96 @@
|
||||
#! /bin/sh
|
||||
|
||||
## bootstrap.sh file for vlc, the VideoLAN Client
|
||||
## $Id: bootstrap.sh,v 1.1 2002/06/01 12:31:57 sam Exp $
|
||||
##
|
||||
## Authors: Samuel Hocevar <sam@zoy.org>
|
||||
|
||||
##
|
||||
## autoconf && autoheader
|
||||
##
|
||||
echo -n "running the auto* tools: "
|
||||
autoconf || exit $?
|
||||
echo -n "autoconf "
|
||||
autoheader || exit $?
|
||||
echo "autoheader."
|
||||
|
||||
|
||||
##
|
||||
## headers which need to be regenerated because of the VLC_EXPORT macro
|
||||
##
|
||||
file=src/misc/modules_plugin.h
|
||||
echo -n "creating headers: "
|
||||
rm -f $file
|
||||
cp $file.in $file
|
||||
echo '#define STORE_SYMBOLS( p_symbols ) \' >> $file
|
||||
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
|
||||
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ (p_symbols)->\2_inner = \2; \\/' >> $file
|
||||
echo '' >> $file
|
||||
echo -n "$file "
|
||||
|
||||
file=include/vlc_symbols.h
|
||||
rm -f $file && touch $file
|
||||
echo '/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */' >> $file
|
||||
echo '' >> $file
|
||||
echo 'struct module_symbols_s' >> $file
|
||||
echo '{' >> $file
|
||||
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
|
||||
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/ \1 (* \2_inner) \3;/' >> $file
|
||||
echo '};' >> $file
|
||||
echo '' >> $file
|
||||
echo '#ifdef __PLUGIN__' >> $file
|
||||
cat include/*.h | grep '^ *VLC_EXPORT.*;' | \
|
||||
sed 's/VLC_EXPORT( *\([^,]*\), *\([^,]*\), *\(.*\));.*/# define \2 p_symbols->\2_inner/' >> $file
|
||||
echo '#endif /* __PLUGIN__ */' >> $file
|
||||
echo '' >> $file
|
||||
echo "$file."
|
||||
|
||||
|
||||
##
|
||||
## Glade sometimes sucks
|
||||
##
|
||||
echo -n "fixing glade bugs: "
|
||||
for file in gnome_interface.c gtk_interface.c
|
||||
do
|
||||
if grep -q "DO NOT EDIT THIS FILE" plugins/gtk/$file
|
||||
then
|
||||
rm -f /tmp/$$.$file.bak
|
||||
cat > /tmp/$$.$file.bak << EOF
|
||||
/* This file was created automatically by glade and fixed by bootstrap.sh */
|
||||
|
||||
#include <vlc/vlc.h>
|
||||
EOF
|
||||
tail +8 plugins/gtk/$file \
|
||||
| sed 's#DISABLED!!!_("/dev/dvd")#config_GetPsz( "dvd" )#' \
|
||||
| sed 's#DISABLED!!!11954#config_GetInt( "frequency" )#' \
|
||||
| sed 's#DISABLED!!!27500#config_GetInt( "symbol-rate" )#' \
|
||||
| sed 's#_("-:--:--")#"-:--:--"#' \
|
||||
| sed 's#_("---")#"---"#' \
|
||||
| sed 's#_("--")#"--"#' \
|
||||
| sed 's#_("/dev/dvd")#"/dev/dvd"#' \
|
||||
| sed 's#_(\("./."\))#\1#' \
|
||||
>> /tmp/$$.$file.bak
|
||||
mv -f /tmp/$$.$file.bak plugins/gtk/$file
|
||||
fi
|
||||
echo -n "$file "
|
||||
done
|
||||
|
||||
file=gtk_support.h
|
||||
if grep -q "DO NOT EDIT THIS FILE" plugins/gtk/$file
|
||||
then
|
||||
rm -f /tmp/$$.$file.bak
|
||||
sed 's/DO NOT EDIT THIS FILE.*/This file was created automatically by glade and fixed by bootstrap.sh/ ; s/#if.*ENABLE_NLS.*/#if defined( ENABLE_NLS ) \&\& defined ( HAVE_GETTEXT )/' < plugins/gtk/$file > /tmp/$$.$file.bak
|
||||
mv -f /tmp/$$.$file.bak plugins/gtk/$file
|
||||
fi
|
||||
echo "$file."
|
||||
|
||||
|
||||
##
|
||||
## Update the potfiles because no one ever does it
|
||||
##
|
||||
echo -n "updating potfiles: "
|
||||
cd po
|
||||
make update-po 2>&1 | grep '^[^:]*:$' | cut -f1 -d: | tr '\n' ' ' | sed 's/ $//'
|
||||
cd ..
|
||||
echo "."
|
||||
|
148
configure.in
148
configure.in
@ -3,16 +3,22 @@ AC_INIT(include/main.h)
|
||||
AC_CONFIG_HEADER(include/defs.h)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
CONFIGURE_LINE="$0 $*"
|
||||
|
||||
PACKAGE="vlc"
|
||||
VERSION="0.4.0"
|
||||
CODENAME=Ourumov
|
||||
|
||||
dnl Save CFLAGS and LDFLAGS
|
||||
save_CFLAGS="${CFLAGS}"
|
||||
dnl
|
||||
dnl Save *FLAGS
|
||||
dnl
|
||||
save_CPPFLAGS="${CPPFLAGS}"
|
||||
save_CFLAGS="${CFLAGS}"
|
||||
save_LDFLAGS="${LDFLAGS}"
|
||||
|
||||
dnl
|
||||
dnl Check for tools
|
||||
dnl
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
@ -21,7 +27,9 @@ dnl Find the right ranlib, even when cross-compiling
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
||||
AC_CHECK_TOOL(STRIP, strip, :)
|
||||
|
||||
dnl
|
||||
dnl Check for GNU make
|
||||
dnl
|
||||
AC_PATH_PROG(GMAKE, gmake, no)
|
||||
if test "x$GMAKE" = "xno"; then
|
||||
AC_CACHE_CHECK([whether GNU make is installed],
|
||||
@ -48,6 +56,11 @@ AM_GNU_GETTEXT
|
||||
dnl AM_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl
|
||||
dnl Set default LDFLAGS
|
||||
dnl
|
||||
vlc_LDFLAGS="${LDFLAGS}"
|
||||
|
||||
dnl
|
||||
dnl Check the operating system
|
||||
dnl
|
||||
@ -137,7 +150,7 @@ AC_CHECK_FUNC(inet_aton,,[
|
||||
AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
|
||||
])
|
||||
AC_CHECK_FUNC(textdomain,,[
|
||||
AC_CHECK_LIB(intl,textdomain,save_LDFLAGS="${save_LDFLAGS} -lintl")
|
||||
AC_CHECK_LIB(intl,textdomain,vlc_LDFLAGS="${vlc_LDFLAGS} -lintl")
|
||||
])
|
||||
|
||||
dnl Check for getopt
|
||||
@ -154,6 +167,7 @@ AC_CHECK_LIB(m,cos,
|
||||
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
|
||||
filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
|
||||
AC_CHECK_LIB(m,pow,
|
||||
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
|
||||
imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
|
||||
imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
|
||||
imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
|
||||
@ -183,12 +197,15 @@ dnl Check for misc headers
|
||||
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
|
||||
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
|
||||
Define if <pthread.h> defines pthread_cond_t.)])
|
||||
AC_EGREP_HEADER(pthread_once,pthread.h,[
|
||||
AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
|
||||
Define if <pthread.h> defines pthread_once.)])
|
||||
AC_EGREP_HEADER(strncasecmp,strings.h,[
|
||||
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
|
||||
Define if <strings.h> defines strncasecmp.)])
|
||||
|
||||
dnl Check for headers
|
||||
AC_CHECK_HEADERS(getopt.h strings.h)
|
||||
AC_CHECK_HEADERS(stdint.h getopt.h strings.h)
|
||||
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
|
||||
AC_CHECK_HEADERS(dlfcn.h image.h)
|
||||
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
|
||||
@ -254,17 +271,17 @@ fi
|
||||
dnl Check for -W or -w flags
|
||||
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
|
||||
[ac_cv_c_Wall_Winline],
|
||||
[CFLAGS="${save_CFLAGS} -Wall -Winline"
|
||||
[CFLAGS="-Wall -Winline ${save_CFLAGS}"
|
||||
AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
|
||||
if test x"$ac_cv_c_Wall_Winline" != x"no"; then
|
||||
save_CFLAGS="${save_CFLAGS} -Wall -Winline"
|
||||
save_CFLAGS="-Wall -Winline ${save_CFLAGS}"
|
||||
else
|
||||
AC_CACHE_CHECK([if \$CC accepts -wall -winline],
|
||||
[ac_cv_c_wall_winline],
|
||||
[CFLAGS="${save_CFLAGS} -wall -winline"
|
||||
[CFLAGS="-wall -winline ${save_CFLAGS}"
|
||||
AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
|
||||
if test x"$ac_cv_c_wall_winline" != x"no"; then
|
||||
save_CFLAGS="${save_CFLAGS} -wall -winline"
|
||||
save_CFLAGS="-wall -winline ${save_CFLAGS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -376,36 +393,6 @@ if test x"$ac_cv_c_attribute_aligned" != x"0"; then
|
||||
[$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
|
||||
fi
|
||||
|
||||
dnl End of the bizarre compilation tests
|
||||
CFLAGS="${save_CFLAGS}"
|
||||
CPPFLAGS="${save_CPPFLAGS}"
|
||||
LDFLAGS="${save_LDFLAGS}"
|
||||
|
||||
dnl Check for boolean_t
|
||||
AC_CACHE_CHECK([for boolean_t in sys/types.h],
|
||||
[ac_cv_c_boolean_t_sys_types_h],
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
|
||||
ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
|
||||
if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
|
||||
AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for boolean_t in pthread.h],
|
||||
[ac_cv_c_boolean_t_pthread_h],
|
||||
[AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
|
||||
ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
|
||||
if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
|
||||
AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for boolean_t in cthreads.h],
|
||||
[ac_cv_c_boolean_t_cthreads_h],
|
||||
[AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
|
||||
ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
|
||||
if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
|
||||
AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
|
||||
fi
|
||||
|
||||
dnl
|
||||
dnl Check the CPU
|
||||
dnl
|
||||
@ -421,8 +408,8 @@ esac
|
||||
dnl
|
||||
dnl default modules
|
||||
dnl
|
||||
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
|
||||
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
|
||||
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix mpeg_adec ac3_adec mpeg_vdec"
|
||||
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_audio mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga"
|
||||
|
||||
dnl
|
||||
dnl Accelerated modules
|
||||
@ -435,7 +422,8 @@ ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
|
||||
|
||||
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
|
||||
[ac_cv_mmx_inline],
|
||||
[AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
|
||||
[CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
|
||||
ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
|
||||
if test x"$ac_cv_mmx_inline" != x"no"; then
|
||||
ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
|
||||
@ -443,7 +431,8 @@ fi
|
||||
|
||||
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
|
||||
[ac_cv_mmxext_inline],
|
||||
[AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
|
||||
[CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
|
||||
ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
|
||||
if test x"$ac_cv_mmxext_inline" != x"no"; then
|
||||
ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
|
||||
@ -451,7 +440,8 @@ fi
|
||||
|
||||
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
|
||||
[ac_cv_3dnow_inline],
|
||||
[AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
|
||||
[CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
|
||||
ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
|
||||
if test x"$ac_cv_3dnow_inline" != x"no"; then
|
||||
AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
|
||||
@ -460,29 +450,29 @@ fi
|
||||
|
||||
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
|
||||
[ac_cv_sse_inline],
|
||||
[AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
|
||||
[CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
|
||||
ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
|
||||
if test x"$ac_cv_sse_inline" != x"no" -a x$SYS != xmingw32; then
|
||||
AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
|
||||
ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
|
||||
fi
|
||||
|
||||
# don't try to grok altivec with native mingw32 it doesn't work right now
|
||||
# don't try to grok AltiVec with native mingw32 it doesn't work right now
|
||||
# we should be able to remove this test with future versions of mingw32
|
||||
if test x$SYS != xmingw32; then
|
||||
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
|
||||
AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
|
||||
[ac_cv_altivec_inline],
|
||||
[AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
|
||||
[CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
|
||||
ac_cv_altivec_inline=yes,
|
||||
[save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -Wa,-m7400"
|
||||
[CFLAGS="$save_CFLAGS -Wa,-m7400"
|
||||
AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
|
||||
[ac_cv_altivec_inline="-Wa,-m7400"],
|
||||
ac_cv_altivec_inline=no)
|
||||
CFLAGS=$save_CFLAGS
|
||||
])])
|
||||
if test x"$ac_cv_altivec_inline" != x"no"; then
|
||||
AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
|
||||
AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
|
||||
if test x"$ac_cv_altivec_inline" != x"yes"; then
|
||||
idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_altivec_inline"
|
||||
motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_altivec_inline"
|
||||
@ -492,10 +482,9 @@ if test x"$ac_cv_altivec_inline" != x"no"; then
|
||||
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
|
||||
AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
|
||||
[ac_cv_c_altivec],
|
||||
[save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -faltivec"
|
||||
[CFLAGS="$save_CFLAGS -faltivec"
|
||||
# Darwin test
|
||||
AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
|
||||
ac_cv_c_altivec=-faltivec, [
|
||||
@ -504,10 +493,9 @@ AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
|
||||
AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
|
||||
[ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
|
||||
])
|
||||
CFLAGS=$save_CFLAGS
|
||||
])
|
||||
if test x"$ac_cv_c_altivec" != x"no"; then
|
||||
AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
|
||||
AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
|
||||
idctaltivec_CFLAGS="$idctaltivec_CFLAGS $ac_cv_c_altivec"
|
||||
motionaltivec_CFLAGS="$motionaltivec_CFLAGS $ac_cv_c_altivec"
|
||||
memcpyaltivec_CFLAGS="$memcpyaltivec_CFLAGS $ac_cv_c_altivec"
|
||||
@ -517,10 +505,8 @@ fi
|
||||
|
||||
AC_CACHE_CHECK([if linker needs -framework vecLib],
|
||||
[ac_cv_ld_altivec],
|
||||
[save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -framework vecLib"
|
||||
[LDFLAGS="$vlc_LDFLAGS -framework vecLib"
|
||||
AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
])
|
||||
if test x"$ac_cv_ld_altivec" != x"no"; then
|
||||
idctaltivec_LDFLAGS="${idctaltivec_LDFLAGS} -framework vecLib"
|
||||
@ -555,7 +541,7 @@ dnl
|
||||
if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
|
||||
then
|
||||
ARCH="${ARCH} mmx"
|
||||
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
|
||||
PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
|
||||
fi
|
||||
|
||||
dnl
|
||||
@ -570,7 +556,7 @@ dnl
|
||||
dnl AltiVec acceleration
|
||||
dnl
|
||||
AC_ARG_ENABLE(altivec,
|
||||
[ --disable-altivec disable altivec optimizations (default enabled on PPC)],
|
||||
[ --disable-altivec disable AltiVec optimizations (default enabled on PPC)],
|
||||
[ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
|
||||
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
|
||||
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
|
||||
@ -685,6 +671,7 @@ then
|
||||
fi
|
||||
CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
|
||||
AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
|
||||
CFLAGS="${save_CFLAGS}"
|
||||
AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
|
||||
[void foo() { int i=DVD_VIDEO_LB_LEN; }],[
|
||||
PLUGINS="${PLUGINS} dvdread"
|
||||
@ -785,6 +772,7 @@ dnl ipv6 plugin - not for QNX yet
|
||||
dnl
|
||||
if test x$SYS != xnto && test "x$SYS" != "xmingw32"
|
||||
then
|
||||
CFLAGS="$save_CFLAGS"
|
||||
AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
|
||||
fi
|
||||
if test "x$SYS" = "xmingw32"
|
||||
@ -856,18 +844,14 @@ then
|
||||
AC_MSG_ERROR([the specified tree doesn't have mad.h])
|
||||
fi
|
||||
else
|
||||
save_CFLAGS=$CFLAGS
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
CFLAGS="$CFLAGS $mad_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $mad_LDFLAGS"
|
||||
CFLAGS="$vlc_CFLAGS $mad_CFLAGS"
|
||||
LDFLAGS="$vlc_LDFLAGS $mad_LDFLAGS"
|
||||
AC_CHECK_HEADERS(mad.h, ,
|
||||
[ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
|
||||
AC_CHECK_LIB(mad, mad_bit_init, [
|
||||
PLUGINS="${PLUGINS} mad"
|
||||
mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
|
||||
[ AC_MSG_ERROR([Cannot find libmad library...]) ])
|
||||
CFLAGS=$save_CFLAGS
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1043,11 +1027,9 @@ if test x$enable_xvideo != xno &&
|
||||
if test x$x_libraries = xNONE; then
|
||||
x_libraries=/usr/X11R6/lib
|
||||
fi
|
||||
save_CPPFLAGS=$CPPFLAGS
|
||||
CPPFLAGS="$save_CPPFLAGS -I$x_includes"
|
||||
AC_CHECK_HEADERS(X11/extensions/Xv.h, [
|
||||
save_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
|
||||
CFLAGS="$save_CFLAGS -L$x_libraries -lX11 -lXext"
|
||||
AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
|
||||
# We have Xv_pic, that's good, we can build an xvideo.so plugin !
|
||||
PLUGINS="${PLUGINS} xvideo"
|
||||
@ -1057,7 +1039,6 @@ if test x$enable_xvideo != xno &&
|
||||
BUILTINS="${BUILTINS} xvideo"
|
||||
xvideo_LDFLAGS="${xvideo_LDFLAGS} -L$x_libraries -lX11 -lXext -lXv"
|
||||
xvideo_CFLAGS="${xvideo_CFLAGS} -I$x_includes")
|
||||
CFLAGS="$save_CFLAGS"
|
||||
]
|
||||
CPPFLAGS="$save_CPPFLAGS")
|
||||
fi
|
||||
@ -1548,18 +1529,26 @@ fi
|
||||
dnl
|
||||
dnl Profiling
|
||||
dnl
|
||||
PROFILING=0
|
||||
|
||||
GPROF=0
|
||||
AC_ARG_ENABLE(gprof,
|
||||
[ --enable-gprof gprof profiling (default disabled)],
|
||||
[ if test "x$enable_gprof" = "xyes"; then GPROF=1; fi ])
|
||||
[ if test "x$enable_gprof" = "xyes"
|
||||
then
|
||||
GPROF=1
|
||||
PROFILING="gprof"
|
||||
fi
|
||||
])
|
||||
|
||||
CPROF=0
|
||||
AC_ARG_ENABLE(cprof,
|
||||
[ --enable-cprof cprof profiling (default disabled)],
|
||||
[ if test "x$enable_cprof" = "xyes";
|
||||
[ if test "x$enable_cprof" = "xyes"
|
||||
then
|
||||
LDFLAGS="${LDFLAGS} -lcprof"
|
||||
CPROF=1
|
||||
PROFILING="cprof"
|
||||
fi
|
||||
])
|
||||
|
||||
@ -1591,7 +1580,8 @@ AC_ARG_ENABLE(st,
|
||||
fi])
|
||||
])
|
||||
|
||||
LDFLAGS="${LDFLAGS} ${THREAD_LIB}"
|
||||
vlc_LDFLAGS="${vlc_LDFLAGS} ${THREAD_LIB}"
|
||||
plugins_LDFLAGS="${plugins_LDFLAGS} ${THREAD_LIB}"
|
||||
|
||||
dnl
|
||||
dnl Plug-ins - this must be AT THE END
|
||||
@ -1619,6 +1609,7 @@ dnl Stuff used by the program
|
||||
dnl
|
||||
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VERSION $CODENAME Copyright 1996-2002 VideoLAN", [Simple version string])
|
||||
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VERSION $CODENAME - (c) 1996-2002 VideoLAN", [Copyright string])
|
||||
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "$CONFIGURE_LINE", [The ./configure command line])
|
||||
|
||||
VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
|
||||
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL", [String suffix for module functions])
|
||||
@ -1629,6 +1620,13 @@ AC_SUBST(DATA_PATH)
|
||||
PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
|
||||
AC_SUBST(PLUGIN_PATH)
|
||||
|
||||
dnl
|
||||
dnl Restore *FLAGS
|
||||
dnl
|
||||
CPPFLAGS="${save_CPPFLAGS}"
|
||||
CFLAGS="${save_CFLAGS}"
|
||||
LDFLAGS="${save_LDFLAGS}"
|
||||
|
||||
dnl
|
||||
dnl Configuration is finished
|
||||
dnl
|
||||
@ -1739,7 +1737,7 @@ optimizations : ${OPTIMS}
|
||||
tuning : ${TUNING}
|
||||
debug mode : ${DEBUG}
|
||||
release : ${RELEASE}
|
||||
cprof/gprof support : ${CPROF}/${GPROF}
|
||||
profiling : ${PROFILING}
|
||||
need builtin getopt : ${NEED_GETOPT}
|
||||
built-in modules :${BUILTINS}
|
||||
plug-in modules :${PLUGINS}
|
||||
|
6
debian/rules
vendored
6
debian/rules
vendored
@ -13,7 +13,7 @@ export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk
|
||||
# Remove --without-dvdcss here in non-totalitarian countries
|
||||
export DVDCSS_FLAGS="--enable-dvd --without-dvdcss"
|
||||
|
||||
export VIDDIR="usr/share/videolan"
|
||||
export VIDDIR="usr/share/vlc"
|
||||
export PIXDIR="usr/share/pixmaps"
|
||||
export GNOMEDIR="usr/share/gnome/apps/Multimedia"
|
||||
|
||||
@ -61,8 +61,8 @@ install: build
|
||||
esac ;\
|
||||
for alias in $$ARCH_ALIASES ; do \
|
||||
ln -s vlc debian/vlc-$$alias/usr/share/doc/vlc-$$alias ; \
|
||||
mv debian/vlc/usr/lib/videolan/vlc/$$alias.so \
|
||||
debian/vlc-$$alias/usr/lib/videolan/vlc/ ; done
|
||||
mv debian/vlc/usr/lib/vlc/$$alias.so \
|
||||
debian/vlc-$$alias/usr/lib/vlc/ ; done
|
||||
|
||||
mv debian/vlc/usr/bin/gvlc debian/vlc-gtk/usr/bin/
|
||||
mv debian/vlc/usr/bin/gnome-vlc debian/vlc-gnome/usr/bin/
|
||||
|
2
debian/vlc-aa.dirs
vendored
2
debian/vlc-aa.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-alsa.dirs
vendored
2
debian/vlc-alsa.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-arts.dirs
vendored
2
debian/vlc-arts.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-esd.dirs
vendored
2
debian/vlc-esd.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-ggi.dirs
vendored
2
debian/vlc-ggi.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-glide.dirs
vendored
2
debian/vlc-glide.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
4
debian/vlc-gnome.dirs
vendored
4
debian/vlc-gnome.dirs
vendored
@ -1,7 +1,7 @@
|
||||
usr/bin
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
usr/share/gnome/apps/Multimedia
|
||||
usr/share/man/man1
|
||||
usr/share/pixmaps
|
||||
usr/share/videolan
|
||||
usr/share/vlc
|
||||
|
2
debian/vlc-gnome.menu
vendored
2
debian/vlc-gnome.menu
vendored
@ -1,3 +1,3 @@
|
||||
?package(vlc-gnome):command="/usr/bin/gnome-vlc" hotkey="V" needs="X11" \
|
||||
section="Apps/Viewers" title="Gnome VideoLAN Client" \
|
||||
icon="/usr/share/videolan/gnome-vlc.xpm" hints="Video"
|
||||
icon="/usr/share/vlc/gnome-vlc.xpm" hints="Video"
|
||||
|
4
debian/vlc-gtk.dirs
vendored
4
debian/vlc-gtk.dirs
vendored
@ -1,7 +1,7 @@
|
||||
usr/bin
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
usr/share/gnome/apps/Multimedia
|
||||
usr/share/man/man1
|
||||
usr/share/pixmaps
|
||||
usr/share/videolan
|
||||
usr/share/vlc
|
||||
|
2
debian/vlc-gtk.menu
vendored
2
debian/vlc-gtk.menu
vendored
@ -1,3 +1,3 @@
|
||||
?package(vlc-gtk):command="/usr/bin/gvlc" hotkey="V" needs="X11" \
|
||||
section="Apps/Viewers" title="Gtk+ VideoLAN Client" \
|
||||
icon="/usr/share/videolan/gvlc.xpm" hints="Video"
|
||||
icon="/usr/share/vlc/gvlc.xpm" hints="Video"
|
||||
|
4
debian/vlc-kde.dirs
vendored
4
debian/vlc-kde.dirs
vendored
@ -1,6 +1,6 @@
|
||||
usr/bin
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
usr/share/man/man1
|
||||
usr/share/pixmaps
|
||||
usr/share/videolan
|
||||
usr/share/vlc
|
||||
|
2
debian/vlc-kde.menu
vendored
2
debian/vlc-kde.menu
vendored
@ -1,3 +1,3 @@
|
||||
?package(vlc-kde):command="/usr/bin/kvlc" hotkey="V" needs="X11" \
|
||||
section="Apps/Viewers" title="KDE VideoLAN Client" \
|
||||
icon="/usr/share/videolan/kvlc.xpm" hints="Video"
|
||||
icon="/usr/share/vlc/kvlc.xpm" hints="Video"
|
||||
|
2
debian/vlc-lirc.dirs
vendored
2
debian/vlc-lirc.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
2
debian/vlc-mad.dirs
vendored
2
debian/vlc-mad.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
4
debian/vlc-qt.dirs
vendored
4
debian/vlc-qt.dirs
vendored
@ -1,6 +1,6 @@
|
||||
usr/bin
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
usr/share/man/man1
|
||||
usr/share/pixmaps
|
||||
usr/share/videolan
|
||||
usr/share/vlc
|
||||
|
2
debian/vlc-qt.menu
vendored
2
debian/vlc-qt.menu
vendored
@ -1,3 +1,3 @@
|
||||
?package(vlc-qt):command="/usr/bin/qvlc" hotkey="V" needs="X11" \
|
||||
section="Apps/Viewers" title="Qt VideoLAN Client" \
|
||||
icon="/usr/share/videolan/qvlc.xpm" hints="Video"
|
||||
icon="/usr/share/vlc/qvlc.xpm" hints="Video"
|
||||
|
2
debian/vlc-sdl.dirs
vendored
2
debian/vlc-sdl.dirs
vendored
@ -1,2 +1,2 @@
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc
|
||||
|
4
debian/vlc.dirs
vendored
4
debian/vlc.dirs
vendored
@ -1,7 +1,7 @@
|
||||
usr/bin
|
||||
usr/lib/videolan/vlc
|
||||
usr/lib/vlc
|
||||
usr/share/doc/vlc
|
||||
usr/share/gnome/apps/Multimedia
|
||||
usr/share/pixmaps
|
||||
usr/share/videolan
|
||||
usr/share/vlc
|
||||
usr/share/man/man1
|
||||
|
2
debian/vlc.menu
vendored
2
debian/vlc.menu
vendored
@ -1,3 +1,3 @@
|
||||
?package(vlc):command="/usr/bin/vlc" hotkey="V" needs="X11" \
|
||||
section="Apps/Viewers" title="VideoLAN Client" \
|
||||
icon="/usr/share/videolan/vlc.xpm" hints="Video"
|
||||
icon="/usr/share/vlc/vlc.xpm" hints="Video"
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_downmix.h : AC3 downmix types
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: ac3_downmix.h,v 1.3 2001/05/15 16:19:42 sam Exp $
|
||||
* $Id: ac3_downmix.h,v 1.4 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Renaud Dartus <reno@videolan.org>
|
||||
@ -22,15 +22,15 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct dm_par_s {
|
||||
struct dm_par_s {
|
||||
float unit;
|
||||
float clev;
|
||||
float slev;
|
||||
} dm_par_t;
|
||||
};
|
||||
|
||||
typedef struct downmix_s {
|
||||
struct downmix_s {
|
||||
/* Module used and shortcuts */
|
||||
struct module_s * p_module;
|
||||
module_t * p_module;
|
||||
void (*pf_downmix_3f_2r_to_2ch)(float *, dm_par_t * dm_par);
|
||||
void (*pf_downmix_3f_1r_to_2ch)(float *, dm_par_t * dm_par);
|
||||
void (*pf_downmix_2f_2r_to_2ch)(float *, dm_par_t * dm_par);
|
||||
@ -38,5 +38,5 @@ typedef struct downmix_s {
|
||||
void (*pf_downmix_3f_0r_to_2ch)(float *, dm_par_t * dm_par);
|
||||
void (*pf_stream_sample_2ch_to_s16)(s16 *, float *left, float *right);
|
||||
void (*pf_stream_sample_1ch_to_s16)(s16 *, float *center);
|
||||
} downmix_t;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_imdct.h : AC3 IMDCT types
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: ac3_imdct.h,v 1.7 2002/04/05 01:05:22 gbazin Exp $
|
||||
* $Id: ac3_imdct.h,v 1.8 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Renaud Dartus <reno@videolan.org>
|
||||
@ -22,14 +22,14 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct complex_s {
|
||||
struct complex_s {
|
||||
float real;
|
||||
float imag;
|
||||
} complex_t;
|
||||
};
|
||||
|
||||
#define N 512
|
||||
|
||||
typedef struct imdct_s
|
||||
struct imdct_s
|
||||
{
|
||||
complex_t * buf;
|
||||
void * buf_orig; /* pointer before memalign */
|
||||
@ -69,13 +69,12 @@ typedef struct imdct_s
|
||||
void * w_1_orig; /* pointer before memalign */
|
||||
|
||||
/* Module used and shortcuts */
|
||||
struct module_s * p_module;
|
||||
void (*pf_imdct_init) (struct imdct_s *);
|
||||
module_t * p_module;
|
||||
void (*pf_imdct_init) ( imdct_t * );
|
||||
//void (*pf_fft_64p) (complex_t *a);
|
||||
void (*pf_imdct_256)(struct imdct_s *, float data[], float delay[]);
|
||||
void (*pf_imdct_256_nol)(struct imdct_s *, float data[], float delay[]);
|
||||
void (*pf_imdct_512)(struct imdct_s *, float data[], float delay[]);
|
||||
void (*pf_imdct_512_nol)(struct imdct_s *, float data[], float delay[]);
|
||||
|
||||
} imdct_t;
|
||||
void (*pf_imdct_256) ( imdct_t *, float [], float [] );
|
||||
void (*pf_imdct_256_nol) ( imdct_t *, float [], float [] );
|
||||
void (*pf_imdct_512) ( imdct_t *, float [], float [] );
|
||||
void (*pf_imdct_512_nol) ( imdct_t *, float [], float [] );
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* audio_output.h : audio output thread interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: audio_output.h,v 1.46 2002/04/24 00:36:24 sam Exp $
|
||||
* $Id: audio_output.h,v 1.47 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Cyril Deguet <asmax@via.ecp.fr>
|
||||
@ -22,27 +22,6 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_bank_t, p_aout_bank (global variable)
|
||||
*****************************************************************************
|
||||
* This global variable is accessed by any function using the audio output.
|
||||
*****************************************************************************/
|
||||
typedef struct aout_bank_s
|
||||
{
|
||||
/* Array to all the audio outputs */
|
||||
struct aout_thread_s *pp_aout[ AOUT_MAX_THREADS ];
|
||||
|
||||
int i_count;
|
||||
vlc_mutex_t lock; /* Global lock */
|
||||
|
||||
} aout_bank_t;
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
extern aout_bank_t *p_aout_bank;
|
||||
#else
|
||||
# define p_aout_bank (p_symbols->p_aout_bank)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_increment_t
|
||||
*****************************************************************************
|
||||
@ -72,7 +51,7 @@ typedef struct aout_increment_s
|
||||
/*****************************************************************************
|
||||
* aout_fifo_t
|
||||
*****************************************************************************/
|
||||
typedef struct aout_fifo_s
|
||||
struct aout_fifo_s
|
||||
{
|
||||
/* See the fifo formats below */
|
||||
int i_format;
|
||||
@ -80,7 +59,7 @@ typedef struct aout_fifo_s
|
||||
int i_rate;
|
||||
int i_frame_size;
|
||||
|
||||
boolean_t b_die;
|
||||
vlc_bool_t b_die;
|
||||
int i_fifo; /* Just to keep track of the fifo index */
|
||||
|
||||
vlc_mutex_t data_lock;
|
||||
@ -93,11 +72,11 @@ typedef struct aout_fifo_s
|
||||
* audio data. It it also the first frame in the current timestamped frame
|
||||
* area, ie the first dated frame in the decoded part of the buffer. :-p */
|
||||
int i_start_frame;
|
||||
boolean_t b_start_frame;
|
||||
vlc_bool_t b_start_frame;
|
||||
/* The next frame is the end frame of the current timestamped frame area,
|
||||
* ie the first dated frame after the start frame. */
|
||||
int i_next_frame;
|
||||
boolean_t b_next_frame;
|
||||
vlc_bool_t b_next_frame;
|
||||
/* The end frame is the first frame, after the start frame, that doesn't
|
||||
* contain decoded audio data. That's why the end frame is the first frame
|
||||
* where the audio decoder can store its decoded audio frames. */
|
||||
@ -113,8 +92,7 @@ typedef struct aout_fifo_s
|
||||
/* The following variable is used to store the number of remaining audio
|
||||
* units in the current timestamped frame area. */
|
||||
int i_units;
|
||||
|
||||
} aout_fifo_t;
|
||||
};
|
||||
|
||||
#define AOUT_FIFO_ISEMPTY( fifo ) \
|
||||
( (fifo).i_end_frame == (fifo).i_start_frame )
|
||||
@ -133,22 +111,20 @@ typedef struct aout_fifo_s
|
||||
/*****************************************************************************
|
||||
* aout_thread_t : audio output thread descriptor
|
||||
*****************************************************************************/
|
||||
typedef struct aout_thread_s
|
||||
struct aout_thread_s
|
||||
{
|
||||
vlc_thread_t thread_id;
|
||||
boolean_t b_die;
|
||||
boolean_t b_active;
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
vlc_mutex_t fifos_lock;
|
||||
aout_fifo_t fifo[ AOUT_MAX_FIFOS ];
|
||||
|
||||
/* Plugin used and shortcuts to access its capabilities */
|
||||
struct module_s * p_module;
|
||||
int ( *pf_open ) ( p_aout_thread_t );
|
||||
int ( *pf_setformat ) ( p_aout_thread_t );
|
||||
int ( *pf_getbufinfo ) ( p_aout_thread_t, int );
|
||||
void ( *pf_play ) ( p_aout_thread_t, byte_t *, int );
|
||||
void ( *pf_close ) ( p_aout_thread_t );
|
||||
module_t * p_module;
|
||||
int ( *pf_open ) ( aout_thread_t * );
|
||||
int ( *pf_setformat ) ( aout_thread_t * );
|
||||
int ( *pf_getbufinfo ) ( aout_thread_t * , int );
|
||||
void ( *pf_play ) ( aout_thread_t * , byte_t *, int );
|
||||
void ( *pf_close ) ( aout_thread_t * );
|
||||
|
||||
void * buffer;
|
||||
/* The s32 buffer is used to mix all the audio fifos together before
|
||||
@ -178,9 +154,8 @@ typedef struct aout_thread_s
|
||||
|
||||
/* there might be some useful private structure, such as audio_buf_info
|
||||
* for the OSS output */
|
||||
p_aout_sys_t p_sys;
|
||||
|
||||
} aout_thread_t;
|
||||
aout_sys_t * p_sys;
|
||||
};
|
||||
|
||||
/* Those are from <linux/soundcard.h> but are needed because of formats
|
||||
* on other platforms */
|
||||
@ -207,18 +182,10 @@ typedef struct aout_thread_s
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void aout_InitBank ( void );
|
||||
void aout_EndBank ( void );
|
||||
aout_thread_t * aout_CreateThread ( vlc_object_t *, int, int );
|
||||
void aout_DestroyThread ( aout_thread_t * );
|
||||
|
||||
aout_thread_t * aout_CreateThread ( int *, int, int );
|
||||
void aout_DestroyThread ( aout_thread_t *, int * );
|
||||
|
||||
aout_fifo_t * aout_CreateFifo ( int, int, int, int, void * );
|
||||
void aout_DestroyFifo ( aout_fifo_t *p_fifo );
|
||||
VLC_EXPORT( aout_fifo_t *, aout_CreateFifo, ( vlc_object_t *, int, int, int, int, void * ) );
|
||||
VLC_EXPORT( void, aout_DestroyFifo, ( aout_fifo_t *p_fifo ) );
|
||||
void aout_FreeFifo ( aout_fifo_t *p_fifo );
|
||||
#else
|
||||
# define aout_CreateFifo p_symbols->aout_CreateFifo
|
||||
# define aout_DestroyFifo p_symbols->aout_DestroyFifo
|
||||
#endif
|
||||
|
||||
|
@ -51,9 +51,9 @@
|
||||
#ifdef SYS_BEOS
|
||||
# define CONFIG_DIR "config/settings"
|
||||
#elif defined( WIN32 )
|
||||
# define CONFIG_DIR "videolan"
|
||||
# define CONFIG_DIR "vlc"
|
||||
#else
|
||||
# define CONFIG_DIR ".videolan"
|
||||
# define CONFIG_DIR ".vlc"
|
||||
#endif
|
||||
#define CONFIG_FILE "vlcrc"
|
||||
|
||||
@ -266,4 +266,4 @@
|
||||
|
||||
/* Maximal size of the message queue - in case of overflow, all messages in the
|
||||
* queue are printed, but not sent to the threads */
|
||||
#define INTF_MSG_QSIZE 256
|
||||
#define VLC_MSG_QSIZE 256
|
||||
|
@ -4,7 +4,7 @@
|
||||
* It includes functions allowing to declare, get or set configuration options.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: configuration.h,v 1.11 2002/05/30 08:17:04 gbazin Exp $
|
||||
* $Id: configuration.h,v 1.12 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
#define MODULE_CONFIG_ITEM 0x00F0
|
||||
|
||||
typedef struct module_config_s
|
||||
struct module_config_s
|
||||
{
|
||||
int i_type; /* Configuration type */
|
||||
char *psz_name; /* Option name */
|
||||
@ -55,49 +55,43 @@ typedef struct module_config_s
|
||||
char *psz_value; /* Option value */
|
||||
int i_value; /* Option value */
|
||||
float f_value; /* Option value */
|
||||
void *p_callback; /* Function to call when commiting a change */
|
||||
vlc_mutex_t *p_lock; /* lock to use when modifying the config */
|
||||
boolean_t b_dirty; /* Dirty flag to indicate a config change */
|
||||
|
||||
} module_config_t;
|
||||
/* Function to call when commiting a change */
|
||||
void ( * pf_callback ) ( vlc_object_t * );
|
||||
|
||||
vlc_mutex_t *p_lock; /* lock to use when modifying the config */
|
||||
vlc_bool_t b_dirty; /* Dirty flag to indicate a config change */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes - these methods are used to get, set or manipulate configuration
|
||||
* data.
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
int config_GetIntVariable( const char *psz_name );
|
||||
float config_GetFloatVariable( const char *psz_name );
|
||||
char * config_GetPszVariable( const char *psz_name );
|
||||
void config_PutIntVariable( const char *psz_name, int i_value );
|
||||
void config_PutFloatVariable( const char *psz_name, float f_value );
|
||||
void config_PutPszVariable( const char *psz_name, char *psz_value );
|
||||
VLC_EXPORT( int, __config_GetInt, (vlc_object_t *, const char *) );
|
||||
VLC_EXPORT( void, __config_PutInt, (vlc_object_t *, const char *, int) );
|
||||
VLC_EXPORT( float, __config_GetFloat, (vlc_object_t *, const char *) );
|
||||
VLC_EXPORT( void, __config_PutFloat, (vlc_object_t *, const char *, float) );
|
||||
VLC_EXPORT( char *, __config_GetPsz, (vlc_object_t *, const char *) );
|
||||
VLC_EXPORT( void, __config_PutPsz, (vlc_object_t *, const char *, char *) );
|
||||
|
||||
int config_LoadConfigFile( const char *psz_module_name );
|
||||
int config_SaveConfigFile( const char *psz_module_name );
|
||||
char * config_GetHomeDir( void );
|
||||
int config_LoadCmdLine( int *pi_argc, char *ppsz_argv[],
|
||||
boolean_t b_ignore_errors );
|
||||
VLC_EXPORT( int, config_LoadCmdLine, ( vlc_object_t *, int *, char *[], vlc_bool_t ) );
|
||||
VLC_EXPORT( char *, config_GetHomeDir, ( void ) );
|
||||
VLC_EXPORT( int, config_LoadConfigFile, ( vlc_object_t *, const char * ) );
|
||||
VLC_EXPORT( int, config_SaveConfigFile, ( vlc_object_t *, const char * ) );
|
||||
VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char *psz_name ) );
|
||||
|
||||
module_config_t *config_Duplicate ( module_config_t * );
|
||||
module_config_t *config_FindConfig ( const char * );
|
||||
void config_SetCallbacks ( module_config_t *, module_config_t * );
|
||||
void config_UnsetCallbacks( module_config_t * );
|
||||
VLC_EXPORT( void, config_Duplicate, ( module_t *, module_config_t * ) );
|
||||
void config_Free ( module_t * );
|
||||
|
||||
#else
|
||||
# define config_GetIntVariable p_symbols->config_GetIntVariable
|
||||
# define config_PutIntVariable p_symbols->config_PutIntVariable
|
||||
# define config_GetFloatVariable p_symbols->config_GetFloatVariable
|
||||
# define config_PutFloatVariable p_symbols->config_PutFloatVariable
|
||||
# define config_GetPszVariable p_symbols->config_GetPszVariable
|
||||
# define config_PutPszVariable p_symbols->config_PutPszVariable
|
||||
# define config_LoadConfigFile p_symbols->config_LoadConfigFile
|
||||
# define config_SaveConfigFile p_symbols->config_SaveConfigFile
|
||||
# define config_Duplicate p_symbols->config_Duplicate
|
||||
# define config_FindConfig p_symbols->config_FindConfig
|
||||
# define config_SetCallbacks p_symbols->config_SetCallbacks
|
||||
# define config_UnsetCallbacks p_symbols->config_UnsetCallbacks
|
||||
#endif
|
||||
VLC_EXPORT( void, config_SetCallbacks, ( module_config_t *, module_config_t * ) );
|
||||
VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
|
||||
|
||||
#define config_GetInt(a,b) __config_GetInt(CAST_TO_VLC_OBJECT(a),b)
|
||||
#define config_PutInt(a,b,c) __config_PutInt(CAST_TO_VLC_OBJECT(a),b,c)
|
||||
#define config_GetFloat(a,b) __config_GetFloat(CAST_TO_VLC_OBJECT(a),b)
|
||||
#define config_PutFloat(a,b,c) __config_PutFloat(CAST_TO_VLC_OBJECT(a),b,c)
|
||||
#define config_GetPsz(a,b) __config_GetPsz(CAST_TO_VLC_OBJECT(a),b)
|
||||
#define config_PutPsz(a,b,c) __config_PutPsz(CAST_TO_VLC_OBJECT(a),b,c)
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros used to build the configuration structure.
|
||||
|
@ -268,6 +268,9 @@
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
@ -344,6 +347,9 @@
|
||||
/* Define if <pthread.h> defines pthread_cond_t. */
|
||||
#undef PTHREAD_COND_T_IN_PTHREAD_H
|
||||
|
||||
/* Define if <pthread.h> defines pthread_once. */
|
||||
#undef PTHREAD_ONCE_IN_PTHREAD_H
|
||||
|
||||
/* Define if <strings.h> defines strncasecmp. */
|
||||
#undef STRNCASECMP_IN_STRINGS_H
|
||||
|
||||
@ -365,25 +371,16 @@
|
||||
/* Maximum supported data alignment */
|
||||
#undef ATTRIBUTE_ALIGNED_MAX
|
||||
|
||||
/* Define if <sys/types.h> defines boolean_t. */
|
||||
#undef BOOLEAN_T_IN_SYS_TYPES_H
|
||||
|
||||
/* Define if <pthread.h> defines boolean_t. */
|
||||
#undef BOOLEAN_T_IN_PTHREAD_H
|
||||
|
||||
/* Define if <cthreads.h> defines boolean_t. */
|
||||
#undef BOOLEAN_T_IN_CTHREADS_H
|
||||
|
||||
/* Define if $CC groks 3D Now! inline assembly. */
|
||||
#undef CAN_COMPILE_3DNOW
|
||||
|
||||
/* Define if $CC groks SSE inline assembly. */
|
||||
#undef CAN_COMPILE_SSE
|
||||
|
||||
/* Define if $CC groks ALTIVEC inline assembly. */
|
||||
/* Define if $CC groks AltiVec inline assembly. */
|
||||
#undef CAN_COMPILE_ALTIVEC
|
||||
|
||||
/* Define if your compiler groks C altivec extensions. */
|
||||
/* Define if your compiler groks C AltiVec extensions. */
|
||||
#undef CAN_COMPILE_C_ALTIVEC
|
||||
|
||||
/* For FreeBSD VCD support */
|
||||
@ -407,6 +404,9 @@
|
||||
/* Copyright string */
|
||||
#undef COPYRIGHT_MESSAGE
|
||||
|
||||
/* The ./configure command line */
|
||||
#undef CONFIGURE_LINE
|
||||
|
||||
/* String suffix for module functions */
|
||||
#undef MODULE_SUFFIX
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* input_ext-dec.h: structures exported to the VideoLAN decoders
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: input_ext-dec.h,v 1.59 2002/05/24 12:42:14 gbazin Exp $
|
||||
* $Id: input_ext-dec.h,v 1.60 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
* Michel Kaempf <maxx@via.ecp.fr>
|
||||
@ -22,6 +22,9 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_INPUT_EXT_DEC_H
|
||||
#define _VLC_INPUT_EXT_DEC_H 1
|
||||
|
||||
/* ES streams types - see ISO/IEC 13818-1 table 2-29 numbers */
|
||||
#define MPEG1_VIDEO_ES 0x01
|
||||
#define MPEG2_VIDEO_ES 0x02
|
||||
@ -45,22 +48,22 @@
|
||||
*****************************************************************************
|
||||
* Describe a data packet.
|
||||
*****************************************************************************/
|
||||
typedef struct data_packet_s
|
||||
struct data_packet_s
|
||||
{
|
||||
/* Used to chain the packets that carry data for a same PES or PSI */
|
||||
struct data_packet_s * p_next;
|
||||
data_packet_t * p_next;
|
||||
|
||||
/* start of the PS or TS packet */
|
||||
byte_t * p_demux_start;
|
||||
byte_t * p_demux_start;
|
||||
/* start of the PES payload in this packet */
|
||||
byte_t * p_payload_start;
|
||||
byte_t * p_payload_end; /* guess ? :-) */
|
||||
byte_t * p_payload_start;
|
||||
byte_t * p_payload_end; /* guess ? :-) */
|
||||
/* is the packet messed up ? */
|
||||
boolean_t b_discard_payload;
|
||||
vlc_bool_t b_discard_payload;
|
||||
|
||||
/* pointer to the real data */
|
||||
struct data_buffer_s * p_buffer;
|
||||
} data_packet_t;
|
||||
data_buffer_t * p_buffer;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* pes_packet_t
|
||||
@ -68,55 +71,58 @@ typedef struct data_packet_s
|
||||
* Describes an PES packet, with its properties, and pointers to the TS packets
|
||||
* containing it.
|
||||
*****************************************************************************/
|
||||
typedef struct pes_packet_s
|
||||
struct pes_packet_s
|
||||
{
|
||||
/* Chained list to the next PES packet (depending on the context) */
|
||||
struct pes_packet_s * p_next;
|
||||
pes_packet_t * p_next;
|
||||
|
||||
/* PES properties */
|
||||
boolean_t b_data_alignment; /* used to find the beginning of
|
||||
* a video or audio unit */
|
||||
boolean_t b_discontinuity; /* This packet doesn't follow the
|
||||
* previous one */
|
||||
vlc_bool_t b_data_alignment; /* used to find the beginning of
|
||||
* a video or audio unit */
|
||||
vlc_bool_t b_discontinuity; /* This packet doesn't follow the
|
||||
* previous one */
|
||||
|
||||
mtime_t i_pts; /* PTS for this packet (zero if unset) */
|
||||
mtime_t i_dts; /* DTS for this packet (zero if unset) */
|
||||
int i_rate; /* current pace of reading
|
||||
* (see stream_control.h) */
|
||||
mtime_t i_pts; /* PTS for this packet (zero if unset) */
|
||||
mtime_t i_dts; /* DTS for this packet (zero if unset) */
|
||||
int i_rate; /* current reading pace (see stream_control.h) */
|
||||
|
||||
unsigned int i_pes_size; /* size of the current PES packet */
|
||||
unsigned int i_pes_size; /* size of the current PES packet */
|
||||
|
||||
/* Chained list to packets */
|
||||
data_packet_t * p_first; /* The first packet contained by this
|
||||
data_packet_t * p_first; /* The first packet contained by this
|
||||
* PES (used by decoders). */
|
||||
data_packet_t * p_last; /* The last packet contained by this
|
||||
PES (used by the buffer allocator) */
|
||||
unsigned int i_nb_data; /* Number of data packets in the chained
|
||||
list */
|
||||
} pes_packet_t;
|
||||
data_packet_t * p_last; /* The last packet contained by this
|
||||
* PES (used by the buffer allocator) */
|
||||
unsigned int i_nb_data; /* Number of data packets in the chained list */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* decoder_fifo_t
|
||||
*****************************************************************************
|
||||
* This rotative FIFO contains PES packets that are to be decoded.
|
||||
*****************************************************************************/
|
||||
typedef struct decoder_fifo_s
|
||||
struct decoder_fifo_s
|
||||
{
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* Thread structures */
|
||||
vlc_mutex_t data_lock; /* fifo data lock */
|
||||
vlc_cond_t data_wait; /* fifo data conditional variable */
|
||||
vlc_mutex_t data_lock; /* fifo data lock */
|
||||
vlc_cond_t data_wait; /* fifo data conditional variable */
|
||||
|
||||
/* Data */
|
||||
pes_packet_t * p_first;
|
||||
pes_packet_t ** pp_last;
|
||||
int i_depth; /* number of PES packets in the stack */
|
||||
pes_packet_t * p_first;
|
||||
pes_packet_t ** pp_last;
|
||||
int i_depth; /* number of PES packets in the stack */
|
||||
|
||||
/* Communication interface between input and decoders */
|
||||
boolean_t b_die; /* the decoder should return now */
|
||||
boolean_t b_error; /* the decoder is in an error loop */
|
||||
struct input_buffers_s *p_packets_mgt; /* packets management services
|
||||
* data */
|
||||
} decoder_fifo_t;
|
||||
input_buffers_t *p_packets_mgt; /* packets management services data */
|
||||
|
||||
/* Standard pointers given to the decoders as a toolbox. */
|
||||
u16 i_id;
|
||||
u8 i_type;
|
||||
void * p_demux_data;
|
||||
stream_ctrl_t * p_stream_ctrl;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* bit_fifo_t : bit fifo descriptor
|
||||
@ -144,31 +150,30 @@ typedef struct bit_fifo_s
|
||||
* This type, based on a PES stream, includes all the structures needed to
|
||||
* handle the input stream like a bit stream.
|
||||
*****************************************************************************/
|
||||
typedef struct bit_stream_s
|
||||
struct bit_stream_s
|
||||
{
|
||||
/*
|
||||
* Bit structures
|
||||
*/
|
||||
bit_fifo_t fifo;
|
||||
bit_fifo_t fifo;
|
||||
|
||||
/*
|
||||
* Input structures
|
||||
*/
|
||||
/* The decoder fifo contains the data of the PES stream */
|
||||
decoder_fifo_t * p_decoder_fifo;
|
||||
decoder_fifo_t * p_decoder_fifo;
|
||||
|
||||
/* Callback to the decoder used when changing data packets ; set
|
||||
* to NULL if your decoder doesn't need it. */
|
||||
void (* pf_bitstream_callback)( struct bit_stream_s *,
|
||||
boolean_t b_new_pes );
|
||||
void (* pf_bitstream_callback)( bit_stream_t *, vlc_bool_t );
|
||||
/* Optional argument to the callback */
|
||||
void * p_callback_arg;
|
||||
void * p_callback_arg;
|
||||
|
||||
/*
|
||||
* PTS retrieval
|
||||
*/
|
||||
mtime_t i_pts, i_dts;
|
||||
byte_t * p_pts_validity;
|
||||
mtime_t i_pts, i_dts;
|
||||
byte_t * p_pts_validity;
|
||||
|
||||
/*
|
||||
* Byte structures
|
||||
@ -182,7 +187,7 @@ typedef struct bit_stream_s
|
||||
/* Temporary buffer in case we're not aligned when changing data packets */
|
||||
WORD_TYPE i_showbits_buffer;
|
||||
data_packet_t showbits_data;
|
||||
} bit_stream_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Inline functions used by the decoders to read bit_stream_t
|
||||
@ -213,26 +218,13 @@ typedef struct bit_stream_s
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_ext-dec.c
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void InitBitstream ( struct bit_stream_s *, struct decoder_fifo_s *,
|
||||
void (* pf_bitstream_callback)( struct bit_stream_s *,
|
||||
boolean_t ),
|
||||
void * p_callback_arg );
|
||||
boolean_t NextDataPacket( struct decoder_fifo_s *, struct data_packet_s ** );
|
||||
void BitstreamNextDataPacket( struct bit_stream_s * );
|
||||
u32 UnalignedShowBits( struct bit_stream_s *, unsigned int );
|
||||
void UnalignedRemoveBits( struct bit_stream_s * );
|
||||
u32 UnalignedGetBits( struct bit_stream_s *, unsigned int );
|
||||
void CurrentPTS( struct bit_stream_s *, mtime_t *, mtime_t * );
|
||||
#else
|
||||
# define InitBitstream p_symbols->InitBitstream
|
||||
# define NextDataPacket p_symbols->NextDataPacket
|
||||
# define BitstreamNextDataPacket p_symbols->BitstreamNextDataPacket
|
||||
# define UnalignedShowBits p_symbols->UnalignedShowBits
|
||||
# define UnalignedRemoveBits p_symbols->UnalignedRemoveBits
|
||||
# define UnalignedGetBits p_symbols->UnalignedGetBits
|
||||
# define CurrentPTS p_symbols->CurrentPTS
|
||||
#endif
|
||||
VLC_EXPORT( void, InitBitstream, ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) );
|
||||
VLC_EXPORT( vlc_bool_t, NextDataPacket, ( decoder_fifo_t *, data_packet_t ** ) );
|
||||
VLC_EXPORT( void, BitstreamNextDataPacket, ( bit_stream_t * ) );
|
||||
VLC_EXPORT( u32, UnalignedShowBits, ( bit_stream_t *, unsigned int ) );
|
||||
VLC_EXPORT( void, UnalignedRemoveBits, ( bit_stream_t * ) );
|
||||
VLC_EXPORT( u32, UnalignedGetBits, ( bit_stream_t *, unsigned int ) );
|
||||
VLC_EXPORT( void, CurrentPTS, ( bit_stream_t *, mtime_t *, mtime_t * ) );
|
||||
|
||||
/*****************************************************************************
|
||||
* AlignWord : fill in the bit buffer so that the byte pointer be aligned
|
||||
@ -265,8 +257,7 @@ static inline void AlignWord( bit_stream_t * p_bit_stream )
|
||||
/*****************************************************************************
|
||||
* ShowBits : return i_bits bits from the bit stream
|
||||
*****************************************************************************/
|
||||
static inline u32 ShowBits( bit_stream_t * p_bit_stream,
|
||||
unsigned int i_bits )
|
||||
static inline u32 ShowBits( bit_stream_t * p_bit_stream, unsigned int i_bits )
|
||||
{
|
||||
if( p_bit_stream->fifo.i_available >= i_bits )
|
||||
{
|
||||
@ -361,8 +352,7 @@ static inline void RemoveBits32( bit_stream_t * p_bit_stream )
|
||||
* GetBits : returns i_bits bits from the bit stream and removes them
|
||||
* XXX: do not use for 32 bits, see GetBits32
|
||||
*****************************************************************************/
|
||||
static inline u32 GetBits( bit_stream_t * p_bit_stream,
|
||||
unsigned int i_bits )
|
||||
static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits )
|
||||
{
|
||||
u32 i_result;
|
||||
|
||||
@ -493,14 +483,16 @@ static inline void GetChunk( bit_stream_t * p_bit_stream,
|
||||
if( (i_available = p_bit_stream->p_end - p_bit_stream->p_byte)
|
||||
>= i_buf_len )
|
||||
{
|
||||
FAST_MEMCPY( p_buffer, p_bit_stream->p_byte, i_buf_len );
|
||||
p_bit_stream->p_decoder_fifo->p_vlc->pf_memcpy( p_buffer,
|
||||
p_bit_stream->p_byte, i_buf_len );
|
||||
p_bit_stream->p_byte += i_buf_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
FAST_MEMCPY( p_buffer, p_bit_stream->p_byte, i_available );
|
||||
p_bit_stream->p_decoder_fifo->p_vlc->pf_memcpy( p_buffer,
|
||||
p_bit_stream->p_byte, i_available );
|
||||
p_bit_stream->p_byte = p_bit_stream->p_end;
|
||||
p_buffer += i_available;
|
||||
i_buf_len -= i_available;
|
||||
@ -513,7 +505,8 @@ static inline void GetChunk( bit_stream_t * p_bit_stream,
|
||||
|
||||
if( i_buf_len )
|
||||
{
|
||||
FAST_MEMCPY( p_buffer, p_bit_stream->p_byte, i_buf_len );
|
||||
p_bit_stream->p_decoder_fifo->p_vlc->pf_memcpy( p_buffer,
|
||||
p_bit_stream->p_byte, i_buf_len );
|
||||
p_bit_stream->p_byte += i_buf_len;
|
||||
}
|
||||
}
|
||||
@ -529,27 +522,9 @@ static inline void GetChunk( bit_stream_t * p_bit_stream,
|
||||
* Communication interface between input and decoders
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
* decoder_config_t
|
||||
*****************************************************************************
|
||||
* Standard pointers given to the decoders as a toolbox.
|
||||
*****************************************************************************/
|
||||
typedef struct decoder_config_s
|
||||
{
|
||||
u16 i_id;
|
||||
u8 i_type; /* type of the elementary stream */
|
||||
|
||||
void * p_demux_data;
|
||||
struct stream_ctrl_s * p_stream_ctrl;
|
||||
struct decoder_fifo_s * p_decoder_fifo;
|
||||
} decoder_config_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_dec.c
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void DecoderError ( struct decoder_fifo_s * p_fifo );
|
||||
#else
|
||||
# define DecoderError p_symbols->DecoderError
|
||||
#endif
|
||||
VLC_EXPORT( void, DecoderError, ( decoder_fifo_t * p_fifo ) );
|
||||
|
||||
#endif /* "input_ext-dec.h" */
|
||||
|
@ -4,7 +4,7 @@
|
||||
* control the pace of reading.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: input_ext-intf.h,v 1.66 2002/04/25 02:10:33 jobi Exp $
|
||||
* $Id: input_ext-intf.h,v 1.67 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -23,6 +23,9 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_INPUT_EXT_INTF_H
|
||||
#define _VLC_INPUT_EXT_INTF_H 1
|
||||
|
||||
/*
|
||||
* Communication input -> interface
|
||||
*/
|
||||
@ -34,39 +37,18 @@
|
||||
|
||||
#define OFFSETTOTIME_MAX_SIZE 10
|
||||
|
||||
/*****************************************************************************
|
||||
* input_bank_t, p_input_bank (global variable)
|
||||
*****************************************************************************
|
||||
* This global variable is accessed by any function using the input.
|
||||
*****************************************************************************/
|
||||
typedef struct input_bank_s
|
||||
{
|
||||
/* Array to all the input threads */
|
||||
struct input_thread_s *pp_input[ INPUT_MAX_THREADS ];
|
||||
|
||||
int i_count;
|
||||
vlc_mutex_t lock; /* Global lock */
|
||||
|
||||
} input_bank_t;
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
extern input_bank_t *p_input_bank;
|
||||
#else
|
||||
# define p_input_bank (p_symbols->p_input_bank)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* es_descriptor_t: elementary stream descriptor
|
||||
*****************************************************************************
|
||||
* Describes an elementary stream, and includes fields required to handle and
|
||||
* demultiplex this elementary stream.
|
||||
*****************************************************************************/
|
||||
typedef struct es_descriptor_s
|
||||
struct es_descriptor_s
|
||||
{
|
||||
u16 i_id; /* stream ID for PS, PID for TS */
|
||||
u8 i_stream_id; /* stream ID defined in the PES */
|
||||
u8 i_type; /* stream type */
|
||||
boolean_t b_audio; /* is the stream an audio stream that
|
||||
vlc_bool_t b_audio; /* is the stream an audio stream that
|
||||
* will need to be discarded with
|
||||
* fast forward and slow motion ? */
|
||||
u8 i_cat; /* stream category: video, audio,
|
||||
@ -79,25 +61,22 @@ typedef struct es_descriptor_s
|
||||
|
||||
/* Demultiplexer information */
|
||||
void * p_demux_data;
|
||||
struct pgrm_descriptor_s *
|
||||
p_pgrm; /* very convenient in the demultiplexer */
|
||||
pgrm_descriptor_t * p_pgrm; /* very convenient in the demultiplexer */
|
||||
|
||||
/* PES parser information */
|
||||
struct pes_packet_s * p_pes; /* Current PES */
|
||||
pes_packet_t * p_pes; /* Current PES */
|
||||
int i_pes_real_size; /* as indicated by the header */
|
||||
|
||||
/* Decoder information */
|
||||
struct decoder_fifo_s * p_decoder_fifo;
|
||||
decoder_fifo_t * p_decoder_fifo;
|
||||
vlc_thread_t thread_id; /* ID of the decoder */
|
||||
|
||||
count_t c_packets; /* total packets read */
|
||||
count_t c_invalid_packets; /* invalid packets read */
|
||||
|
||||
/* Module properties */
|
||||
struct module_s * p_module;
|
||||
struct decoder_config_s * p_config;
|
||||
|
||||
} es_descriptor_t;
|
||||
module_t * p_module;
|
||||
};
|
||||
|
||||
/* Special PID values - note that the PID is only on 13 bits, and that values
|
||||
* greater than 0x1fff have no meaning in a stream */
|
||||
@ -119,12 +98,12 @@ typedef struct es_descriptor_s
|
||||
* Describes a program and list associated elementary streams. It is build by
|
||||
* the PSI decoder upon the informations carried in program map sections
|
||||
*****************************************************************************/
|
||||
typedef struct pgrm_descriptor_s
|
||||
struct pgrm_descriptor_s
|
||||
{
|
||||
/* Program characteristics */
|
||||
u16 i_number; /* program number */
|
||||
u8 i_version; /* version number */
|
||||
boolean_t b_is_ok; /* Is the description up to date ? */
|
||||
vlc_bool_t b_is_ok; /* Is the description up to date ? */
|
||||
|
||||
/* Service Descriptor (program name) - DVB extension */
|
||||
u8 i_srv_type;
|
||||
@ -145,7 +124,7 @@ typedef struct pgrm_descriptor_s
|
||||
|
||||
int i_es_number; /* size of the following array */
|
||||
es_descriptor_t ** pp_es; /* array of pointers to ES */
|
||||
} pgrm_descriptor_t;
|
||||
};
|
||||
|
||||
/* Synchro states */
|
||||
#define SYNCHRO_OK 0
|
||||
@ -157,7 +136,7 @@ typedef struct pgrm_descriptor_s
|
||||
*****************************************************************************
|
||||
* Attributes for current area (title for DVD)
|
||||
*****************************************************************************/
|
||||
typedef struct input_area_s
|
||||
struct input_area_s
|
||||
{
|
||||
/* selected area attributes */
|
||||
int i_id; /* identificator for area */
|
||||
@ -178,7 +157,7 @@ typedef struct input_area_s
|
||||
|
||||
/* offset to plugin related data */
|
||||
off_t i_plugin_data;
|
||||
} input_area_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* stream_descriptor_t
|
||||
@ -186,10 +165,10 @@ typedef struct input_area_s
|
||||
* Describes a stream and list its associated programs. Build upon
|
||||
* the information carried in program association sections (for instance)
|
||||
*****************************************************************************/
|
||||
typedef struct stream_descriptor_s
|
||||
struct stream_descriptor_s
|
||||
{
|
||||
u16 i_stream_id; /* stream id */
|
||||
boolean_t b_changed; /* if stream has been changed,
|
||||
vlc_bool_t b_changed; /* if stream has been changed,
|
||||
we have to inform the interface */
|
||||
vlc_mutex_t stream_lock; /* to be taken every time you read
|
||||
* or modify stream, pgrm or es */
|
||||
@ -197,8 +176,8 @@ typedef struct stream_descriptor_s
|
||||
/* Input method data */
|
||||
int i_method; /* input method for stream: file,
|
||||
disc or network */
|
||||
boolean_t b_pace_control; /* can we read when we want ? */
|
||||
boolean_t b_seekable; /* can we do lseek() ? */
|
||||
vlc_bool_t b_pace_control; /* can we read when we want ? */
|
||||
vlc_bool_t b_seekable; /* can we do lseek() ? */
|
||||
|
||||
/* if (b_seekable) : */
|
||||
int i_area_nb;
|
||||
@ -241,7 +220,21 @@ typedef struct stream_descriptor_s
|
||||
/* Statistics */
|
||||
count_t c_packets_read; /* packets read */
|
||||
count_t c_packets_trashed; /* trashed packets */
|
||||
} stream_descriptor_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* stream_position_t
|
||||
*****************************************************************************
|
||||
* Describes the current position in the stream.
|
||||
*****************************************************************************/
|
||||
struct stream_position_s
|
||||
{
|
||||
off_t i_tell; /* actual location in the area (in arbitrary units) */
|
||||
off_t i_size; /* total size of the area (in arbitrary units) */
|
||||
|
||||
u32 i_mux_rate; /* the rate we read the stream (in
|
||||
* units of 50 bytes/s) ; 0 if undef */
|
||||
};
|
||||
|
||||
#define MUTE_NO_CHANGE -1
|
||||
|
||||
@ -250,57 +243,53 @@ typedef struct stream_descriptor_s
|
||||
*****************************************************************************
|
||||
* This structure includes all the local static variables of an input thread
|
||||
*****************************************************************************/
|
||||
typedef struct input_thread_s
|
||||
struct input_thread_s
|
||||
{
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* Thread properties and locks */
|
||||
boolean_t b_die; /* 'die' flag */
|
||||
boolean_t b_error;
|
||||
boolean_t b_eof;
|
||||
vlc_thread_t thread_id; /* id for thread functions */
|
||||
vlc_bool_t b_eof;
|
||||
int i_status; /* status flag */
|
||||
|
||||
/* Access module */
|
||||
struct module_s * p_access_module;
|
||||
int (* pf_open)( struct input_thread_s * );
|
||||
void (* pf_close)( struct input_thread_s * );
|
||||
ssize_t (* pf_read) ( struct input_thread_s *,
|
||||
byte_t *, size_t );
|
||||
int (* pf_set_program)( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s * );
|
||||
int (* pf_set_area)( struct input_thread_s *,
|
||||
struct input_area_s * );
|
||||
void (* pf_seek)( struct input_thread_s *, off_t );
|
||||
void * p_access_data;
|
||||
size_t i_mtu;
|
||||
module_t * p_access_module;
|
||||
int (* pf_open ) ( input_thread_t * );
|
||||
void (* pf_close )( input_thread_t * );
|
||||
ssize_t (* pf_read ) ( input_thread_t *, byte_t *, size_t );
|
||||
int (* pf_set_program )( input_thread_t *, pgrm_descriptor_t * );
|
||||
int (* pf_set_area )( input_thread_t *, input_area_t * );
|
||||
void (* pf_seek ) ( input_thread_t *, off_t );
|
||||
void * p_access_data;
|
||||
size_t i_mtu;
|
||||
|
||||
/* Demux module */
|
||||
struct module_s * p_demux_module;
|
||||
int (* pf_init)( struct input_thread_s * );
|
||||
void (* pf_end)( struct input_thread_s * );
|
||||
int (* pf_demux)( struct input_thread_s * );
|
||||
int (* pf_rewind)( struct input_thread_s * );
|
||||
module_t * p_demux_module;
|
||||
int (* pf_init ) ( input_thread_t * );
|
||||
void (* pf_end ) ( input_thread_t * );
|
||||
int (* pf_demux ) ( input_thread_t * );
|
||||
int (* pf_rewind ) ( input_thread_t * );
|
||||
/* NULL if we don't support going *
|
||||
* backwards (it's gonna be fun) */
|
||||
void * p_demux_data; /* data of the demux */
|
||||
void * p_demux_data; /* data of the demux */
|
||||
|
||||
/* Buffer manager */
|
||||
struct input_buffers_s *p_method_data; /* data of the packet manager */
|
||||
struct data_buffer_s * p_data_buffer;
|
||||
byte_t * p_current_data;
|
||||
byte_t * p_last_data;
|
||||
size_t i_bufsize;
|
||||
input_buffers_t *p_method_data; /* data of the packet manager */
|
||||
data_buffer_t * p_data_buffer;
|
||||
byte_t * p_current_data;
|
||||
byte_t * p_last_data;
|
||||
size_t i_bufsize;
|
||||
|
||||
/* General stream description */
|
||||
stream_descriptor_t stream;
|
||||
|
||||
/* Playlist item */
|
||||
char * psz_source;
|
||||
char * psz_access;
|
||||
char * psz_demux;
|
||||
char * psz_name;
|
||||
char * psz_source;
|
||||
char * psz_access;
|
||||
char * psz_demux;
|
||||
char * psz_name;
|
||||
|
||||
count_t c_loops;
|
||||
} input_thread_t;
|
||||
count_t c_loops;
|
||||
};
|
||||
|
||||
/* Input methods */
|
||||
/* The first figure is a general method that can be used in interface plugins ;
|
||||
@ -325,39 +314,40 @@ typedef struct input_thread_s
|
||||
#define INPUT_STATUS_FASTER 3
|
||||
#define INPUT_STATUS_SLOWER 4
|
||||
|
||||
/* Seek modes */
|
||||
#define INPUT_SEEK_SET 0x00
|
||||
#define INPUT_SEEK_CUR 0x01
|
||||
#define INPUT_SEEK_END 0x02
|
||||
#define INPUT_SEEK_BYTES 0x00
|
||||
#define INPUT_SEEK_SECONDS 0x10
|
||||
#define INPUT_SEEK_PERCENT 0x20
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void input_InitBank ( void );
|
||||
void input_EndBank ( void );
|
||||
input_thread_t * input_CreateThread ( vlc_object_t *,
|
||||
playlist_item_t *, int * );
|
||||
void input_StopThread ( input_thread_t *, int *pi_status );
|
||||
void input_DestroyThread ( input_thread_t * );
|
||||
|
||||
struct input_thread_s * input_CreateThread ( struct playlist_item_s *,
|
||||
int *pi_status );
|
||||
void input_StopThread ( struct input_thread_s *, int *pi_status );
|
||||
void input_DestroyThread ( struct input_thread_s * );
|
||||
#define input_SetStatus(a,b) __input_SetStatus(CAST_TO_VLC_OBJECT(a),b)
|
||||
VLC_EXPORT( void, __input_SetStatus, ( vlc_object_t *, int ) );
|
||||
|
||||
void input_SetStatus ( struct input_thread_s *, int );
|
||||
void input_Seek ( struct input_thread_s *, off_t );
|
||||
void input_DumpStream ( struct input_thread_s * );
|
||||
char * input_OffsetToTime ( struct input_thread_s *, char *, off_t );
|
||||
int input_ChangeES ( struct input_thread_s *,
|
||||
struct es_descriptor_s *, u8 );
|
||||
int input_ToggleES ( struct input_thread_s *,
|
||||
struct es_descriptor_s *, boolean_t );
|
||||
int input_ChangeArea ( struct input_thread_s *, struct input_area_s * );
|
||||
int input_ChangeProgram ( struct input_thread_s *, u16 );
|
||||
int input_ToggleGrayscale( struct input_thread_s * );
|
||||
int input_ToggleMute ( struct input_thread_s * );
|
||||
int input_SetSMP ( struct input_thread_s *, int );
|
||||
#else
|
||||
# define input_SetStatus p_symbols->input_SetStatus
|
||||
# define input_Seek p_symbols->input_Seek
|
||||
# define input_DumpStream p_symbols->input_DumpStream
|
||||
# define input_OffsetToTime p_symbols->input_OffsetToTime
|
||||
# define input_ChangeES p_symbols->input_ChangeES
|
||||
# define input_ToggleES p_symbols->input_ToggleES
|
||||
# define input_ChangeArea p_symbols->input_ChangeArea
|
||||
# define input_ChangeProgram p_symbols->input_ChangeProgram
|
||||
#endif
|
||||
#define input_Seek(a,b,c) __input_Seek(CAST_TO_VLC_OBJECT(a),b,c)
|
||||
VLC_EXPORT( void, __input_Seek, ( vlc_object_t *, off_t, int ) );
|
||||
|
||||
#define input_Tell(a,b) __input_Tell(CAST_TO_VLC_OBJECT(a),b)
|
||||
VLC_EXPORT( void, __input_Tell, ( vlc_object_t *, stream_position_t * ) );
|
||||
|
||||
VLC_EXPORT( void, input_DumpStream, ( input_thread_t * ) );
|
||||
VLC_EXPORT( char *, input_OffsetToTime, ( input_thread_t *, char *, off_t ) );
|
||||
VLC_EXPORT( int, input_ChangeES, ( input_thread_t *, es_descriptor_t *, u8 ) );
|
||||
VLC_EXPORT( int, input_ToggleES, ( input_thread_t *, es_descriptor_t *, vlc_bool_t ) );
|
||||
VLC_EXPORT( int, input_ChangeArea, ( input_thread_t *, input_area_t * ) );
|
||||
VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, u16 ) );
|
||||
|
||||
int input_ToggleGrayscale( input_thread_t * );
|
||||
int input_ToggleMute ( input_thread_t * );
|
||||
int input_SetSMP ( input_thread_t *, int );
|
||||
|
||||
#endif /* "input_ext-intf.h" */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* but exported to plug-ins
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2002 VideoLAN
|
||||
* $Id: input_ext-plugins.h,v 1.28 2002/05/18 17:47:46 sam Exp $
|
||||
* $Id: input_ext-plugins.h,v 1.29 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -38,109 +38,56 @@
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_programs.c
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
int input_InitStream( struct input_thread_s *, size_t );
|
||||
void input_EndStream ( struct input_thread_s * );
|
||||
struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 );
|
||||
struct pgrm_descriptor_s * input_AddProgram ( struct input_thread_s *,
|
||||
u16, size_t );
|
||||
void input_DelProgram( struct input_thread_s *, struct pgrm_descriptor_s * );
|
||||
int input_SetProgram( struct input_thread_s *, struct pgrm_descriptor_s * );
|
||||
struct input_area_s * input_AddArea( struct input_thread_s * );
|
||||
void input_DelArea ( struct input_thread_s *, struct input_area_s * );
|
||||
struct es_descriptor_s * input_FindES( struct input_thread_s *, u16 );
|
||||
struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 );
|
||||
struct es_descriptor_s * input_AddES ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *, u16,
|
||||
size_t );
|
||||
void input_DelES ( struct input_thread_s *, struct es_descriptor_s * );
|
||||
int input_SelectES ( struct input_thread_s *, struct es_descriptor_s * );
|
||||
int input_UnselectES( struct input_thread_s *, struct es_descriptor_s * );
|
||||
#else
|
||||
# define input_InitStream p_symbols->input_InitStream
|
||||
# define input_EndStream p_symbols->input_EndStream
|
||||
# define input_SetProgram p_symbols->input_SetProgram
|
||||
# define input_FindES p_symbols->input_FindES
|
||||
# define input_FindProgram p_symbols->input_FindProgram
|
||||
# define input_AddES p_symbols->input_AddES
|
||||
# define input_DelES p_symbols->input_DelES
|
||||
# define input_SelectES p_symbols->input_SelectES
|
||||
# define input_UnselectES p_symbols->input_UnselectES
|
||||
# define input_AddProgram p_symbols->input_AddProgram
|
||||
# define input_DelProgram p_symbols->input_DelProgram
|
||||
# define input_AddArea p_symbols->input_AddArea
|
||||
# define input_DelArea p_symbols->input_DelArea
|
||||
#endif
|
||||
VLC_EXPORT( int, input_InitStream,( input_thread_t *, size_t ) );
|
||||
VLC_EXPORT( void, input_EndStream, ( input_thread_t * ) );
|
||||
VLC_EXPORT( pgrm_descriptor_t *, input_FindProgram,( input_thread_t *, u16 ) );
|
||||
VLC_EXPORT( pgrm_descriptor_t *, input_AddProgram, ( input_thread_t *, u16, size_t ) );
|
||||
VLC_EXPORT( void, input_DelProgram,( input_thread_t *, pgrm_descriptor_t * ) );
|
||||
VLC_EXPORT( int, input_SetProgram,( input_thread_t *, pgrm_descriptor_t * ) );
|
||||
VLC_EXPORT( input_area_t *, input_AddArea,( input_thread_t * ) );
|
||||
VLC_EXPORT( void, input_DelArea, ( input_thread_t *, input_area_t * ) );
|
||||
VLC_EXPORT( es_descriptor_t *, input_FindES,( input_thread_t *, u16 ) );
|
||||
VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, u16, size_t ) );
|
||||
VLC_EXPORT( void, input_DelES, ( input_thread_t *, es_descriptor_t * ) );
|
||||
VLC_EXPORT( int, input_SelectES, ( input_thread_t *, es_descriptor_t * ) );
|
||||
VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) );
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_dec.c
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
//decoder_capabilities_s * input_ProbeDecoder( void );
|
||||
vlc_thread_t input_RunDecoder( struct input_thread_s *,
|
||||
struct es_descriptor_s * );
|
||||
void input_EndDecoder( struct input_thread_s *, struct es_descriptor_s * );
|
||||
void input_DecodePES ( struct decoder_fifo_s *, struct pes_packet_s * );
|
||||
void input_EscapeDiscontinuity( struct input_thread_s * );
|
||||
void input_EscapeAudioDiscontinuity( struct input_thread_s * );
|
||||
#else
|
||||
# define input_DecodePES p_symbols->input_DecodePES
|
||||
#endif
|
||||
//decoder_capabilities_t * input_ProbeDecoder( void );
|
||||
decoder_fifo_t * input_RunDecoder( input_thread_t *, es_descriptor_t * );
|
||||
void input_EndDecoder( input_thread_t *, es_descriptor_t * );
|
||||
VLC_EXPORT( void, input_DecodePES, ( decoder_fifo_t *, pes_packet_t * ) );
|
||||
void input_EscapeDiscontinuity( input_thread_t * );
|
||||
void input_EscapeAudioDiscontinuity( input_thread_t * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_clock.c
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void input_ClockInit( struct pgrm_descriptor_s * );
|
||||
int input_ClockManageControl( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *, mtime_t );
|
||||
void input_ClockManageRef( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *, mtime_t );
|
||||
mtime_t input_ClockGetTS( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *, mtime_t );
|
||||
#else
|
||||
# define input_ClockManageRef p_symbols->input_ClockManageRef
|
||||
# define input_ClockManageControl p_symbols->input_ClockManageControl
|
||||
# define input_ClockGetTS p_symbols->input_ClockGetTS
|
||||
#endif
|
||||
void input_ClockInit( pgrm_descriptor_t * );
|
||||
VLC_EXPORT( int, input_ClockManageControl, ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) );
|
||||
VLC_EXPORT( void, input_ClockManageRef, ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) );
|
||||
VLC_EXPORT( mtime_t, input_ClockGetTS, ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) );
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes from input_ext-plugins.h (buffers management)
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void * input_BuffersInit( void );
|
||||
void input_BuffersEnd( struct input_buffers_s * );
|
||||
struct data_buffer_s * input_NewBuffer( struct input_buffers_s *, size_t );
|
||||
void input_ReleaseBuffer( struct input_buffers_s *, struct data_buffer_s * );
|
||||
struct data_packet_s * input_ShareBuffer( struct input_buffers_s *,
|
||||
struct data_buffer_s * );
|
||||
struct data_packet_s * input_NewPacket( struct input_buffers_s *, size_t );
|
||||
void input_DeletePacket( struct input_buffers_s *, struct data_packet_s * );
|
||||
struct pes_packet_s * input_NewPES( struct input_buffers_s * );
|
||||
void input_DeletePES( struct input_buffers_s *, struct pes_packet_s * );
|
||||
ssize_t input_FillBuffer( struct input_thread_s * );
|
||||
ssize_t input_Peek( struct input_thread_s *, byte_t **, size_t );
|
||||
ssize_t input_SplitBuffer( struct input_thread_s *, data_packet_t **, size_t );
|
||||
int input_AccessInit( struct input_thread_s * );
|
||||
void input_AccessReinit( struct input_thread_s * );
|
||||
void input_AccessEnd( struct input_thread_s * );
|
||||
#else
|
||||
# define input_BuffersInit p_symbols->input_BuffersInit
|
||||
# define input_BuffersEnd p_symbols->input_BuffersEnd
|
||||
# define input_NewBuffer p_symbols->input_NewBuffer
|
||||
# define input_ReleaseBuffer p_symbols->input_ReleaseBuffer
|
||||
# define input_ShareBuffer p_symbols->input_ShareBuffer
|
||||
# define input_NewPacket p_symbols->input_NewPacket
|
||||
# define input_DeletePacket p_symbols->input_DeletePacket
|
||||
# define input_NewPES p_symbols->input_NewPES
|
||||
# define input_DeletePES p_symbols->input_DeletePES
|
||||
# define input_FillBuffer p_symbols->input_FillBuffer
|
||||
# define input_Peek p_symbols->input_Peek
|
||||
# define input_SplitBuffer p_symbols->input_SplitBuffer
|
||||
# define input_AccessInit p_symbols->input_AccessInit
|
||||
# define input_AccessReinit p_symbols->input_AccessReinit
|
||||
# define input_AccessEnd p_symbols->input_AccessEnd
|
||||
#endif
|
||||
VLC_EXPORT( void *, input_BuffersInit, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, input_BuffersEnd, ( input_thread_t *, input_buffers_t * ) );
|
||||
VLC_EXPORT( data_buffer_t *, input_NewBuffer, ( input_buffers_t *, size_t ) );
|
||||
VLC_EXPORT( void, input_ReleaseBuffer, ( input_buffers_t *, data_buffer_t * ) );
|
||||
VLC_EXPORT( data_packet_t *, input_ShareBuffer, ( input_buffers_t *, data_buffer_t * ) );
|
||||
VLC_EXPORT( data_packet_t *, input_NewPacket, ( input_buffers_t *, size_t ) );
|
||||
VLC_EXPORT( void, input_DeletePacket, ( input_buffers_t *, data_packet_t * ) );
|
||||
VLC_EXPORT( pes_packet_t *, input_NewPES, ( input_buffers_t * ) );
|
||||
VLC_EXPORT( void, input_DeletePES, ( input_buffers_t *, pes_packet_t * ) );
|
||||
VLC_EXPORT( ssize_t, input_FillBuffer, ( input_thread_t * ) );
|
||||
VLC_EXPORT( ssize_t, input_Peek, ( input_thread_t *, byte_t **, size_t ) );
|
||||
VLC_EXPORT( ssize_t, input_SplitBuffer, ( input_thread_t *, data_packet_t **, size_t ) );
|
||||
VLC_EXPORT( int, input_AccessInit, ( input_thread_t * ) );
|
||||
VLC_EXPORT( void, input_AccessReinit, ( input_thread_t * ) );
|
||||
VLC_EXPORT( void, input_AccessEnd, ( input_thread_t * ) );
|
||||
|
||||
/*****************************************************************************
|
||||
* Create a NULL packet for padding in case of a data loss
|
||||
@ -154,7 +101,7 @@ static inline void input_NullPacket( input_thread_t * p_input,
|
||||
if( (p_pad_data = input_NewPacket( p_input->p_method_data,
|
||||
PADDING_PACKET_SIZE )) == NULL )
|
||||
{
|
||||
intf_ErrMsg("input error: no new packet");
|
||||
msg_Err( p_input, "no new packet" );
|
||||
p_input->b_error = 1;
|
||||
return;
|
||||
}
|
||||
@ -174,7 +121,7 @@ static inline void input_NullPacket( input_thread_t * p_input,
|
||||
{
|
||||
if( (p_pes = input_NewPES( p_input->p_method_data )) == NULL )
|
||||
{
|
||||
intf_ErrMsg("input error: no PES packet");
|
||||
msg_Err( p_input, "no PES packet" );
|
||||
p_input->b_error = 1;
|
||||
return;
|
||||
}
|
||||
@ -216,7 +163,7 @@ typedef void( * psi_callback_t )(
|
||||
input_thread_t * p_input,
|
||||
data_packet_t * p_data,
|
||||
es_descriptor_t * p_es,
|
||||
boolean_t b_unit_start );
|
||||
vlc_bool_t b_unit_start );
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@ -236,13 +183,13 @@ typedef struct psi_section_s
|
||||
u16 i_read_in_section;
|
||||
|
||||
/* the PSI is complete */
|
||||
boolean_t b_is_complete;
|
||||
vlc_bool_t b_is_complete;
|
||||
|
||||
/* packet missed up ? */
|
||||
boolean_t b_trash;
|
||||
vlc_bool_t b_trash;
|
||||
|
||||
/*about sections */
|
||||
boolean_t b_section_complete;
|
||||
vlc_bool_t b_section_complete;
|
||||
|
||||
/* where are we currently ? */
|
||||
byte_t * p_current;
|
||||
@ -254,7 +201,7 @@ typedef struct psi_section_s
|
||||
*****************************************************************************/
|
||||
typedef struct es_ts_data_s
|
||||
{
|
||||
boolean_t b_psi; /* Does the stream have to be handled by
|
||||
vlc_bool_t b_psi; /* Does the stream have to be handled by
|
||||
* the PSI decoder ? */
|
||||
|
||||
int i_psi_type; /* There are different types of PSI */
|
||||
@ -291,7 +238,7 @@ typedef struct stream_ts_data_s
|
||||
*****************************************************************************/
|
||||
typedef struct stream_ps_data_s
|
||||
{
|
||||
boolean_t b_has_PSM; /* very rare, in fact */
|
||||
vlc_bool_t b_has_PSM; /* very rare, in fact */
|
||||
|
||||
u8 i_PSM_version;
|
||||
} stream_ps_data_t;
|
||||
@ -303,27 +250,13 @@ typedef struct stream_ps_data_s
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void input_ParsePES ( struct input_thread_s *, struct es_descriptor_s * );
|
||||
void input_GatherPES ( struct input_thread_s *, struct data_packet_s *,
|
||||
struct es_descriptor_s *, boolean_t, boolean_t );
|
||||
ssize_t input_ReadPS ( struct input_thread_s *, struct data_packet_s ** );
|
||||
es_descriptor_t * input_ParsePS( struct input_thread_s *,
|
||||
struct data_packet_s * );
|
||||
ssize_t input_ReadTS ( struct input_thread_s *, struct data_packet_s ** );
|
||||
void input_DemuxPS ( struct input_thread_s *, struct data_packet_s * );
|
||||
void input_DemuxTS ( struct input_thread_s *, struct data_packet_s *,
|
||||
psi_callback_t );
|
||||
#else
|
||||
# define input_ParsePES p_symbols->input_ParsePES
|
||||
# define input_GatherPES p_symbols->input_GatherPES
|
||||
# define input_ReadPS p_symbols->input_ReadPS
|
||||
# define input_ParsePS p_symbols->input_ParsePS
|
||||
# define input_DemuxPS p_symbols->input_DemuxPS
|
||||
# define input_ReadTS p_symbols->input_ReadTS
|
||||
# define input_DemuxTS p_symbols->input_DemuxTS
|
||||
#endif
|
||||
|
||||
VLC_EXPORT( void, input_ParsePES, ( input_thread_t *, es_descriptor_t * ) );
|
||||
VLC_EXPORT( void, input_GatherPES, ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t, vlc_bool_t ) );
|
||||
VLC_EXPORT( ssize_t, input_ReadPS, ( input_thread_t *, data_packet_t ** ) );
|
||||
VLC_EXPORT( es_descriptor_t *, input_ParsePS, ( input_thread_t *, data_packet_t * ) );
|
||||
VLC_EXPORT( ssize_t, input_ReadTS, ( input_thread_t *, data_packet_t ** ) );
|
||||
VLC_EXPORT( void, input_DemuxPS, ( input_thread_t *, data_packet_t * ) );
|
||||
VLC_EXPORT( void, input_DemuxTS, ( input_thread_t *, data_packet_t *, void(*) ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t ) ) );
|
||||
|
||||
/*
|
||||
* Optional standard file descriptor operations (input_ext-plugins.h)
|
||||
@ -332,26 +265,18 @@ void input_DemuxTS ( struct input_thread_s *, struct data_packet_s *,
|
||||
/*****************************************************************************
|
||||
* input_socket_t: private access plug-in data
|
||||
*****************************************************************************/
|
||||
typedef struct input_socket_s
|
||||
struct input_socket_s
|
||||
{
|
||||
/* Unbuffered file descriptor */
|
||||
int i_handle;
|
||||
} input_socket_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void input_FDClose( struct input_thread_s * );
|
||||
void input_FDNetworkClose( struct input_thread_s * );
|
||||
ssize_t input_FDRead( input_thread_t *, byte_t *, size_t );
|
||||
ssize_t input_FDNetworkRead( input_thread_t *, byte_t *, size_t );
|
||||
void input_FDSeek( struct input_thread_s *, off_t );
|
||||
#else
|
||||
# define input_FDClose p_symbols->input_FDClose
|
||||
# define input_FDNetworkClose p_symbols->input_FDNetworkClose
|
||||
# define input_FDRead p_symbols->input_FDRead
|
||||
# define input_FDNetworkRead p_symbols->input_FDNetworkRead
|
||||
# define input_FDSeek p_symbols->input_FDSeek
|
||||
#endif
|
||||
VLC_EXPORT( void, input_FDClose, ( input_thread_t * ) );
|
||||
VLC_EXPORT( void, input_FDNetworkClose, ( input_thread_t * ) );
|
||||
VLC_EXPORT( ssize_t, input_FDRead, ( input_thread_t *, byte_t *, size_t ) );
|
||||
VLC_EXPORT( ssize_t, input_FDNetworkRead, ( input_thread_t *, byte_t *, size_t ) );
|
||||
VLC_EXPORT( void, input_FDSeek, ( input_thread_t *, off_t ) );
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* interface, such as message output.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: interface.h,v 1.28 2002/04/24 00:36:24 sam Exp $
|
||||
* $Id: interface.h,v 1.29 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -29,82 +29,40 @@
|
||||
* This structe describes all interface-specific data of the main (interface)
|
||||
* thread.
|
||||
*****************************************************************************/
|
||||
typedef struct intf_thread_s
|
||||
struct intf_thread_s
|
||||
{
|
||||
boolean_t b_die; /* `die' flag */
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* Thread properties and locks */
|
||||
vlc_bool_t b_block;
|
||||
|
||||
/* Specific interfaces */
|
||||
p_intf_console_t p_console; /* console */
|
||||
p_intf_sys_t p_sys; /* system interface */
|
||||
intf_console_t * p_console; /* console */
|
||||
intf_sys_t * p_sys; /* system interface */
|
||||
|
||||
/* Plugin used and shortcuts to access its capabilities */
|
||||
struct module_s * p_module;
|
||||
int ( *pf_open ) ( struct intf_thread_s * );
|
||||
void ( *pf_close ) ( struct intf_thread_s * );
|
||||
void ( *pf_run ) ( struct intf_thread_s * );
|
||||
|
||||
/* Interface callback */
|
||||
void ( *pf_manage ) ( struct intf_thread_s * );
|
||||
module_t * p_module;
|
||||
int ( *pf_open ) ( intf_thread_t * );
|
||||
void ( *pf_close ) ( intf_thread_t * );
|
||||
void ( *pf_run ) ( intf_thread_t * );
|
||||
|
||||
/* XXX: new message passing stuff will go here */
|
||||
vlc_mutex_t change_lock;
|
||||
boolean_t b_menu_change;
|
||||
boolean_t b_menu;
|
||||
|
||||
} intf_thread_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* msg_item_t
|
||||
*****************************************************************************
|
||||
* Store a single message. Messages have a maximal size of INTF_MSG_MSGSIZE.
|
||||
*****************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
int i_type; /* message type, see below */
|
||||
char * psz_msg; /* the message itself */
|
||||
|
||||
#if 0
|
||||
mtime_t date; /* date of the message */
|
||||
char * psz_file; /* file in which the function was called */
|
||||
char * psz_function; /* function from which the function was called */
|
||||
int i_line; /* line at which the function was called */
|
||||
#endif
|
||||
} msg_item_t;
|
||||
|
||||
/* Message types */
|
||||
#define INTF_MSG_STD 0 /* standard message */
|
||||
#define INTF_MSG_ERR 1 /* error message */
|
||||
#define INTF_MSG_WARN 2 /* warning message */
|
||||
#define INTF_MSG_STAT 3 /* statistic message */
|
||||
|
||||
/*****************************************************************************
|
||||
* intf_subscription_t
|
||||
*****************************************************************************
|
||||
* Used by interface plugins which subscribe to the message queue.
|
||||
*****************************************************************************/
|
||||
typedef struct intf_subscription_s
|
||||
{
|
||||
int i_start;
|
||||
int* pi_stop;
|
||||
|
||||
msg_item_t* p_msg;
|
||||
vlc_mutex_t* p_lock;
|
||||
} intf_subscription_t;
|
||||
vlc_mutex_t change_lock;
|
||||
vlc_bool_t b_menu_change;
|
||||
vlc_bool_t b_menu;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
intf_thread_t * intf_Create ( void );
|
||||
void intf_Destroy ( intf_thread_t * p_intf );
|
||||
intf_thread_t * intf_Create ( vlc_object_t * );
|
||||
vlc_error_t intf_RunThread ( intf_thread_t * );
|
||||
void intf_StopThread ( intf_thread_t * );
|
||||
void intf_Destroy ( intf_thread_t * );
|
||||
|
||||
void intf_MsgCreate ( void );
|
||||
void intf_MsgDestroy ( void );
|
||||
void msg_Create ( vlc_object_t * );
|
||||
void msg_Destroy ( vlc_object_t * );
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
intf_subscription_t* intf_MsgSub ( void );
|
||||
void intf_MsgUnsub ( intf_subscription_t * );
|
||||
#else
|
||||
# define intf_MsgSub p_symbols->intf_MsgSub
|
||||
# define intf_MsgUnsub p_symbols->intf_MsgUnsub
|
||||
#endif
|
||||
VLC_EXPORT( msg_subscription_t*, msg_Subscribe, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, msg_Unsubscribe, ( vlc_object_t *, msg_subscription_t * ) );
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* intf_eject.h: CD/DVD-ROM ejection handling functions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001, 2002 VideoLAN
|
||||
* $Id: intf_eject.h,v 1.2 2002/04/24 00:36:24 sam Exp $
|
||||
* $Id: intf_eject.h,v 1.3 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Author: Julien Blache <jb@technologeek.org>
|
||||
*
|
||||
@ -21,8 +21,5 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
int intf_Eject( const char * );
|
||||
#else
|
||||
# define intf_Eject p_symbols->intf_Eject
|
||||
#endif
|
||||
VLC_EXPORT( int, intf_Eject, ( vlc_object_t *, const char * ) );
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* iso_lang.h: function to decode language code (in dvd or a52 for instance).
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998-2001 VideoLAN
|
||||
* $Id: iso_lang.h,v 1.5 2002/05/20 22:36:42 sam Exp $
|
||||
* $Id: iso_lang.h,v 1.6 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Author: Stéphane Borel <stef@via.ecp.fr>
|
||||
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
|
||||
@ -31,15 +31,8 @@ struct iso639_lang_s
|
||||
char * psz_iso639_2B; /* ISO-639-2/B (3 characters) native code */
|
||||
};
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
const iso639_lang_t * GetLang_1( const char * psz_iso639_1 );
|
||||
const iso639_lang_t * GetLang_2T( const char * psz_iso639_2T );
|
||||
const iso639_lang_t * GetLang_2B( const char * psz_iso639_2B );
|
||||
const char * DecodeLanguage( u16 );
|
||||
#else
|
||||
# define GetLang_1 p_symbols->GetLang_1
|
||||
# define GetLang_2T p_symbols->GetLang_2T
|
||||
# define GetLang_2B p_symbols->GetLang_2B
|
||||
# define DecodeLanguage p_symbols->DecodeLanguage
|
||||
#endif
|
||||
VLC_EXPORT( const iso639_lang_t *, GetLang_1, ( const char * ) );
|
||||
VLC_EXPORT( const iso639_lang_t *, GetLang_2T, ( const char * ) );
|
||||
VLC_EXPORT( const iso639_lang_t *, GetLang_2B, ( const char * ) );
|
||||
VLC_EXPORT( const char *, DecodeLanguage, ( u16 ) );
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
* main.h: access to all program variables
|
||||
* Declaration and extern access to global program object.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: main.h,v 1.35 2002/04/27 22:11:22 gbazin Exp $
|
||||
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
|
||||
* $Id: main.h,v 1.36 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -23,7 +23,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* main_t, p_main (global variable)
|
||||
* vlc_t, p_vlc (global variable)
|
||||
*****************************************************************************
|
||||
* This structure has an unique instance, declared in main and pointed by the
|
||||
* only global variable of the program. It should allow access to any variable
|
||||
@ -32,26 +32,24 @@
|
||||
* it when you can access the members you need in an other way. In fact, it
|
||||
* should only be used by interface thread.
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct main_s
|
||||
struct vlc_s
|
||||
{
|
||||
/* Private data */
|
||||
struct main_sys_s* p_sys; /* for system specific properties */
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* The vlc structure status */
|
||||
int i_status;
|
||||
|
||||
/* Global properties */
|
||||
int i_argc; /* command line arguments count */
|
||||
char ** ppsz_argv; /* command line arguments */
|
||||
char * psz_arg0; /* program name (whithout path) */
|
||||
char * psz_homedir; /* user's home directory */
|
||||
|
||||
u32 i_cpu_capabilities; /* CPU extensions */
|
||||
int i_warning_level; /* warning messages level */
|
||||
boolean_t b_stats; /* display statistics ? */
|
||||
|
||||
/* Generic settings */
|
||||
boolean_t b_audio; /* is audio output allowed ? */
|
||||
boolean_t b_video; /* is video output allowed ? */
|
||||
boolean_t b_stereo;
|
||||
vlc_bool_t b_quiet; /* be quiet ? */
|
||||
vlc_bool_t b_verbose; /* info messages ? */
|
||||
vlc_bool_t b_color; /* color messages ? */
|
||||
mtime_t i_desync; /* relative desync of the audio ouput */
|
||||
|
||||
/* Fast memcpy plugin used */
|
||||
@ -59,27 +57,27 @@ typedef struct main_s
|
||||
void* ( *pf_memcpy ) ( void *, const void *, size_t );
|
||||
void* ( *pf_memset ) ( void *, int, size_t ); /* FIXME: unimplemented */
|
||||
|
||||
/* Unique threads */
|
||||
p_intf_thread_t p_intf; /* main interface thread */
|
||||
/* The module bank */
|
||||
module_bank_t module_bank;
|
||||
|
||||
/* Shared data - these structures are accessed directly from p_main by
|
||||
/* The message bank */
|
||||
msg_bank_t msg_bank;
|
||||
|
||||
/* Shared data - these structures are accessed directly from p_vlc by
|
||||
* several modules */
|
||||
p_playlist_t p_playlist; /* playlist */
|
||||
p_intf_msg_t p_msg; /* messages interface data */
|
||||
p_input_channel_t p_channel; /* channel library data */
|
||||
intf_msg_t * p_msg; /* messages interface data */
|
||||
input_channel_t * p_channel; /* channel library data */
|
||||
|
||||
/* Locks */
|
||||
vlc_mutex_t config_lock; /* lock for the config file */
|
||||
} main_t;
|
||||
vlc_mutex_t structure_lock; /* lock for the p_vlc tree */
|
||||
int i_counter; /* object counter */
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
extern main_t *p_main;
|
||||
#else
|
||||
# define p_main (p_symbols->p_main)
|
||||
#endif
|
||||
/* Pointer to the big, evil global lock */
|
||||
vlc_mutex_t * p_global_lock;
|
||||
void ** pp_global_data;
|
||||
|
||||
/* Private data */
|
||||
main_sys_t* p_sys; /* for system specific properties */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Fast memory operation module
|
||||
*****************************************************************************/
|
||||
#define FAST_MEMCPY p_main->pf_memcpy
|
||||
#define FAST_MEMSET p_main->pf_memset
|
||||
|
@ -2,7 +2,7 @@
|
||||
* modules.h : Module management functions.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules.h,v 1.51 2002/05/30 08:17:04 gbazin Exp $
|
||||
* $Id: modules.h,v 1.52 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -39,78 +39,70 @@ typedef void * module_handle_t;
|
||||
/*****************************************************************************
|
||||
* Module capabilities.
|
||||
*****************************************************************************/
|
||||
static inline char *GetCapabilityName( unsigned int i_capa )
|
||||
{
|
||||
/* The sole purpose of this inline function and the ugly #defines
|
||||
* around it is to avoid having two places to modify when adding a
|
||||
* new capability. */
|
||||
static char *pp_capa[] =
|
||||
{
|
||||
"main",
|
||||
#define MODULE_CAPABILITY_MAIN 0 /* Main */
|
||||
"interface",
|
||||
#define MODULE_CAPABILITY_INTF 1 /* Interface */
|
||||
"access",
|
||||
#define MODULE_CAPABILITY_ACCESS 2 /* Input */
|
||||
"demux",
|
||||
#define MODULE_CAPABILITY_DEMUX 3 /* Input */
|
||||
"network",
|
||||
#define MODULE_CAPABILITY_NETWORK 4 /* Network */
|
||||
"decoder",
|
||||
#define MODULE_CAPABILITY_DECODER 5 /* Audio or video decoder */
|
||||
"motion",
|
||||
#define MODULE_CAPABILITY_MOTION 6 /* Motion compensation */
|
||||
"iDCT",
|
||||
#define MODULE_CAPABILITY_IDCT 7 /* IDCT transformation */
|
||||
"audio output",
|
||||
#define MODULE_CAPABILITY_AOUT 8 /* Audio output */
|
||||
"video output",
|
||||
#define MODULE_CAPABILITY_VOUT 9 /* Video output */
|
||||
"chroma transformation",
|
||||
#define MODULE_CAPABILITY_CHROMA 10 /* colorspace conversion */
|
||||
"iMDCT",
|
||||
#define MODULE_CAPABILITY_IMDCT 11 /* IMDCT transformation */
|
||||
"downmix",
|
||||
#define MODULE_CAPABILITY_DOWNMIX 12 /* AC3 downmix */
|
||||
"memcpy",
|
||||
#define MODULE_CAPABILITY_MEMCPY 13 /* memcpy */
|
||||
"unknown"
|
||||
#define MODULE_CAPABILITY_MAX 14 /* Total number of capabilities */
|
||||
};
|
||||
|
||||
return pp_capa[ (i_capa) > MODULE_CAPABILITY_MAX ? MODULE_CAPABILITY_MAX :
|
||||
(i_capa) ];
|
||||
}
|
||||
#define DECLARE_MODULE_CAPABILITY_TABLE \
|
||||
static const char *ppsz_capabilities[] = \
|
||||
{ \
|
||||
"main", \
|
||||
"interface", \
|
||||
"access", \
|
||||
"demux", \
|
||||
"network", \
|
||||
"decoder", \
|
||||
"motion", \
|
||||
"iDCT", \
|
||||
"audio output", \
|
||||
"video output", \
|
||||
"chroma transformation", \
|
||||
"iMDCT", \
|
||||
"downmix", \
|
||||
"memcpy", \
|
||||
"unknown" \
|
||||
}
|
||||
|
||||
#define MODULE_CAPABILITY( i_capa ) \
|
||||
ppsz_capabilities[ ((i_capa) > MODULE_CAPABILITY_MAX) ? \
|
||||
MODULE_CAPABILITY_MAX : (i_capa) ]
|
||||
|
||||
/*****************************************************************************
|
||||
* module_bank_t, p_module_bank (global variable)
|
||||
* module_bank_t: the module bank
|
||||
*****************************************************************************
|
||||
* This global variable is accessed by any function using modules.
|
||||
* This variable is accessed by any function using modules.
|
||||
*****************************************************************************/
|
||||
typedef struct module_bank_s
|
||||
struct module_bank_s
|
||||
{
|
||||
struct module_s * first; /* First module in the bank */
|
||||
int i_count; /* Number of allocated modules */
|
||||
module_t * first; /* First module in the bank */
|
||||
int i_count; /* Number of allocated modules */
|
||||
|
||||
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful *
|
||||
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful *
|
||||
it is to design thread-safe linked lists */
|
||||
} module_bank_t;
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
extern module_bank_t *p_module_bank;
|
||||
#else
|
||||
# define p_module_bank (p_symbols->p_module_bank)
|
||||
#endif
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Module description structure
|
||||
*****************************************************************************/
|
||||
typedef struct module_s
|
||||
struct module_s
|
||||
{
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/*
|
||||
* Variables set by the module to identify itself
|
||||
*/
|
||||
char *psz_name; /* Module _unique_ name */
|
||||
char *psz_longname; /* Module descriptive name */
|
||||
|
||||
/*
|
||||
@ -124,12 +116,12 @@ typedef struct module_s
|
||||
|
||||
u32 i_cpu_capabilities; /* Required CPU capabilities */
|
||||
|
||||
struct module_functions_s *p_functions; /* Capability functions */
|
||||
module_functions_t *p_functions; /* Capability functions */
|
||||
|
||||
/*
|
||||
* Variables set by the module to store its config options
|
||||
*/
|
||||
struct module_config_s *p_config; /* Module configuration structure */
|
||||
module_config_t *p_config; /* Module configuration structure */
|
||||
vlc_mutex_t config_lock; /* lock used to modify the config */
|
||||
unsigned int i_config_items; /* number of configuration items */
|
||||
unsigned int i_bool_items; /* number of bool config items */
|
||||
@ -137,7 +129,7 @@ typedef struct module_s
|
||||
/*
|
||||
* Variables used internally by the module manager
|
||||
*/
|
||||
boolean_t b_builtin; /* Set to true if the module is built in */
|
||||
vlc_bool_t b_builtin; /* Set to true if the module is built in */
|
||||
|
||||
union
|
||||
{
|
||||
@ -150,7 +142,7 @@ typedef struct module_s
|
||||
|
||||
struct
|
||||
{
|
||||
int ( *pf_deactivate ) ( struct module_s * );
|
||||
int ( *pf_deactivate ) ( module_t * );
|
||||
|
||||
} builtin;
|
||||
|
||||
@ -159,15 +151,14 @@ typedef struct module_s
|
||||
int i_usage; /* Reference counter */
|
||||
int i_unused_delay; /* Delay until module is unloaded */
|
||||
|
||||
struct module_s *next; /* Next module */
|
||||
struct module_s *prev; /* Previous module */
|
||||
module_t *next; /* Next module */
|
||||
module_t *prev; /* Previous module */
|
||||
|
||||
/*
|
||||
* Symbol table we send to the module so that it can access vlc symbols
|
||||
*/
|
||||
struct module_symbols_s *p_symbols;
|
||||
|
||||
} module_t;
|
||||
module_symbols_t *p_symbols;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Module functions description structure
|
||||
@ -179,61 +170,57 @@ typedef struct function_list_s
|
||||
/* Interface plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_open ) ( struct intf_thread_s * );
|
||||
void ( * pf_close )( struct intf_thread_s * );
|
||||
void ( * pf_run ) ( struct intf_thread_s * );
|
||||
int ( * pf_open ) ( intf_thread_t * );
|
||||
void ( * pf_close )( intf_thread_t * );
|
||||
void ( * pf_run ) ( intf_thread_t * );
|
||||
} intf;
|
||||
|
||||
/* Access plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_open ) ( struct input_thread_s * );
|
||||
void ( * pf_close )( struct input_thread_s * );
|
||||
ssize_t ( * pf_read ) ( struct input_thread_s *, byte_t *, size_t );
|
||||
void ( * pf_seek ) ( struct input_thread_s *, off_t );
|
||||
int ( * pf_set_program ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s * );
|
||||
int ( * pf_set_area ) ( struct input_thread_s *,
|
||||
struct input_area_s * );
|
||||
int ( * pf_open ) ( input_thread_t * );
|
||||
void ( * pf_close ) ( input_thread_t * );
|
||||
ssize_t ( * pf_read ) ( input_thread_t *, byte_t *, size_t );
|
||||
void ( * pf_seek ) ( input_thread_t *, off_t );
|
||||
int ( * pf_set_program ) ( input_thread_t *, pgrm_descriptor_t * );
|
||||
int ( * pf_set_area ) ( input_thread_t *, input_area_t * );
|
||||
} access;
|
||||
|
||||
/* Demux plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_init ) ( struct input_thread_s * );
|
||||
void ( * pf_end ) ( struct input_thread_s * );
|
||||
int ( * pf_demux )( struct input_thread_s * );
|
||||
int ( * pf_rewind ) ( struct input_thread_s * );
|
||||
int ( * pf_init ) ( input_thread_t * );
|
||||
void ( * pf_end ) ( input_thread_t * );
|
||||
int ( * pf_demux ) ( input_thread_t * );
|
||||
int ( * pf_rewind ) ( input_thread_t * );
|
||||
} demux;
|
||||
|
||||
/* Network plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_open )( struct network_socket_s * );
|
||||
int ( * pf_open ) ( vlc_object_t *, network_socket_t * );
|
||||
} network;
|
||||
|
||||
/* Audio output plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_open ) ( struct aout_thread_s * );
|
||||
int ( * pf_setformat ) ( struct aout_thread_s * );
|
||||
int ( * pf_getbufinfo ) ( struct aout_thread_s *, int );
|
||||
void ( * pf_play ) ( struct aout_thread_s *, byte_t *, int );
|
||||
void ( * pf_close ) ( struct aout_thread_s * );
|
||||
int ( * pf_open ) ( aout_thread_t * );
|
||||
int ( * pf_setformat ) ( aout_thread_t * );
|
||||
int ( * pf_getbufinfo ) ( aout_thread_t *, int );
|
||||
void ( * pf_play ) ( aout_thread_t *, byte_t *, int );
|
||||
void ( * pf_close ) ( aout_thread_t * );
|
||||
} aout;
|
||||
|
||||
/* Video output plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_create ) ( struct vout_thread_s * );
|
||||
int ( * pf_init ) ( struct vout_thread_s * );
|
||||
void ( * pf_end ) ( struct vout_thread_s * );
|
||||
void ( * pf_destroy ) ( struct vout_thread_s * );
|
||||
int ( * pf_manage ) ( struct vout_thread_s * );
|
||||
void ( * pf_render ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( * pf_display ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
int ( * pf_create ) ( vout_thread_t * );
|
||||
int ( * pf_init ) ( vout_thread_t * );
|
||||
void ( * pf_end ) ( vout_thread_t * );
|
||||
void ( * pf_destroy ) ( vout_thread_t * );
|
||||
int ( * pf_manage ) ( vout_thread_t * );
|
||||
void ( * pf_render ) ( vout_thread_t *, picture_t * );
|
||||
void ( * pf_display ) ( vout_thread_t *, picture_t * );
|
||||
} vout;
|
||||
|
||||
/* Motion compensation plugin */
|
||||
@ -261,34 +248,30 @@ typedef struct function_list_s
|
||||
/* Chroma transformation plugin */
|
||||
struct
|
||||
{
|
||||
int ( * pf_init ) ( struct vout_thread_s * );
|
||||
void ( * pf_end ) ( struct vout_thread_s * );
|
||||
int ( * pf_init ) ( vout_thread_t * );
|
||||
void ( * pf_end ) ( vout_thread_t * );
|
||||
} chroma;
|
||||
|
||||
/* IMDCT plugin */
|
||||
struct
|
||||
{
|
||||
void ( * pf_imdct_init ) ( struct imdct_s * );
|
||||
void ( * pf_imdct_256 ) ( struct imdct_s *,
|
||||
float data[], float delay[] );
|
||||
void ( * pf_imdct_256_nol )( struct imdct_s *,
|
||||
float data[], float delay[] );
|
||||
void ( * pf_imdct_512 ) ( struct imdct_s *,
|
||||
float data[], float delay[] );
|
||||
void ( * pf_imdct_512_nol )( struct imdct_s *,
|
||||
float data[], float delay[] );
|
||||
// void ( * pf_fft_64p ) ( struct complex_s * );
|
||||
void ( * pf_imdct_init ) ( imdct_t * );
|
||||
void ( * pf_imdct_256 ) ( imdct_t *, float [], float [] );
|
||||
void ( * pf_imdct_256_nol )( imdct_t *, float [], float [] );
|
||||
void ( * pf_imdct_512 ) ( imdct_t *, float [], float [] );
|
||||
void ( * pf_imdct_512_nol )( imdct_t *, float [], float [] );
|
||||
// void ( * pf_fft_64p ) ( complex_t * );
|
||||
|
||||
} imdct;
|
||||
|
||||
/* AC3 downmix plugin */
|
||||
struct
|
||||
{
|
||||
void ( * pf_downmix_3f_2r_to_2ch ) ( float *, struct dm_par_s * );
|
||||
void ( * pf_downmix_3f_1r_to_2ch ) ( float *, struct dm_par_s * );
|
||||
void ( * pf_downmix_2f_2r_to_2ch ) ( float *, struct dm_par_s * );
|
||||
void ( * pf_downmix_2f_1r_to_2ch ) ( float *, struct dm_par_s * );
|
||||
void ( * pf_downmix_3f_0r_to_2ch ) ( float *, struct dm_par_s * );
|
||||
void ( * pf_downmix_3f_2r_to_2ch ) ( float *, dm_par_t * );
|
||||
void ( * pf_downmix_3f_1r_to_2ch ) ( float *, dm_par_t * );
|
||||
void ( * pf_downmix_2f_2r_to_2ch ) ( float *, dm_par_t * );
|
||||
void ( * pf_downmix_2f_1r_to_2ch ) ( float *, dm_par_t * );
|
||||
void ( * pf_downmix_3f_0r_to_2ch ) ( float *, dm_par_t * );
|
||||
void ( * pf_stream_sample_2ch_to_s16 ) ( s16 *, float *, float * );
|
||||
void ( * pf_stream_sample_1ch_to_s16 ) ( s16 *, float * );
|
||||
|
||||
@ -298,7 +281,7 @@ typedef struct function_list_s
|
||||
struct
|
||||
{
|
||||
int ( * pf_probe)( u8 * p_es );
|
||||
int ( * pf_run ) ( struct decoder_config_s * p_config );
|
||||
int ( * pf_run ) ( decoder_fifo_t * p_fifo );
|
||||
} dec;
|
||||
|
||||
/* memcpy plugins */
|
||||
@ -312,7 +295,7 @@ typedef struct function_list_s
|
||||
|
||||
} function_list_t;
|
||||
|
||||
typedef struct module_functions_s
|
||||
struct module_functions_s
|
||||
{
|
||||
/* XXX: The order here has to be the same as above for the #defines */
|
||||
function_list_t intf;
|
||||
@ -328,26 +311,21 @@ typedef struct module_functions_s
|
||||
function_list_t imdct;
|
||||
function_list_t downmix;
|
||||
function_list_t memcpy;
|
||||
|
||||
} module_functions_t;
|
||||
|
||||
typedef struct module_functions_s * p_module_functions_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Exported functions.
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void module_InitBank ( void );
|
||||
void module_LoadMain ( void );
|
||||
void module_LoadBuiltins ( void );
|
||||
void module_LoadPlugins ( void );
|
||||
void module_EndBank ( void );
|
||||
void module_ResetBank ( void );
|
||||
void module_ManageBank ( void );
|
||||
module_t * module_Need ( int, char *, void * );
|
||||
void module_Unneed ( module_t * );
|
||||
void module_InitBank ( vlc_object_t * );
|
||||
void module_LoadMain ( vlc_object_t * );
|
||||
void module_LoadBuiltins ( vlc_object_t * );
|
||||
void module_LoadPlugins ( vlc_object_t * );
|
||||
void module_EndBank ( vlc_object_t * );
|
||||
void module_ResetBank ( vlc_object_t * );
|
||||
void module_ManageBank ( vlc_object_t * );
|
||||
|
||||
VLC_EXPORT( module_t *, __module_Need, ( vlc_object_t *, int, char *, void * ) );
|
||||
VLC_EXPORT( void, module_Unneed, ( module_t * ) );
|
||||
|
||||
#define module_Need(a,b,c,d) __module_Need(CAST_TO_VLC_OBJECT(a),b,c,d)
|
||||
|
||||
#else
|
||||
# define module_Need p_symbols->module_Need
|
||||
# define module_Unneed p_symbols->module_Unneed
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* modules_inner.h : Macros used from within a module.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: modules_inner.h,v 1.22 2002/05/30 08:17:04 gbazin Exp $
|
||||
* $Id: modules_inner.h,v 1.23 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -22,10 +22,10 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* Check that we are within a module.
|
||||
* If we are not within a module, assume we're in the vlc core.
|
||||
*****************************************************************************/
|
||||
#if !( defined( MODULE_NAME ) || defined( MAKE_DEP ) )
|
||||
# error "You must define MODULE_NAME before using modules_inner.h !"
|
||||
#if !defined( __PLUGIN__ ) && !defined( __BUILTIN__ )
|
||||
# define MODULE_NAME main
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
@ -36,7 +36,6 @@
|
||||
*
|
||||
* if user has #defined MODULE_NAME foo, then we will need:
|
||||
* #define MODULE_STRING "foo"
|
||||
* #define MODULE_VAR(blah) "VLC_MODULE_foo_blah"
|
||||
*
|
||||
* and, if __BUILTIN__ is set, we will also need:
|
||||
* #define MODULE_FUNC( zog ) module_foo_zog
|
||||
@ -51,16 +50,14 @@
|
||||
#define CONCATENATE( y, z ) CRUDE_HACK( y, z )
|
||||
#define CRUDE_HACK( y, z ) y##__MODULE_##z
|
||||
|
||||
#define MODULE_VAR( z ) "VLC_MODULE_" #z
|
||||
|
||||
/* If the module is built-in, then we need to define foo_InitModule instead
|
||||
* of InitModule. Same for Activate- and DeactivateModule. */
|
||||
#ifdef __BUILTIN__
|
||||
#if defined( __BUILTIN__ )
|
||||
# define _M( function ) CONCATENATE( function, MODULE_NAME )
|
||||
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )
|
||||
# define DECLARE_SYMBOLS ;
|
||||
# define STORE_SYMBOLS ;
|
||||
#else
|
||||
#elif defined( __PLUGIN__ )
|
||||
# define _M( function ) function
|
||||
# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL )
|
||||
# define DECLARE_SYMBOLS module_symbols_t* p_symbols;
|
||||
@ -80,9 +77,8 @@
|
||||
int __VLC_SYMBOL( InitModule ) ( module_t *p_module ) \
|
||||
{ \
|
||||
int i_shortcut = 1; \
|
||||
struct module_config_s* p_item; \
|
||||
STORE_SYMBOLS; \
|
||||
p_module->psz_name = MODULE_STRING; \
|
||||
p_module->psz_object_name = MODULE_STRING; \
|
||||
p_module->psz_longname = MODULE_STRING; \
|
||||
p_module->psz_program = NULL; \
|
||||
p_module->pp_shortcuts[ 0 ] = MODULE_STRING; \
|
||||
@ -93,31 +89,13 @@
|
||||
#define MODULE_INIT_STOP \
|
||||
} while( 0 ); \
|
||||
p_module->pp_shortcuts[ i_shortcut ] = NULL; \
|
||||
p_module->i_config_items = p_module->i_bool_items = 0; \
|
||||
for( p_item = p_config; \
|
||||
p_item->i_type != MODULE_CONFIG_HINT_END; \
|
||||
p_item++ ) \
|
||||
{ \
|
||||
if( p_item->i_type & MODULE_CONFIG_ITEM ) \
|
||||
p_module->i_config_items++; \
|
||||
if( p_item->i_type == MODULE_CONFIG_ITEM_BOOL ) \
|
||||
p_module->i_bool_items++; \
|
||||
} \
|
||||
vlc_mutex_init( &p_module->config_lock ); \
|
||||
p_module->p_config = config_Duplicate( p_config ); \
|
||||
config_Duplicate( p_module, p_config ); \
|
||||
if( p_module->p_config == NULL ) \
|
||||
{ \
|
||||
intf_ErrMsg( MODULE_STRING \
|
||||
" InitModule error: can't duplicate p_config" ); \
|
||||
return( -1 ); \
|
||||
/*//X intf_Err( p_module, "InitModule can't duplicate p_config" );*/ \
|
||||
return -1; \
|
||||
} \
|
||||
for( p_item = p_module->p_config; \
|
||||
p_item->i_type != MODULE_CONFIG_HINT_END; \
|
||||
p_item++ ) \
|
||||
{ \
|
||||
p_item->p_lock = &p_module->config_lock; \
|
||||
} \
|
||||
return( 0 ); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
#define ADD_CAPABILITY( cap, score ) \
|
||||
@ -158,7 +136,7 @@
|
||||
|
||||
#define MODULE_ACTIVATE_STOP \
|
||||
} while( 0 ); \
|
||||
return( 0 ); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -175,5 +153,5 @@
|
||||
#define MODULE_DEACTIVATE_STOP \
|
||||
} while( 0 ); \
|
||||
config_UnsetCallbacks( p_module->p_config ); \
|
||||
return( 0 ); \
|
||||
return 0; \
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Functions prototyped are implemented in interface/mtime.c.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
|
||||
* $Id: mtime.h,v 1.11 2002/04/24 00:36:24 sam Exp $
|
||||
* $Id: mtime.h,v 1.12 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -50,14 +50,8 @@
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
char * mstrtime ( char *psz_buffer, mtime_t date );
|
||||
mtime_t mdate ( void );
|
||||
void mwait ( mtime_t date );
|
||||
void msleep ( mtime_t delay );
|
||||
#else
|
||||
# define msleep p_symbols->msleep
|
||||
# define mdate p_symbols->mdate
|
||||
# define mstrtime p_symbols->mstrtime
|
||||
#endif
|
||||
VLC_EXPORT( char *, mstrtime, ( char *psz_buffer, mtime_t date ) );
|
||||
VLC_EXPORT( mtime_t, mdate, ( void ) );
|
||||
VLC_EXPORT( void, mwait, ( mtime_t date ) );
|
||||
VLC_EXPORT( void, msleep, ( mtime_t delay ) );
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* modules.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: netutils.h,v 1.19 2002/04/24 00:36:24 sam Exp $
|
||||
* $Id: netutils.h,v 1.20 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Henri Fallon <henri@videolan.org>
|
||||
@ -33,11 +33,6 @@
|
||||
struct sockaddr_in;
|
||||
int network_BuildAddr ( struct sockaddr_in *, char *, int );
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
int network_ChannelJoin ( int );
|
||||
int network_ChannelCreate ( void );
|
||||
#else
|
||||
# define network_ChannelCreate p_symbols->network_ChannelCreate
|
||||
# define network_ChannelJoin p_symbols->network_ChannelJoin
|
||||
#endif
|
||||
VLC_EXPORT( int, network_ChannelJoin, ( vlc_object_t *, int ) );
|
||||
VLC_EXPORT( int, network_ChannelCreate, ( vlc_object_t * ) );
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* network.h: interface to communicate with network plug-ins
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: network.h,v 1.1 2002/03/01 00:33:18 massiot Exp $
|
||||
* $Id: network.h,v 1.2 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -25,7 +25,7 @@
|
||||
* network_socket_t: structure passed to a network plug-in to define the
|
||||
* kind of socket we want
|
||||
*****************************************************************************/
|
||||
typedef struct network_socket_s
|
||||
struct network_socket_s
|
||||
{
|
||||
unsigned int i_type;
|
||||
|
||||
@ -38,7 +38,7 @@ typedef struct network_socket_s
|
||||
/* Return values */
|
||||
int i_handle;
|
||||
size_t i_mtu;
|
||||
} network_socket_t;
|
||||
};
|
||||
|
||||
/* Socket types */
|
||||
#define NETWORK_UDP 1
|
||||
|
@ -2,7 +2,7 @@
|
||||
* os_specific.h: OS specific features
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: os_specific.h,v 1.7 2002/04/28 09:05:37 sam Exp $
|
||||
* $Id: os_specific.h,v 1.8 2002/06/01 12:31:57 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Gildas Bazin <gbazin@netcourrier.com>
|
||||
@ -40,22 +40,17 @@
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* main_sys_t: system specific descriptor
|
||||
****************************************************************************/
|
||||
struct main_sys_s;
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifdef _NEED_OS_SPECIFIC_H
|
||||
void system_Init ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
|
||||
void system_Configure ( void );
|
||||
void system_End ( void );
|
||||
void system_Init ( vlc_object_t *, int *, char *[] );
|
||||
void system_Configure ( vlc_object_t * );
|
||||
void system_End ( vlc_object_t * );
|
||||
#else
|
||||
# define system_Init( a, b, c ) {}
|
||||
# define system_Configure( ) {}
|
||||
# define system_End( ) {}
|
||||
# define system_Configure( a ) {}
|
||||
# define system_End( a ) {}
|
||||
#endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*****************************************************************************
|
||||
* intf_playlist.h : Playlist functions
|
||||
* vlc_playlist.h : Playlist functions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: intf_playlist.h,v 1.6 2002/04/24 00:36:24 sam Exp $
|
||||
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
|
||||
* $Id: playlist.h,v 1.3 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
@ -24,12 +24,12 @@
|
||||
/*****************************************************************************
|
||||
* playlist_item_t: playlist item
|
||||
*****************************************************************************/
|
||||
typedef struct playlist_item_s
|
||||
struct playlist_item_s
|
||||
{
|
||||
char* psz_name;
|
||||
int i_type; /* unused yet */
|
||||
int i_status; /* unused yet */
|
||||
} playlist_item_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* playlist_t: playlist structure
|
||||
@ -38,22 +38,23 @@ typedef struct playlist_item_s
|
||||
* the playlist, a change lock, a dynamic array of playlist items, and a
|
||||
* current item which is an exact copy of one of the array members.
|
||||
*****************************************************************************/
|
||||
typedef struct playlist_s
|
||||
struct playlist_s
|
||||
{
|
||||
int i_index; /* current index */
|
||||
int i_size; /* total size */
|
||||
|
||||
int i_mode; /* parse mode (random, forward, backward) */
|
||||
int i_seed; /* seed used for random mode */
|
||||
boolean_t b_stopped;
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* Thread properties and lock */
|
||||
vlc_mutex_t change_lock;
|
||||
|
||||
playlist_item_t current;
|
||||
playlist_item_t* p_item;
|
||||
} playlist_t;
|
||||
int i_index; /* current index */
|
||||
int i_size; /* total size */
|
||||
playlist_item_t ** pp_items;
|
||||
|
||||
/* Used by intf_PlaylistAdd */
|
||||
int i_status;
|
||||
|
||||
input_thread_t * p_input;
|
||||
};
|
||||
|
||||
/* Used by playlist_Add */
|
||||
#define PLAYLIST_START 0
|
||||
#define PLAYLIST_END -1
|
||||
|
||||
@ -66,27 +67,30 @@ typedef struct playlist_s
|
||||
#define PLAYLIST_RANDOM 3 /* Shuffle play */
|
||||
#define PLAYLIST_REVERSE_RANDOM -3 /* Reverse shuffle play */
|
||||
|
||||
/* Playlist commands */
|
||||
#define PLAYLIST_PLAY 1 /* Starts playing. No arg. */
|
||||
#define PLAYLIST_PAUSE 2 /* Toggles playlist pause. No arg. */
|
||||
#define PLAYLIST_STOP 3 /* Stops playing. No arg. */
|
||||
#define PLAYLIST_SKIP 4 /* Skip X items and play. */
|
||||
#define PLAYLIST_GOTO 5 /* Goto Xth item. */
|
||||
#define PLAYLIST_MODE 6 /* Set playlist mode. ??? */
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
playlist_t * intf_PlaylistCreate ( void );
|
||||
void intf_PlaylistInit ( playlist_t * p_playlist );
|
||||
int intf_PlaylistAdd ( playlist_t * p_playlist,
|
||||
int i_pos, const char * psz_item );
|
||||
int intf_PlaylistDelete ( playlist_t * p_playlist, int i_pos );
|
||||
void intf_PlaylistNext ( playlist_t * p_playlist );
|
||||
void intf_PlaylistPrev ( playlist_t * p_playlist );
|
||||
void intf_PlaylistDestroy ( playlist_t * p_playlist );
|
||||
void intf_PlaylistJumpto ( playlist_t * p_playlist , int i_pos);
|
||||
void intf_UrlDecode ( char * );
|
||||
#else
|
||||
# define intf_PlaylistAdd p_symbols->intf_PlaylistAdd
|
||||
# define intf_PlaylistDelete p_symbols->intf_PlaylistDelete
|
||||
# define intf_PlaylistNext p_symbols->intf_PlaylistNext
|
||||
# define intf_PlaylistPrev p_symbols->intf_PlaylistPrev
|
||||
# define intf_PlaylistDestroy p_symbols->intf_PlaylistDestroy
|
||||
# define intf_PlaylistJumpto p_symbols->intf_PlaylistJumpto
|
||||
# define intf_UrlDecode p_symbols->intf_UrlDecode
|
||||
#endif
|
||||
playlist_t * playlist_Create ( vlc_object_t * );
|
||||
void playlist_Destroy ( playlist_t * );
|
||||
|
||||
VLC_EXPORT( void, playlist_Command, ( playlist_t *, int, int ) );
|
||||
|
||||
#define playlist_Play(p) playlist_Command(p,PLAYLIST_PLAY,0)
|
||||
#define playlist_Pause(p) playlist_Command(p,PLAYLIST_PAUSE,0)
|
||||
#define playlist_Stop(p) playlist_Command(p,PLAYLIST_STOP,0)
|
||||
#define playlist_Next(p) playlist_Command(p,PLAYLIST_SKIP,1)
|
||||
#define playlist_Prev(p) playlist_Command(p,PLAYLIST_SKIP,-1)
|
||||
#define playlist_Skip(p,i) playlist_Command(p,PLAYLIST_SKIP,i)
|
||||
#define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i)
|
||||
|
||||
VLC_EXPORT( int, playlist_Add, ( vlc_object_t *, int, const char * ) );
|
||||
VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) );
|
||||
|
@ -4,7 +4,7 @@
|
||||
* of the reading.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: stream_control.h,v 1.7 2002/01/07 02:12:29 sam Exp $
|
||||
* $Id: stream_control.h,v 1.8 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -23,6 +23,9 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _STREAM_CONTROL_H
|
||||
#define _STREAM_CONTROL_H 1
|
||||
|
||||
/* Structures exported to interface, input and decoders */
|
||||
|
||||
/*****************************************************************************
|
||||
@ -30,7 +33,7 @@
|
||||
*****************************************************************************
|
||||
* Describe the state of a program stream.
|
||||
*****************************************************************************/
|
||||
typedef struct stream_ctrl_s
|
||||
struct stream_ctrl_s
|
||||
{
|
||||
vlc_mutex_t control_lock;
|
||||
|
||||
@ -38,11 +41,11 @@ typedef struct stream_ctrl_s
|
||||
/* if i_status == FORWARD_S or BACKWARD_S */
|
||||
int i_rate;
|
||||
|
||||
boolean_t b_mute;
|
||||
boolean_t b_grayscale; /* use color or grayscale */
|
||||
vlc_bool_t b_mute;
|
||||
vlc_bool_t b_grayscale; /* use color or grayscale */
|
||||
int i_smp; /* number of symmetrical threads to launch
|
||||
* to decode the video | 0 == disabled */
|
||||
} stream_ctrl_t;
|
||||
};
|
||||
|
||||
/* Possible status : */
|
||||
#define UNDEF_S 0
|
||||
@ -57,3 +60,5 @@ typedef struct stream_ctrl_s
|
||||
#define DEFAULT_RATE 1000
|
||||
#define MINIMAL_RATE 31 /* Up to 32/1 */
|
||||
#define MAXIMAL_RATE 8000 /* Up to 1/8 */
|
||||
|
||||
#endif /* "stream_control.h" */
|
||||
|
@ -3,10 +3,10 @@
|
||||
* This header provides a portable threads implementation.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: threads_funcs.h,v 1.4 2002/05/19 23:51:37 massiot Exp $
|
||||
* $Id: threads_funcs.h,v 1.5 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
* Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -27,146 +27,41 @@
|
||||
/*****************************************************************************
|
||||
* Function definitions
|
||||
*****************************************************************************/
|
||||
VLC_EXPORT( int, __vlc_threads_init, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( int, vlc_threads_end, ( void ) );
|
||||
VLC_EXPORT( int, __vlc_mutex_init, ( vlc_object_t *, vlc_mutex_t * ) );
|
||||
VLC_EXPORT( int, __vlc_mutex_destroy, ( char *, int, vlc_mutex_t * ) );
|
||||
VLC_EXPORT( int, vlc_cond_init, ( vlc_cond_t * ) );
|
||||
VLC_EXPORT( int, __vlc_cond_destroy, ( char *, int, vlc_cond_t * ) );
|
||||
VLC_EXPORT( int, __vlc_thread_create, ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) );
|
||||
VLC_EXPORT( void, __vlc_thread_ready, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, char *, int ) );
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_threads_init: initialize threads system
|
||||
*****************************************************************************/
|
||||
static inline int vlc_threads_init( void )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_init();
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
return st_init();
|
||||
|
||||
#elif defined( WIN32 )
|
||||
return 0;
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_threads_end: stop threads system
|
||||
*****************************************************************************/
|
||||
static inline int vlc_threads_end( void )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_kill();
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( WIN32 )
|
||||
return 0;
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
#define vlc_threads_init( P_THIS ) \
|
||||
__vlc_threads_init( CAST_TO_VLC_OBJECT(P_THIS) )
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_mutex_init: initialize a mutex
|
||||
*****************************************************************************/
|
||||
static inline int vlc_mutex_init( vlc_mutex_t *p_mutex )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_mutex_init( p_mutex );
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
*p_mutex = st_mutex_new();
|
||||
return ( *p_mutex == NULL ) ? errno : 0;
|
||||
|
||||
#elif defined( WIN32 )
|
||||
/* We use mutexes on WinNT/2K/XP because we can use the SignalObjectAndWait
|
||||
* function and have a 100% correct vlc_cond_wait() implementation.
|
||||
* As this function is not available on Win9x, we can use the faster
|
||||
* CriticalSections */
|
||||
if( (GetVersion() < 0x80000000) && !p_main->p_sys->b_fast_pthread )
|
||||
{
|
||||
/* We are running on NT/2K/XP, we can use SignalObjectAndWait */
|
||||
p_mutex->mutex = CreateMutex( 0, FALSE, 0 );
|
||||
return ( p_mutex->mutex ? 0 : 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
InitializeCriticalSection( &p_mutex->csection );
|
||||
p_mutex->mutex = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
# if defined(DEBUG) && defined(SYS_LINUX)
|
||||
/* Create error-checking mutex to detect threads problems more easily. */
|
||||
pthread_mutexattr_t attr;
|
||||
int i_result;
|
||||
|
||||
pthread_mutexattr_init( &attr );
|
||||
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
|
||||
i_result = pthread_mutex_init( p_mutex, &attr );
|
||||
pthread_mutexattr_destroy( &attr );
|
||||
return( i_result );
|
||||
# endif
|
||||
|
||||
return pthread_mutex_init( p_mutex, NULL );
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
mutex_init( p_mutex );
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
|
||||
/* check the arguments and whether it's already been initialized */
|
||||
if( p_mutex == NULL )
|
||||
{
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
if( p_mutex->init == 9999 )
|
||||
{
|
||||
return EALREADY;
|
||||
}
|
||||
|
||||
p_mutex->lock = create_sem( 1, "BeMutex" );
|
||||
if( p_mutex->lock < B_NO_ERROR )
|
||||
{
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
p_mutex->init = 9999;
|
||||
return B_OK;
|
||||
|
||||
#endif
|
||||
}
|
||||
#define vlc_mutex_init( P_THIS, P_MUTEX ) \
|
||||
__vlc_mutex_init( CAST_TO_VLC_OBJECT(P_THIS), P_MUTEX )
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_mutex_lock: lock a mutex
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_mutex_lock( P_MUTEX ) \
|
||||
_vlc_mutex_lock( __FILE__, __LINE__, P_MUTEX )
|
||||
__vlc_mutex_lock( __FILE__, __LINE__, P_MUTEX )
|
||||
#else
|
||||
# define vlc_mutex_lock( P_MUTEX ) \
|
||||
_vlc_mutex_lock( "(unknown)", 0, P_MUTEX )
|
||||
__vlc_mutex_lock( "(unknown)", 0, P_MUTEX )
|
||||
#endif
|
||||
|
||||
static inline int _vlc_mutex_lock( char * psz_file, int i_line,
|
||||
vlc_mutex_t *p_mutex )
|
||||
static inline int __vlc_mutex_lock( char * psz_file, int i_line,
|
||||
vlc_mutex_t *p_mutex )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_mutex_acquire( p_mutex, TRUE, NULL );
|
||||
@ -189,8 +84,8 @@ static inline int _vlc_mutex_lock( char * psz_file, int i_line,
|
||||
int i_return = pthread_mutex_lock( p_mutex );
|
||||
if( i_return )
|
||||
{
|
||||
intf_ErrMsg( "thread %d error: mutex_lock failed at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_return) );
|
||||
// msg_Err( "thread %d: mutex_lock failed at %s:%d (%s)",
|
||||
// pthread_self(), psz_file, i_line, strerror(i_return) );
|
||||
}
|
||||
return i_return;
|
||||
|
||||
@ -222,14 +117,14 @@ static inline int _vlc_mutex_lock( char * psz_file, int i_line,
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_mutex_unlock( P_MUTEX ) \
|
||||
_vlc_mutex_unlock( __FILE__, __LINE__, P_MUTEX )
|
||||
__vlc_mutex_unlock( __FILE__, __LINE__, P_MUTEX )
|
||||
#else
|
||||
# define vlc_mutex_unlock( P_MUTEX ) \
|
||||
_vlc_mutex_unlock( "(unknown)", 0, P_MUTEX )
|
||||
__vlc_mutex_unlock( "(unknown)", 0, P_MUTEX )
|
||||
#endif
|
||||
|
||||
static inline int _vlc_mutex_unlock( char * psz_file, int i_line,
|
||||
vlc_mutex_t *p_mutex )
|
||||
static inline int __vlc_mutex_unlock( char * psz_file, int i_line,
|
||||
vlc_mutex_t *p_mutex )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_mutex_release( p_mutex );
|
||||
@ -252,8 +147,8 @@ static inline int _vlc_mutex_unlock( char * psz_file, int i_line,
|
||||
int i_return = pthread_mutex_unlock( p_mutex );
|
||||
if( i_return )
|
||||
{
|
||||
intf_ErrMsg( "thread %d error: mutex_unlock failed at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_return) );
|
||||
// msg_Err( "thread %d: mutex_unlock failed at %s:%d (%s)",
|
||||
// pthread_self(), psz_file, i_line, strerror(i_return) );
|
||||
}
|
||||
return i_return;
|
||||
|
||||
@ -283,110 +178,12 @@ static inline int _vlc_mutex_unlock( char * psz_file, int i_line,
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_mutex_destroy( P_MUTEX ) \
|
||||
_vlc_mutex_destroy( __FILE__, __LINE__, P_MUTEX )
|
||||
__vlc_mutex_destroy( __FILE__, __LINE__, P_MUTEX )
|
||||
#else
|
||||
# define vlc_mutex_destroy( P_MUTEX ) \
|
||||
_vlc_mutex_destroy( "(unknown)", 0, P_MUTEX )
|
||||
__vlc_mutex_destroy( "(unknown)", 0, P_MUTEX )
|
||||
#endif
|
||||
|
||||
static inline int _vlc_mutex_destroy( char * psz_file, int i_line,
|
||||
vlc_mutex_t *p_mutex )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
return st_mutex_destroy( *p_mutex );
|
||||
|
||||
#elif defined( WIN32 )
|
||||
if( p_mutex->mutex )
|
||||
{
|
||||
CloseHandle( p_mutex->mutex );
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteCriticalSection( &p_mutex->csection );
|
||||
}
|
||||
return 0;
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
int i_return = pthread_mutex_destroy( p_mutex );
|
||||
if( i_return )
|
||||
{
|
||||
intf_ErrMsg( "thread %d error: mutex_destroy failed at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_return) );
|
||||
}
|
||||
return i_return;
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
if( p_mutex->init == 9999 )
|
||||
{
|
||||
delete_sem( p_mutex->lock );
|
||||
}
|
||||
|
||||
p_mutex->init = 0;
|
||||
return B_OK;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_cond_init: initialize a condition
|
||||
*****************************************************************************/
|
||||
static inline int vlc_cond_init( vlc_cond_t *p_condvar )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_cond_init( p_condvar );
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
*p_condvar = st_cond_new();
|
||||
return ( *p_condvar == NULL ) ? errno : 0;
|
||||
|
||||
#elif defined( WIN32 )
|
||||
/* initialise counter */
|
||||
p_condvar->i_waiting_threads = 0;
|
||||
|
||||
/* Create an auto-reset event. */
|
||||
p_condvar->signal = CreateEvent( NULL, /* no security */
|
||||
FALSE, /* auto-reset event */
|
||||
FALSE, /* non-signaled initially */
|
||||
NULL ); /* unnamed */
|
||||
|
||||
return( !p_condvar->signal );
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
return pthread_cond_init( p_condvar, NULL );
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
/* condition_init() */
|
||||
spin_lock_init( &p_condvar->lock );
|
||||
cthread_queue_init( &p_condvar->queue );
|
||||
p_condvar->name = 0;
|
||||
p_condvar->implications = 0;
|
||||
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
if( !p_condvar )
|
||||
{
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
||||
if( p_condvar->init == 9999 )
|
||||
{
|
||||
return EALREADY;
|
||||
}
|
||||
|
||||
p_condvar->thread = -1;
|
||||
p_condvar->init = 9999;
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_cond_signal: start a thread on condition completion
|
||||
*****************************************************************************/
|
||||
@ -536,16 +333,15 @@ static inline int vlc_cond_broadcast( vlc_cond_t *p_condvar )
|
||||
* vlc_cond_wait: wait until condition completion
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_cond_wait( P_COND, P_MUTEX ) \
|
||||
_vlc_cond_wait( __FILE__, __LINE__, P_COND, P_MUTEX )
|
||||
# define vlc_cond_wait( P_COND, P_MUTEX ) \
|
||||
__vlc_cond_wait( __FILE__, __LINE__, P_COND, P_MUTEX )
|
||||
#else
|
||||
# define vlc_cond_wait( P_COND, P_MUTEX ) \
|
||||
_vlc_cond_wait( "(unknown)", 0, P_COND, P_MUTEX )
|
||||
# define vlc_cond_wait( P_COND, P_MUTEX ) \
|
||||
__vlc_cond_wait( "(unknown)", 0, P_COND, P_MUTEX )
|
||||
#endif
|
||||
|
||||
static inline int _vlc_cond_wait( char * psz_file, int i_line,
|
||||
vlc_cond_t *p_condvar,
|
||||
vlc_mutex_t *p_mutex )
|
||||
static inline int __vlc_cond_wait( char * psz_file, int i_line,
|
||||
vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return pth_cond_await( p_condvar, p_mutex, NULL );
|
||||
@ -575,8 +371,8 @@ static inline int _vlc_cond_wait( char * psz_file, int i_line,
|
||||
|
||||
if( p_mutex->mutex )
|
||||
{
|
||||
p_main->p_sys->SignalObjectAndWait( p_mutex->mutex, p_condvar->signal,
|
||||
INFINITE, FALSE );
|
||||
p_mutex->SignalObjectAndWait( p_mutex->mutex, p_condvar->signal,
|
||||
INFINITE, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -593,9 +389,7 @@ static inline int _vlc_cond_wait( char * psz_file, int i_line,
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
|
||||
#ifndef DEBUG
|
||||
return pthread_cond_wait( p_condvar, p_mutex );
|
||||
#else
|
||||
# ifdef DEBUG
|
||||
/* In debug mode, timeout */
|
||||
struct timeval now;
|
||||
struct timespec timeout;
|
||||
@ -611,19 +405,22 @@ static inline int _vlc_cond_wait( char * psz_file, int i_line,
|
||||
|
||||
if( i_result == ETIMEDOUT )
|
||||
{
|
||||
intf_WarnMsg( 1, "thread %d warning: Possible deadlock detected in cond_wait at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_result) );
|
||||
//X msg_Warn( "thread %d: possible deadlock detected "
|
||||
//X "in cond_wait at %s:%d (%s)", pthread_self(),
|
||||
//X psz_file, i_line, strerror(i_result) );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( i_result )
|
||||
{
|
||||
intf_ErrMsg( "thread %d error: cond_wait failed at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_result) );
|
||||
//X msg_Err( "thread %d: cond_wait failed at %s:%d (%s)",
|
||||
//X pthread_self(), psz_file, i_line, strerror(i_result) );
|
||||
}
|
||||
return( i_result );
|
||||
}
|
||||
#endif
|
||||
# else
|
||||
return pthread_cond_wait( p_condvar, p_mutex );
|
||||
# endif
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
|
||||
@ -664,239 +461,32 @@ static inline int _vlc_cond_wait( char * psz_file, int i_line,
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_cond_destroy( P_COND ) \
|
||||
_vlc_cond_destroy( __FILE__, __LINE__, P_COND )
|
||||
__vlc_cond_destroy( __FILE__, __LINE__, P_COND )
|
||||
#else
|
||||
# define vlc_cond_destroy( P_COND ) \
|
||||
_vlc_cond_destroy( "(unknown)", 0, P_COND )
|
||||
__vlc_cond_destroy( "(unknown)", 0, P_COND )
|
||||
#endif
|
||||
|
||||
static inline int _vlc_cond_destroy( char * psz_file, int i_line,
|
||||
vlc_cond_t *p_condvar )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
return st_cond_destroy( *p_condvar );
|
||||
|
||||
#elif defined( WIN32 )
|
||||
return( !CloseHandle( p_condvar->signal ) );
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
int i_result = pthread_cond_destroy( p_condvar );
|
||||
if( i_result )
|
||||
{
|
||||
intf_ErrMsg( "thread %d error: cond_destroy failed at %s:%d (%s)",
|
||||
pthread_self(), psz_file, i_line, strerror(i_result) );
|
||||
}
|
||||
return i_result;
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
return 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
p_condvar->init = 0;
|
||||
return 0;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_thread_create: create a thread
|
||||
*****************************************************************************/
|
||||
#define vlc_thread_create( P_THREAD, PSZ_NAME, FUNC, P_DATA ) \
|
||||
_vlc_thread_create( __FILE__, __LINE__, P_THREAD, PSZ_NAME, FUNC, P_DATA )
|
||||
|
||||
static inline int _vlc_thread_create( char * psz_file, int i_line,
|
||||
vlc_thread_t *p_thread, char *psz_name,
|
||||
vlc_thread_func_t func, void *p_data )
|
||||
{
|
||||
int i_ret;
|
||||
|
||||
#ifdef GPROF
|
||||
wrapper_t wrapper;
|
||||
|
||||
/* Initialize the wrapper structure */
|
||||
wrapper.func = func;
|
||||
wrapper.p_data = p_data;
|
||||
getitimer( ITIMER_PROF, &wrapper.itimer );
|
||||
vlc_mutex_init( &wrapper.lock );
|
||||
vlc_cond_init( &wrapper.wait );
|
||||
vlc_mutex_lock( &wrapper.lock );
|
||||
|
||||
/* Alter user-passed data so that we call the wrapper instead
|
||||
* of the real function */
|
||||
p_data = &wrapper;
|
||||
func = vlc_thread_wrapper;
|
||||
#endif
|
||||
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
*p_thread = pth_spawn( PTH_ATTR_DEFAULT, func, p_data );
|
||||
i_ret = ( p_thread == NULL );
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
*p_thread = st_thread_create( func, p_data, 1, 0 );
|
||||
i_ret = ( p_thread == NULL );
|
||||
|
||||
#elif defined( WIN32 )
|
||||
unsigned threadID;
|
||||
/* When using the MSVCRT C library you have to use the _beginthreadex
|
||||
* function instead of CreateThread, otherwise you'll end up with memory
|
||||
* leaks and the signal functions not working */
|
||||
*p_thread = (HANDLE)_beginthreadex( NULL, 0, (PTHREAD_START) func,
|
||||
p_data, 0, &threadID );
|
||||
|
||||
i_ret = ( *p_thread ? 0 : 1 );
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
i_ret = pthread_create( p_thread, NULL, func, p_data );
|
||||
|
||||
#ifdef SYS_DARWIN
|
||||
{
|
||||
struct sched_param param;
|
||||
param.sched_priority = 10;
|
||||
if (pthread_setschedparam(*p_thread, SCHED_RR, ¶m))
|
||||
{
|
||||
intf_ErrMsg("pthread_setschedparam failed");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
*p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
|
||||
i_ret = 0;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
*p_thread = spawn_thread( (thread_func)func, psz_name,
|
||||
B_NORMAL_PRIORITY, p_data );
|
||||
i_ret = resume_thread( *p_thread );
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef GPROF
|
||||
if( i_ret == 0 )
|
||||
{
|
||||
vlc_cond_wait( &wrapper.wait, &wrapper.lock );
|
||||
}
|
||||
|
||||
vlc_mutex_unlock( &wrapper.lock );
|
||||
vlc_mutex_destroy( &wrapper.lock );
|
||||
vlc_cond_destroy( &wrapper.wait );
|
||||
#endif
|
||||
|
||||
if( i_ret == 0 )
|
||||
{
|
||||
intf_WarnMsg( 2, "thread info: %d (%s) has been created (%s:%d)",
|
||||
*p_thread, psz_name, psz_file, i_line );
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_ErrMsg( "thread error: %s couldn't be created at %s:%d (%s)",
|
||||
psz_name, psz_file, i_line, strerror(i_ret) );
|
||||
}
|
||||
|
||||
return i_ret;
|
||||
}
|
||||
# define vlc_thread_create( P_THIS, PSZ_NAME, FUNC, WAIT ) \
|
||||
__vlc_thread_create( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, (void * ( * ) ( void * ))FUNC, WAIT )
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_thread_exit: terminate a thread
|
||||
* vlc_thread_ready: tell the parent thread we were successfully spawned
|
||||
*****************************************************************************/
|
||||
static inline void vlc_thread_exit( void )
|
||||
{
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
pth_exit( 0 );
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
int result;
|
||||
st_thread_exit( &result );
|
||||
|
||||
#elif defined( WIN32 )
|
||||
/* For now we don't close the thread handles (because of race conditions).
|
||||
* Need to be looked at. */
|
||||
_endthreadex(0);
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
pthread_exit( 0 );
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
int result;
|
||||
cthread_exit( &result );
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
exit_thread( 0 );
|
||||
|
||||
#endif
|
||||
}
|
||||
# define vlc_thread_ready( P_THIS ) \
|
||||
__vlc_thread_ready( CAST_TO_VLC_OBJECT(P_THIS) )
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_thread_join: wait until a thread exits
|
||||
*****************************************************************************/
|
||||
#ifdef DEBUG
|
||||
# define vlc_thread_join( THREAD ) \
|
||||
_vlc_thread_join( __FILE__, __LINE__, THREAD )
|
||||
# define vlc_thread_join( P_THIS ) \
|
||||
__vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), __FILE__, __LINE__ )
|
||||
#else
|
||||
# define vlc_thread_join( THREAD ) \
|
||||
_vlc_thread_join( "(unknown)", 0, THREAD )
|
||||
# define vlc_thread_join( P_THIS ) \
|
||||
__vlc_thread_join( CAST_TO_VLC_OBJECT(P_THIS), "(unknown)", 0 )
|
||||
#endif
|
||||
|
||||
static inline void _vlc_thread_join( char * psz_file, int i_line,
|
||||
vlc_thread_t thread )
|
||||
{
|
||||
int i_ret = 0;
|
||||
|
||||
#if defined( PTH_INIT_IN_PTH_H )
|
||||
i_ret = pth_join( thread, NULL );
|
||||
|
||||
#elif defined( ST_INIT_IN_ST_H )
|
||||
i_ret = st_thread_join( thread, NULL );
|
||||
|
||||
#elif defined( WIN32 )
|
||||
WaitForSingleObject( thread, INFINITE );
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
|
||||
i_ret = pthread_join( thread, NULL );
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H )
|
||||
cthread_join( thread );
|
||||
i_ret = 1;
|
||||
|
||||
#elif defined( HAVE_KERNEL_SCHEDULER_H )
|
||||
int32 exit_value;
|
||||
wait_for_thread( thread, &exit_value );
|
||||
|
||||
#endif
|
||||
|
||||
if( i_ret )
|
||||
{
|
||||
intf_ErrMsg( "thread error: thread_join(%d) failed at %s:%d (%s)",
|
||||
thread, psz_file, i_line, strerror(i_ret) );
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_WarnMsg( 2, "thread info: %d has been joined (%s:%d)",
|
||||
thread, psz_file, i_line );
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* vlc_thread_wrapper: wrapper around thread functions used when profiling.
|
||||
*****************************************************************************/
|
||||
#ifdef GPROF
|
||||
static void *vlc_thread_wrapper( void *p_wrapper )
|
||||
{
|
||||
/* Put user data in thread-local variables */
|
||||
void * p_data = ((wrapper_t*)p_wrapper)->p_data;
|
||||
vlc_thread_func_t func = ((wrapper_t*)p_wrapper)->func;
|
||||
|
||||
/* Set the profile timer value */
|
||||
setitimer( ITIMER_PROF, &((wrapper_t*)p_wrapper)->itimer, NULL );
|
||||
|
||||
/* Tell the calling thread that we don't need its data anymore */
|
||||
vlc_mutex_lock( &((wrapper_t*)p_wrapper)->lock );
|
||||
vlc_cond_signal( &((wrapper_t*)p_wrapper)->wait );
|
||||
vlc_mutex_unlock( &((wrapper_t*)p_wrapper)->lock );
|
||||
|
||||
/* Call the real function */
|
||||
return func( p_data );
|
||||
}
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vdec_ext-plugins.h : structures from the video decoder exported to plug-ins
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: vdec_ext-plugins.h,v 1.11 2002/04/15 23:04:08 massiot Exp $
|
||||
* $Id: vdec_ext-plugins.h,v 1.12 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -39,15 +39,15 @@ typedef struct idct_inner_s
|
||||
|
||||
typedef struct motion_inner_s
|
||||
{
|
||||
boolean_t b_average; /* 0 == copy */
|
||||
vlc_bool_t b_average; /* 0 == copy */
|
||||
int i_x_pred, i_y_pred; /* motion vectors */
|
||||
yuv_data_t * pp_source[3];
|
||||
int i_dest_offset, i_src_offset;
|
||||
int i_stride, i_height;
|
||||
boolean_t b_second_half;
|
||||
vlc_bool_t b_second_half;
|
||||
} motion_inner_t;
|
||||
|
||||
typedef struct macroblock_s
|
||||
struct macroblock_s
|
||||
{
|
||||
int i_mb_modes;
|
||||
|
||||
@ -64,8 +64,7 @@ typedef struct macroblock_s
|
||||
motion_inner_t p_motions[8];
|
||||
int i_nb_motions;
|
||||
yuv_data_t * pp_dest[3];
|
||||
|
||||
} macroblock_t;
|
||||
};
|
||||
|
||||
/* Macroblock Modes */
|
||||
#define MB_INTRA 1
|
||||
@ -78,15 +77,16 @@ typedef struct macroblock_s
|
||||
/*****************************************************************************
|
||||
* vdec_thread_t: video decoder thread descriptor
|
||||
*****************************************************************************/
|
||||
typedef struct vdec_thread_s
|
||||
typedef struct vdec_thread_s vdec_thread_t;
|
||||
|
||||
struct vdec_thread_s
|
||||
{
|
||||
vlc_thread_t thread_id; /* id for thread functions */
|
||||
boolean_t b_die;
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* IDCT iformations */
|
||||
void * p_idct_data;
|
||||
void * p_idct_data;
|
||||
|
||||
/* Input properties */
|
||||
struct vdec_pool_s * p_pool;
|
||||
} vdec_thread_t;
|
||||
};
|
||||
|
||||
|
214
include/video.h
214
include/video.h
@ -4,7 +4,7 @@
|
||||
* includes all common video types and constants.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: video.h,v 1.52 2002/05/28 18:34:42 stef Exp $
|
||||
* $Id: video.h,v 1.53 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -38,11 +38,11 @@ typedef struct plane_s
|
||||
int i_pixel_bytes;
|
||||
|
||||
/* Is there a margin ? defaults to no */
|
||||
boolean_t b_margin;
|
||||
vlc_bool_t b_margin;
|
||||
|
||||
/* Variables used for pictures with margins */
|
||||
int i_visible_bytes; /* How many real pixels are there ? */
|
||||
boolean_t b_hidden; /* Are we allowed to write to the margin ? */
|
||||
vlc_bool_t b_hidden; /* Are we allowed to write to the margin ? */
|
||||
|
||||
} plane_t;
|
||||
|
||||
@ -54,7 +54,7 @@ typedef struct plane_s
|
||||
* Picture type and flags should only be modified by the output thread. Note
|
||||
* that an empty picture MUST have its flags set to 0.
|
||||
*****************************************************************************/
|
||||
typedef struct picture_s
|
||||
struct picture_s
|
||||
{
|
||||
/* Picture data - data can always be freely modified, but p_data may
|
||||
* NEVER be modified. A direct buffer can be handled as the plugin
|
||||
@ -73,28 +73,27 @@ typedef struct picture_s
|
||||
* the video output thread API, but should never be written directly */
|
||||
int i_refcount; /* link reference counter */
|
||||
mtime_t date; /* display date */
|
||||
boolean_t b_force;
|
||||
vlc_bool_t b_force;
|
||||
|
||||
/* Picture dynamic properties - those properties can be changed by the
|
||||
* decoder */
|
||||
boolean_t b_progressive; /* is it a progressive frame ? */
|
||||
boolean_t b_repeat_first_field; /* RFF bit */
|
||||
boolean_t b_top_field_first; /* which field is first */
|
||||
vlc_bool_t b_progressive; /* is it a progressive frame ? */
|
||||
vlc_bool_t b_repeat_first_field; /* RFF bit */
|
||||
vlc_bool_t b_top_field_first; /* which field is first */
|
||||
|
||||
/* The picture heap we are attached to */
|
||||
struct picture_heap_s* p_heap;
|
||||
picture_heap_t* p_heap;
|
||||
|
||||
/* Private data - the video output plugin might want to put stuff here to
|
||||
* keep track of the picture */
|
||||
struct picture_sys_s *p_sys;
|
||||
|
||||
} picture_t;
|
||||
picture_sys_t * p_sys;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* picture_heap_t: video picture heap, either render (to store pictures used
|
||||
* by the decoder) or output (to store pictures displayed by the vout plugin)
|
||||
*****************************************************************************/
|
||||
typedef struct picture_heap_s
|
||||
struct picture_heap_s
|
||||
{
|
||||
int i_pictures; /* current heap size */
|
||||
|
||||
@ -114,9 +113,8 @@ typedef struct picture_heap_s
|
||||
int i_bmask, i_rbshift, i_lbshift;
|
||||
|
||||
/* Stuff used for palettized RGB planes */
|
||||
void (* pf_setpalette) ( struct vout_thread_s *, u16 *, u16 *, u16 * );
|
||||
|
||||
} picture_heap_t;
|
||||
void (* pf_setpalette) ( vout_thread_t *, u16 *, u16 *, u16 * );
|
||||
};
|
||||
|
||||
/* RGB2PIXEL: assemble RGB components to a pixel value, returns a u32 */
|
||||
#define RGB2PIXEL( p_vout, i_r, i_g, i_b ) \
|
||||
@ -145,141 +143,141 @@ typedef struct picture_heap_s
|
||||
/*****************************************************************************
|
||||
* Codes used to describe picture format - see http://www.webartz.com/fourcc/
|
||||
*****************************************************************************/
|
||||
#define MAKEFOURCC( a, b, c, d ) \
|
||||
#define VLC_FOURCC( a, b, c, d ) \
|
||||
( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
|
||||
|
||||
#define MAKETWOCC( a, b ) \
|
||||
#define VLC_TWOCC( a, b ) \
|
||||
( (u16)(a) | ( (u16)(b) << 8 ) )
|
||||
|
||||
/* AVI stuff */
|
||||
#define FOURCC_RIFF MAKEFOURCC('R','I','F','F')
|
||||
#define FOURCC_LIST MAKEFOURCC('L','I','S','T')
|
||||
#define FOURCC_JUNK MAKEFOURCC('J','U','N','K')
|
||||
#define FOURCC_AVI MAKEFOURCC('A','V','I',' ')
|
||||
#define FOURCC_WAVE MAKEFOURCC('W','A','V','E')
|
||||
#define FOURCC_RIFF VLC_FOURCC('R','I','F','F')
|
||||
#define FOURCC_LIST VLC_FOURCC('L','I','S','T')
|
||||
#define FOURCC_JUNK VLC_FOURCC('J','U','N','K')
|
||||
#define FOURCC_AVI VLC_FOURCC('A','V','I',' ')
|
||||
#define FOURCC_WAVE VLC_FOURCC('W','A','V','E')
|
||||
|
||||
#define FOURCC_avih MAKEFOURCC('a','v','i','h')
|
||||
#define FOURCC_hdrl MAKEFOURCC('h','d','r','l')
|
||||
#define FOURCC_movi MAKEFOURCC('m','o','v','i')
|
||||
#define FOURCC_idx1 MAKEFOURCC('i','d','x','1')
|
||||
#define FOURCC_avih VLC_FOURCC('a','v','i','h')
|
||||
#define FOURCC_hdrl VLC_FOURCC('h','d','r','l')
|
||||
#define FOURCC_movi VLC_FOURCC('m','o','v','i')
|
||||
#define FOURCC_idx1 VLC_FOURCC('i','d','x','1')
|
||||
|
||||
#define FOURCC_strl MAKEFOURCC('s','t','r','l')
|
||||
#define FOURCC_strh MAKEFOURCC('s','t','r','h')
|
||||
#define FOURCC_strf MAKEFOURCC('s','t','r','f')
|
||||
#define FOURCC_strd MAKEFOURCC('s','t','r','d')
|
||||
#define FOURCC_strl VLC_FOURCC('s','t','r','l')
|
||||
#define FOURCC_strh VLC_FOURCC('s','t','r','h')
|
||||
#define FOURCC_strf VLC_FOURCC('s','t','r','f')
|
||||
#define FOURCC_strd VLC_FOURCC('s','t','r','d')
|
||||
|
||||
#define FOURCC_rec MAKEFOURCC('r','e','c',' ')
|
||||
#define FOURCC_auds MAKEFOURCC('a','u','d','s')
|
||||
#define FOURCC_vids MAKEFOURCC('v','i','d','s')
|
||||
#define FOURCC_rec VLC_FOURCC('r','e','c',' ')
|
||||
#define FOURCC_auds VLC_FOURCC('a','u','d','s')
|
||||
#define FOURCC_vids VLC_FOURCC('v','i','d','s')
|
||||
|
||||
#define TWOCC_wb MAKETWOCC('w','b')
|
||||
#define TWOCC_db MAKETWOCC('d','b')
|
||||
#define TWOCC_dc MAKETWOCC('d','c')
|
||||
#define TWOCC_pc MAKETWOCC('p','c')
|
||||
#define TWOCC_wb VLC_TWOCC('w','b')
|
||||
#define TWOCC_db VLC_TWOCC('d','b')
|
||||
#define TWOCC_dc VLC_TWOCC('d','c')
|
||||
#define TWOCC_pc VLC_TWOCC('p','c')
|
||||
|
||||
/* MPEG4 codec */
|
||||
#define FOURCC_DIVX MAKEFOURCC('D','I','V','X')
|
||||
#define FOURCC_divx MAKEFOURCC('d','i','v','x')
|
||||
#define FOURCC_DIV1 MAKEFOURCC('D','I','V','1')
|
||||
#define FOURCC_div1 MAKEFOURCC('d','i','v','1')
|
||||
#define FOURCC_MP4S MAKEFOURCC('M','P','4','S')
|
||||
#define FOURCC_mp4s MAKEFOURCC('m','p','4','s')
|
||||
#define FOURCC_M4S2 MAKEFOURCC('M','4','S','2')
|
||||
#define FOURCC_m4s2 MAKEFOURCC('m','4','s','2')
|
||||
#define FOURCC_xvid MAKEFOURCC('x','v','i','d')
|
||||
#define FOURCC_XVID MAKEFOURCC('X','V','I','D')
|
||||
#define FOURCC_XviD MAKEFOURCC('X','v','i','D')
|
||||
#define FOURCC_DX50 MAKEFOURCC('D','X','5','0')
|
||||
#define FOURCC_mp4v MAKEFOURCC('m','p','4','v')
|
||||
#define FOURCC_4 MAKEFOURCC( 4, 0, 0, 0 )
|
||||
|
||||
#define FOURCC_DIVX VLC_FOURCC('D','I','V','X')
|
||||
#define FOURCC_divx VLC_FOURCC('d','i','v','x')
|
||||
#define FOURCC_DIV1 VLC_FOURCC('D','I','V','1')
|
||||
#define FOURCC_div1 VLC_FOURCC('d','i','v','1')
|
||||
#define FOURCC_MP4S VLC_FOURCC('M','P','4','S')
|
||||
#define FOURCC_mp4s VLC_FOURCC('m','p','4','s')
|
||||
#define FOURCC_M4S2 VLC_FOURCC('M','4','S','2')
|
||||
#define FOURCC_m4s2 VLC_FOURCC('m','4','s','2')
|
||||
#define FOURCC_xvid VLC_FOURCC('x','v','i','d')
|
||||
#define FOURCC_XVID VLC_FOURCC('X','V','I','D')
|
||||
#define FOURCC_XviD VLC_FOURCC('X','v','i','D')
|
||||
#define FOURCC_DX50 VLC_FOURCC('D','X','5','0')
|
||||
#define FOURCC_mp4v VLC_FOURCC('m','p','4','v')
|
||||
#define FOURCC_4 VLC_FOURCC( 4, 0, 0, 0 )
|
||||
|
||||
/* MSMPEG4 v2 */
|
||||
#define FOURCC_MPG4 MAKEFOURCC('M','P','G','4')
|
||||
#define FOURCC_mpg4 MAKEFOURCC('m','p','g','4')
|
||||
#define FOURCC_DIV2 MAKEFOURCC('D','I','V','2')
|
||||
#define FOURCC_div2 MAKEFOURCC('d','i','v','2')
|
||||
#define FOURCC_MP42 MAKEFOURCC('M','P','4','2')
|
||||
#define FOURCC_mp42 MAKEFOURCC('m','p','4','2')
|
||||
#define FOURCC_MPG4 VLC_FOURCC('M','P','G','4')
|
||||
#define FOURCC_mpg4 VLC_FOURCC('m','p','g','4')
|
||||
#define FOURCC_DIV2 VLC_FOURCC('D','I','V','2')
|
||||
#define FOURCC_div2 VLC_FOURCC('d','i','v','2')
|
||||
#define FOURCC_MP42 VLC_FOURCC('M','P','4','2')
|
||||
#define FOURCC_mp42 VLC_FOURCC('m','p','4','2')
|
||||
|
||||
/* MSMPEG4 v3 / M$ mpeg4 v3 */
|
||||
#define FOURCC_MPG3 VLC_FOURCC('M','P','G','3')
|
||||
#define FOURCC_mpg3 VLC_FOURCC('m','p','g','3')
|
||||
#define FOURCC_div3 VLC_FOURCC('d','i','v','3')
|
||||
#define FOURCC_MP43 VLC_FOURCC('M','P','4','3')
|
||||
#define FOURCC_mp43 VLC_FOURCC('m','p','4','3')
|
||||
|
||||
/* MSMPEG4 v3 */
|
||||
/* M$ mpeg4 v3 */
|
||||
#define FOURCC_MPG3 MAKEFOURCC('M','P','G','3')
|
||||
#define FOURCC_mpg3 MAKEFOURCC('m','p','g','3')
|
||||
#define FOURCC_div3 MAKEFOURCC('d','i','v','3')
|
||||
#define FOURCC_MP43 MAKEFOURCC('M','P','4','3')
|
||||
#define FOURCC_mp43 MAKEFOURCC('m','p','4','3')
|
||||
/* DivX 3.20 */
|
||||
#define FOURCC_DIV3 MAKEFOURCC('D','I','V','3')
|
||||
#define FOURCC_DIV4 MAKEFOURCC('D','I','V','4')
|
||||
#define FOURCC_div4 MAKEFOURCC('d','i','v','4')
|
||||
#define FOURCC_DIV5 MAKEFOURCC('D','I','V','5')
|
||||
#define FOURCC_div5 MAKEFOURCC('d','i','v','5')
|
||||
#define FOURCC_DIV6 MAKEFOURCC('D','I','V','6')
|
||||
#define FOURCC_div6 MAKEFOURCC('d','i','v','6')
|
||||
#define FOURCC_DIV3 VLC_FOURCC('D','I','V','3')
|
||||
#define FOURCC_DIV4 VLC_FOURCC('D','I','V','4')
|
||||
#define FOURCC_div4 VLC_FOURCC('d','i','v','4')
|
||||
#define FOURCC_DIV5 VLC_FOURCC('D','I','V','5')
|
||||
#define FOURCC_div5 VLC_FOURCC('d','i','v','5')
|
||||
#define FOURCC_DIV6 VLC_FOURCC('D','I','V','6')
|
||||
#define FOURCC_div6 VLC_FOURCC('d','i','v','6')
|
||||
|
||||
/* AngelPotion stuff */
|
||||
#define FOURCC_AP41 MAKEFOURCC('A','P','4','1')
|
||||
#define FOURCC_AP41 VLC_FOURCC('A','P','4','1')
|
||||
|
||||
/* ?? */
|
||||
#define FOURCC_3IV1 MAKEFOURCC('3','I','V','1')
|
||||
|
||||
|
||||
#define FOURCC_3IV1 VLC_FOURCC('3','I','V','1')
|
||||
|
||||
/* Packed RGB for 8bpp */
|
||||
#define FOURCC_BI_RGB MAKEFOURCC( 0 , 0 , 0 , 0 )
|
||||
#define FOURCC_RGB2 MAKEFOURCC('R','G','B','2')
|
||||
#define FOURCC_BI_RGB VLC_FOURCC( 0 , 0 , 0 , 0 )
|
||||
#define FOURCC_RGB2 VLC_FOURCC('R','G','B','2')
|
||||
|
||||
/* Packed RGB for 16, 24, 32bpp */
|
||||
#define FOURCC_BI_BITFIELDS MAKEFOURCC( 0 , 0 , 0 , 3 )
|
||||
#define FOURCC_BI_BITFIELDS VLC_FOURCC( 0 , 0 , 0 , 3 )
|
||||
|
||||
/* Packed RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
|
||||
#define FOURCC_RV15 MAKEFOURCC('R','V','1','5')
|
||||
#define FOURCC_RV15 VLC_FOURCC('R','V','1','5')
|
||||
|
||||
/* Packed RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
|
||||
#define FOURCC_RV16 MAKEFOURCC('R','V','1','6')
|
||||
#define FOURCC_RV16 VLC_FOURCC('R','V','1','6')
|
||||
|
||||
/* Packed RGB 24bpp, 0xff, 0xff00, 0xff0000 */
|
||||
#define FOURCC_RV24 MAKEFOURCC('R','V','2','4')
|
||||
#define FOURCC_RV24 VLC_FOURCC('R','V','2','4')
|
||||
|
||||
/* Packed RGB 32bpp, 0xff, 0xff00, 0xff0000 */
|
||||
#define FOURCC_RV32 MAKEFOURCC('R','V','3','2')
|
||||
#define FOURCC_RV32 VLC_FOURCC('R','V','3','2')
|
||||
|
||||
/* Planar YUV 4:2:0, Y:U:V */
|
||||
#define FOURCC_I420 MAKEFOURCC('I','4','2','0')
|
||||
#define FOURCC_IYUV MAKEFOURCC('I','Y','U','V')
|
||||
#define FOURCC_I420 VLC_FOURCC('I','4','2','0')
|
||||
#define FOURCC_IYUV VLC_FOURCC('I','Y','U','V')
|
||||
|
||||
/* Planar YUV 4:2:0, Y:V:U */
|
||||
#define FOURCC_YV12 MAKEFOURCC('Y','V','1','2')
|
||||
#define FOURCC_YV12 VLC_FOURCC('Y','V','1','2')
|
||||
|
||||
/* Packed YUV 4:2:2, U:Y:V:Y, interlaced */
|
||||
#define FOURCC_IUYV MAKEFOURCC('I','U','Y','V')
|
||||
#define FOURCC_IUYV VLC_FOURCC('I','U','Y','V')
|
||||
|
||||
/* Packed YUV 4:2:2, U:Y:V:Y */
|
||||
#define FOURCC_UYVY MAKEFOURCC('U','Y','V','Y')
|
||||
#define FOURCC_UYNV MAKEFOURCC('U','Y','N','V')
|
||||
#define FOURCC_Y422 MAKEFOURCC('Y','4','2','2')
|
||||
#define FOURCC_UYVY VLC_FOURCC('U','Y','V','Y')
|
||||
#define FOURCC_UYNV VLC_FOURCC('U','Y','N','V')
|
||||
#define FOURCC_Y422 VLC_FOURCC('Y','4','2','2')
|
||||
|
||||
/* Packed YUV 4:2:2, U:Y:V:Y, reverted */
|
||||
#define FOURCC_cyuv MAKEFOURCC('c','y','u','v')
|
||||
#define FOURCC_cyuv VLC_FOURCC('c','y','u','v')
|
||||
|
||||
/* Packed YUV 4:2:2, Y:U:Y:V */
|
||||
#define FOURCC_YUY2 MAKEFOURCC('Y','U','Y','2')
|
||||
#define FOURCC_YUNV MAKEFOURCC('Y','U','N','V')
|
||||
#define FOURCC_YUY2 VLC_FOURCC('Y','U','Y','2')
|
||||
#define FOURCC_YUNV VLC_FOURCC('Y','U','N','V')
|
||||
|
||||
/* Packed YUV 4:2:2, Y:V:Y:U */
|
||||
#define FOURCC_YVYU MAKEFOURCC('Y','V','Y','U')
|
||||
#define FOURCC_YVYU VLC_FOURCC('Y','V','Y','U')
|
||||
|
||||
/* Packed YUV 2:1:1, Y:U:Y:V */
|
||||
#define FOURCC_Y211 MAKEFOURCC('Y','2','1','1')
|
||||
#define FOURCC_Y211 VLC_FOURCC('Y','2','1','1')
|
||||
|
||||
/* Custom formats which we use but which don't exist in the fourcc database */
|
||||
|
||||
/* Planar Y, packed UV, from Matrox */
|
||||
#define FOURCC_YMGA MAKEFOURCC('Y','M','G','A')
|
||||
#define FOURCC_YMGA VLC_FOURCC('Y','M','G','A')
|
||||
|
||||
/* Planar 4:2:2, Y:U:V */
|
||||
#define FOURCC_I422 MAKEFOURCC('I','4','2','2')
|
||||
#define FOURCC_I422 VLC_FOURCC('I','4','2','2')
|
||||
|
||||
/* Planar 4:4:4, Y:U:V */
|
||||
#define FOURCC_I444 MAKEFOURCC('I','4','4','4')
|
||||
#define FOURCC_I444 VLC_FOURCC('I','4','4','4')
|
||||
|
||||
/*****************************************************************************
|
||||
* Shortcuts to access image components
|
||||
@ -306,18 +304,18 @@ typedef struct picture_heap_s
|
||||
* Subtitle type and flags should only be modified by the output thread. Note
|
||||
* that an empty subtitle MUST have its flags set to 0.
|
||||
*****************************************************************************/
|
||||
typedef struct subpicture_s
|
||||
struct subpicture_s
|
||||
{
|
||||
/* Type and flags - should NOT be modified except by the vout thread */
|
||||
int i_type; /* type */
|
||||
int i_status; /* flags */
|
||||
int i_size; /* data size */
|
||||
struct subpicture_s * p_next; /* next subtitle to be displayed */
|
||||
subpicture_t * p_next; /* next subtitle to be displayed */
|
||||
|
||||
/* Date properties */
|
||||
mtime_t i_start; /* beginning of display date */
|
||||
mtime_t i_stop; /* end of display date */
|
||||
boolean_t b_ephemer; /* does the subtitle have a TTL ? */
|
||||
vlc_bool_t b_ephemer; /* does the subtitle have a TTL ? */
|
||||
|
||||
/* Display properties - these properties are only indicative and may be
|
||||
* changed by the video output thread, or simply ignored depending of the
|
||||
@ -335,7 +333,7 @@ typedef struct subpicture_s
|
||||
* format */
|
||||
struct
|
||||
{
|
||||
p_vout_font_t p_font; /* font, NULL for default */
|
||||
vout_font_t * p_font; /* font, NULL for default */
|
||||
int i_style; /* text style */
|
||||
u32 i_char_color; /* character color */
|
||||
u32 i_border_color; /* border color */
|
||||
@ -345,15 +343,13 @@ typedef struct subpicture_s
|
||||
#endif
|
||||
|
||||
/* The subpicture rendering routine */
|
||||
void ( *pf_render ) ( const struct vout_thread_s *, picture_t *,
|
||||
const struct subpicture_s * );
|
||||
void ( *pf_render ) ( vout_thread_t *, picture_t *, const subpicture_t * );
|
||||
|
||||
/* Private data - the subtitle plugin might want to put stuff here to
|
||||
* keep track of the subpicture */
|
||||
struct subpicture_sys_s *p_sys; /* subpicture data */
|
||||
void *p_sys_orig; /* pointer before memalign */
|
||||
|
||||
} subpicture_t;
|
||||
subpicture_sys_t *p_sys; /* subpicture data */
|
||||
void *p_sys_orig; /* pointer before memalign */
|
||||
};
|
||||
|
||||
/* Subpicture type */
|
||||
#define EMPTY_SUBPICTURE 0 /* subtitle slot is empty and available */
|
||||
|
@ -5,7 +5,7 @@
|
||||
* thread, and destroy a previously opened video output thread.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: video_output.h,v 1.75 2002/04/25 21:52:42 sam Exp $
|
||||
* $Id: video_output.h,v 1.76 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
*
|
||||
@ -24,27 +24,6 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* vout_bank_t, p_vout_bank (global variable)
|
||||
*****************************************************************************
|
||||
* This global variable is accessed by any function using the video output.
|
||||
*****************************************************************************/
|
||||
typedef struct vout_bank_s
|
||||
{
|
||||
/* Array to all the video outputs */
|
||||
struct vout_thread_s *pp_vout[ VOUT_MAX_THREADS ];
|
||||
|
||||
int i_count;
|
||||
vlc_mutex_t lock; /* Global lock */
|
||||
|
||||
} vout_bank_t;
|
||||
|
||||
#ifndef __PLUGIN__
|
||||
extern vout_bank_t *p_vout_bank;
|
||||
#else
|
||||
# define p_vout_bank (p_symbols->p_vout_bank)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* vout_chroma_t: Chroma conversion function
|
||||
*****************************************************************************
|
||||
@ -54,7 +33,7 @@ extern vout_bank_t *p_vout_bank;
|
||||
* p_dest destination picture
|
||||
* Picture width and source dimensions must be multiples of 16.
|
||||
*****************************************************************************/
|
||||
typedef void (vout_chroma_convert_t)( struct vout_thread_s *,
|
||||
typedef void (vout_chroma_convert_t)( vout_thread_t *,
|
||||
picture_t *, picture_t * );
|
||||
|
||||
typedef struct vout_chroma_s
|
||||
@ -63,12 +42,12 @@ typedef struct vout_chroma_s
|
||||
vout_chroma_convert_t *pf_convert;
|
||||
|
||||
/* Private module-dependant data */
|
||||
p_chroma_sys_t p_sys; /* private data */
|
||||
chroma_sys_t * p_sys; /* private data */
|
||||
|
||||
/* Plugin used and shortcuts to access its capabilities */
|
||||
struct module_s * p_module;
|
||||
int ( * pf_init ) ( struct vout_thread_s * );
|
||||
void ( * pf_end ) ( struct vout_thread_s * );
|
||||
module_t * p_module;
|
||||
int ( * pf_init ) ( vout_thread_t * );
|
||||
void ( * pf_end ) ( vout_thread_t * );
|
||||
|
||||
} vout_chroma_t;
|
||||
|
||||
@ -79,7 +58,7 @@ typedef struct vout_fifo_s
|
||||
{
|
||||
/* See the fifo types below */
|
||||
int i_type;
|
||||
boolean_t b_die;
|
||||
vlc_bool_t b_die;
|
||||
int i_fifo; /* Just to keep track of the fifo index */
|
||||
|
||||
vlc_mutex_t data_lock;
|
||||
@ -98,42 +77,37 @@ typedef struct vout_fifo_s
|
||||
* is represented by a video output thread, and described using the following
|
||||
* structure.
|
||||
*****************************************************************************/
|
||||
typedef struct vout_thread_s
|
||||
struct vout_thread_s
|
||||
{
|
||||
VLC_COMMON_MEMBERS
|
||||
|
||||
/* Thread properties and lock */
|
||||
boolean_t b_die; /* `die' flag */
|
||||
boolean_t b_error; /* `error' flag */
|
||||
boolean_t b_active; /* `active' flag */
|
||||
vlc_thread_t thread_id; /* id for pthread functions */
|
||||
vlc_mutex_t picture_lock; /* picture heap lock */
|
||||
vlc_mutex_t subpicture_lock; /* subpicture heap lock */
|
||||
vlc_mutex_t change_lock; /* thread change lock */
|
||||
int * pi_status; /* temporary status flag */
|
||||
p_vout_sys_t p_sys; /* system output method */
|
||||
vout_sys_t * p_sys; /* system output method */
|
||||
|
||||
/* Current display properties */
|
||||
u16 i_changes; /* changes made to the thread */
|
||||
float f_gamma; /* gamma */
|
||||
boolean_t b_grayscale; /* color or grayscale display */
|
||||
boolean_t b_info; /* print additional information */
|
||||
boolean_t b_interface; /* render interface */
|
||||
boolean_t b_scale; /* allow picture scaling */
|
||||
boolean_t b_fullscreen; /* toogle fullscreen display */
|
||||
vlc_bool_t b_grayscale; /* color or grayscale display */
|
||||
vlc_bool_t b_info; /* print additional information */
|
||||
vlc_bool_t b_interface; /* render interface */
|
||||
vlc_bool_t b_scale; /* allow picture scaling */
|
||||
vlc_bool_t b_fullscreen; /* toogle fullscreen display */
|
||||
mtime_t render_time; /* last picture render time */
|
||||
int i_window_width; /* video window width */
|
||||
int i_window_height; /* video window height */
|
||||
|
||||
/* Plugin used and shortcuts to access its capabilities */
|
||||
struct module_s * p_module;
|
||||
int ( *pf_create ) ( struct vout_thread_s * );
|
||||
int ( *pf_init ) ( struct vout_thread_s * );
|
||||
void ( *pf_end ) ( struct vout_thread_s * );
|
||||
void ( *pf_destroy ) ( struct vout_thread_s * );
|
||||
int ( *pf_manage ) ( struct vout_thread_s * );
|
||||
void ( *pf_render ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( *pf_display ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
module_t * p_module;
|
||||
int ( *pf_create ) ( vout_thread_t * );
|
||||
int ( *pf_init ) ( vout_thread_t * );
|
||||
void ( *pf_end ) ( vout_thread_t * );
|
||||
void ( *pf_destroy ) ( vout_thread_t * );
|
||||
int ( *pf_manage ) ( vout_thread_t * );
|
||||
void ( *pf_render ) ( vout_thread_t *, picture_t * );
|
||||
void ( *pf_display ) ( vout_thread_t *, picture_t * );
|
||||
|
||||
/* Statistics - these numbers are not supposed to be accurate, but are a
|
||||
* good indication of the thread status */
|
||||
@ -144,7 +118,7 @@ typedef struct vout_thread_s
|
||||
int i_heap_size; /* heap size */
|
||||
picture_heap_t render; /* rendered pictures */
|
||||
picture_heap_t output; /* direct buffers */
|
||||
boolean_t b_direct; /* rendered are like direct ? */
|
||||
vlc_bool_t b_direct; /* rendered are like direct ? */
|
||||
vout_chroma_t chroma; /* translation tables */
|
||||
|
||||
/* Picture and subpicture heaps */
|
||||
@ -152,8 +126,8 @@ typedef struct vout_thread_s
|
||||
subpicture_t p_subpicture[VOUT_MAX_PICTURES]; /* subpictures */
|
||||
|
||||
/* Bitmap fonts */
|
||||
p_vout_font_t p_default_font; /* default font */
|
||||
p_vout_font_t p_large_font; /* large font */
|
||||
vout_font_t * p_default_font; /* default font */
|
||||
vout_font_t * p_large_font; /* large font */
|
||||
|
||||
/* Statistics */
|
||||
count_t c_loops;
|
||||
@ -161,7 +135,7 @@ typedef struct vout_thread_s
|
||||
mtime_t display_jitter; /* average deviation from the PTS */
|
||||
count_t c_jitter_samples; /* number of samples used for the *
|
||||
* calculation of the jitter */
|
||||
} vout_thread_t;
|
||||
};
|
||||
|
||||
#define I_OUTPUTPICTURES p_vout->output.i_pictures
|
||||
#define PP_OUTPUTPICTURE p_vout->output.pp_picture
|
||||
@ -189,52 +163,31 @@ typedef struct vout_thread_s
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void vout_InitBank ( void );
|
||||
void vout_EndBank ( void );
|
||||
|
||||
vout_thread_t * vout_CreateThread ( int *pi_status, int, int, u32, int );
|
||||
void vout_DestroyThread ( vout_thread_t *, int *pi_status );
|
||||
VLC_EXPORT( vout_thread_t *, vout_CreateThread, ( vlc_object_t *, int, int, u32, int ) );
|
||||
VLC_EXPORT( void, vout_DestroyThread, ( vout_thread_t * ) );
|
||||
|
||||
vout_fifo_t * vout_CreateFifo ( void );
|
||||
void vout_DestroyFifo ( vout_fifo_t * );
|
||||
void vout_FreeFifo ( vout_fifo_t * );
|
||||
|
||||
int vout_ChromaCmp ( u32, u32 );
|
||||
VLC_EXPORT( int, vout_ChromaCmp, ( u32, u32 ) );
|
||||
|
||||
picture_t * vout_CreatePicture ( vout_thread_t *,
|
||||
boolean_t, boolean_t, boolean_t );
|
||||
void vout_AllocatePicture( picture_t *, int, int, u32 );
|
||||
void vout_DestroyPicture ( vout_thread_t *, picture_t * );
|
||||
void vout_DisplayPicture ( vout_thread_t *, picture_t * );
|
||||
void vout_DatePicture ( vout_thread_t *, picture_t *, mtime_t );
|
||||
void vout_LinkPicture ( vout_thread_t *, picture_t * );
|
||||
void vout_UnlinkPicture ( vout_thread_t *, picture_t * );
|
||||
VLC_EXPORT( picture_t *, vout_CreatePicture, ( vout_thread_t *, vlc_bool_t, vlc_bool_t, vlc_bool_t ) );
|
||||
VLC_EXPORT( void, vout_AllocatePicture,( vout_thread_t *, picture_t *, int, int, u32 ) );
|
||||
VLC_EXPORT( void, vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
|
||||
VLC_EXPORT( void, vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
|
||||
VLC_EXPORT( void, vout_DatePicture, ( vout_thread_t *, picture_t *, mtime_t ) );
|
||||
VLC_EXPORT( void, vout_LinkPicture, ( vout_thread_t *, picture_t * ) );
|
||||
VLC_EXPORT( void, vout_UnlinkPicture, ( vout_thread_t *, picture_t * ) );
|
||||
VLC_EXPORT( void, vout_PlacePicture, ( vout_thread_t *, int, int, int *, int *, int *, int * ) );
|
||||
picture_t * vout_RenderPicture ( vout_thread_t *, picture_t *,
|
||||
subpicture_t * );
|
||||
void vout_PlacePicture ( vout_thread_t *, int, int,
|
||||
int *, int *, int *, int * );
|
||||
|
||||
subpicture_t * vout_CreateSubPicture ( vout_thread_t *, int, int );
|
||||
void vout_DestroySubPicture ( vout_thread_t *, subpicture_t * );
|
||||
void vout_DisplaySubPicture ( vout_thread_t *, subpicture_t * );
|
||||
VLC_EXPORT( subpicture_t *, vout_CreateSubPicture, ( vout_thread_t *, int, int ) );
|
||||
VLC_EXPORT( void, vout_DestroySubPicture, ( vout_thread_t *, subpicture_t * ) );
|
||||
VLC_EXPORT( void, vout_DisplaySubPicture, ( vout_thread_t *, subpicture_t * ) );
|
||||
|
||||
subpicture_t * vout_SortSubPictures ( vout_thread_t *, mtime_t );
|
||||
void vout_RenderSubPictures ( vout_thread_t *, picture_t *,
|
||||
subpicture_t * );
|
||||
#else
|
||||
# define vout_CreateThread p_symbols->vout_CreateThread
|
||||
# define vout_DestroyThread p_symbols->vout_DestroyThread
|
||||
# define vout_CreateSubPicture p_symbols->vout_CreateSubPicture
|
||||
# define vout_DestroySubPicture p_symbols->vout_DestroySubPicture
|
||||
# define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture
|
||||
# define vout_CreatePicture p_symbols->vout_CreatePicture
|
||||
# define vout_AllocatePicture p_symbols->vout_AllocatePicture
|
||||
# define vout_DisplayPicture p_symbols->vout_DisplayPicture
|
||||
# define vout_DestroyPicture p_symbols->vout_DestroyPicture
|
||||
# define vout_DatePicture p_symbols->vout_DatePicture
|
||||
# define vout_LinkPicture p_symbols->vout_LinkPicture
|
||||
# define vout_UnlinkPicture p_symbols->vout_UnlinkPicture
|
||||
# define vout_PlacePicture p_symbols->vout_PlacePicture
|
||||
# define vout_ChromaCmp p_symbols->vout_ChromaCmp
|
||||
#endif
|
||||
|
||||
|
@ -1,12 +1,8 @@
|
||||
/*****************************************************************************
|
||||
* vlc.h: global header for vlc
|
||||
* aout.h: audio output header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998, 1999, 2000 VideoLAN
|
||||
* $Id: vlc.h,v 1.10 2002/04/28 01:26:15 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@via.ecp.fr>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Gildas Bazin <gbazin@netcourrier.com>
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: aout.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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
|
||||
@ -23,28 +19,25 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_AOUT_H
|
||||
#define _VLC_AOUT_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Required vlc headers
|
||||
* Required public headers
|
||||
*****************************************************************************/
|
||||
#if defined( __VLC__ )
|
||||
# include "defs.h"
|
||||
# include "config.h"
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
# if defined( __PLUGIN__ ) || defined( __BUILTIN__ )
|
||||
# include "modules_inner.h"
|
||||
# endif
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#include "audio_output.h"
|
||||
|
||||
# include "common.h"
|
||||
|
||||
# include "os_specific.h"
|
||||
|
||||
# include "intf_msg.h"
|
||||
# include "threads.h"
|
||||
# include "mtime.h"
|
||||
# include "modules.h"
|
||||
|
||||
# include "main.h"
|
||||
# include "configuration.h"
|
||||
# include "threads_funcs.h"
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/aout.h> */
|
@ -1,12 +1,8 @@
|
||||
/*****************************************************************************
|
||||
* intf_msg.h: messages interface
|
||||
* This library provides basic functions for threads to interact with user
|
||||
* interface, such as message output. See config.h for output configuration.
|
||||
* decoder.h: header for vlc decoders
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: intf_msg.h,v 1.19 2002/04/24 00:36:24 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: decoder.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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
|
||||
@ -23,23 +19,26 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_DECODER_H
|
||||
#define _VLC_DECODER_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
* Required public headers
|
||||
*****************************************************************************/
|
||||
#ifndef __PLUGIN__
|
||||
void intf_Msg ( char *psz_format, ... );
|
||||
void intf_ErrMsg ( char *psz_format, ... );
|
||||
void intf_WarnMsg ( int i_level, char *psz_format, ... );
|
||||
void intf_StatMsg ( char *psz_format, ... );
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
void intf_WarnHexDump ( int i_level, void *p_data, int i_size );
|
||||
#else
|
||||
# define intf_MsgSub p_symbols->intf_MsgSub
|
||||
# define intf_MsgUnsub p_symbols->intf_MsgUnsub
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
|
||||
# define intf_Msg p_symbols->intf_Msg
|
||||
# define intf_ErrMsg p_symbols->intf_ErrMsg
|
||||
# define intf_StatMsg p_symbols->intf_StatMsg
|
||||
# define intf_WarnMsg p_symbols->intf_WarnMsg
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/decoder.h> */
|
46
include/vlc/input.h
Normal file
46
include/vlc/input.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*****************************************************************************
|
||||
* input.h: input modules header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: input.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_INPUT_H
|
||||
#define _VLC_INPUT_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Required public headers
|
||||
*****************************************************************************/
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h" /* input_thread_s */
|
||||
#include "input_ext-dec.h" /* data_packet_s */
|
||||
#include "input_ext-plugins.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/input.h> */
|
47
include/vlc/intf.h
Normal file
47
include/vlc/intf.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*****************************************************************************
|
||||
* intf.h: interface header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: intf.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_INTF_H
|
||||
#define _VLC_INTF_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Required public headers
|
||||
*****************************************************************************/
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#include "interface.h"
|
||||
#include "intf_eject.h"
|
||||
#include "playlist.h"
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/intf.h> */
|
103
include/vlc/vlc.h
Normal file
103
include/vlc/vlc.h
Normal file
@ -0,0 +1,103 @@
|
||||
/*****************************************************************************
|
||||
* vlc.h: global header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998, 1999, 2000 VideoLAN
|
||||
* $Id: vlc.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_VLC_H
|
||||
#define _VLC_VLC_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Error values
|
||||
*****************************************************************************/
|
||||
typedef signed int vlc_error_t;
|
||||
|
||||
#define VLC_SUCCESS -0 /* No error */
|
||||
#define VLC_EGENERIC -1 /* Generic error */
|
||||
#define VLC_ENOMEM -2 /* Not enough memory */
|
||||
#define VLC_ESTATUS -3 /* Invalid status */
|
||||
#define VLC_EEXIT -255 /* Program exited */
|
||||
|
||||
/*****************************************************************************
|
||||
* Booleans
|
||||
*****************************************************************************/
|
||||
typedef int vlc_bool_t;
|
||||
|
||||
#define VLC_FALSE 0
|
||||
#define VLC_TRUE 1
|
||||
|
||||
/*****************************************************************************
|
||||
* Main structure status
|
||||
*****************************************************************************/
|
||||
typedef int vlc_status_t;
|
||||
|
||||
#define VLC_STATUS_NONE 0x00000000
|
||||
#define VLC_STATUS_CREATED 0x02020202
|
||||
#define VLC_STATUS_STOPPED 0x12121212
|
||||
#define VLC_STATUS_RUNNING 0x42424242
|
||||
|
||||
/*****************************************************************************
|
||||
* Structure types
|
||||
*****************************************************************************/
|
||||
#define VLC_DECLARE_STRUCT( name ) \
|
||||
struct name##_s; \
|
||||
typedef struct name##_s name##_t;
|
||||
VLC_DECLARE_STRUCT(vlc)
|
||||
VLC_DECLARE_STRUCT(vlc_object)
|
||||
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#if defined( __VLC__ )
|
||||
# include "defs.h"
|
||||
# include "config.h"
|
||||
# include "modules_inner.h"
|
||||
# include "vlc_common.h"
|
||||
# include "vlc_messages.h"
|
||||
# include "mtime.h"
|
||||
# include "modules.h"
|
||||
# include "main.h"
|
||||
# include "configuration.h"
|
||||
# include "threads_funcs.h"
|
||||
# include "vlc_objects.h"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Exported libvlc base API
|
||||
*****************************************************************************/
|
||||
vlc_t * vlc_create ( void );
|
||||
vlc_error_t vlc_init ( vlc_t *, int, char *[] );
|
||||
vlc_error_t vlc_run ( vlc_t * );
|
||||
vlc_error_t vlc_stop ( vlc_t * );
|
||||
vlc_error_t vlc_end ( vlc_t * );
|
||||
vlc_error_t vlc_destroy ( vlc_t * );
|
||||
|
||||
vlc_error_t vlc_add_intf ( vlc_t *, char *, vlc_bool_t );
|
||||
vlc_error_t vlc_add_target ( vlc_t *, char * );
|
||||
|
||||
vlc_status_t vlc_status ( vlc_t * );
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/vlc.h> */
|
44
include/vlc/vout.h
Normal file
44
include/vlc/vout.h
Normal file
@ -0,0 +1,44 @@
|
||||
/*****************************************************************************
|
||||
* vout.h: video output header for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: vout.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _VLC_VOUT_H
|
||||
#define _VLC_VOUT_H 1
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Required public headers
|
||||
*****************************************************************************/
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Required internal headers
|
||||
*****************************************************************************/
|
||||
#include "video.h"
|
||||
#include "video_output.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif /* <vlc/vout.h> */
|
@ -3,7 +3,7 @@
|
||||
* Collection of useful common types and macros definitions
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1998, 1999, 2000 VideoLAN
|
||||
* $Id: common.h,v 1.108 2002/05/20 22:36:42 sam Exp $
|
||||
* $Id: vlc_common.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@via.ecp.fr>
|
||||
* Vincent Seguin <seguin@via.ecp.fr>
|
||||
@ -38,39 +38,39 @@
|
||||
/*****************************************************************************
|
||||
* Basic types definitions
|
||||
*****************************************************************************/
|
||||
#ifdef HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
typedef uint8_t u8;
|
||||
typedef int8_t s8;
|
||||
|
||||
typedef unsigned char u8;
|
||||
typedef signed char s8;
|
||||
typedef uint16_t u16;
|
||||
typedef int16_t s16;
|
||||
|
||||
typedef unsigned short u16;
|
||||
typedef signed short s16;
|
||||
typedef uint32_t u32;
|
||||
typedef int32_t s32;
|
||||
|
||||
typedef unsigned int u32;
|
||||
typedef signed int s32;
|
||||
|
||||
#if defined( _MSC_VER ) || ( defined( WIN32 ) && !defined( __MINGW32__ ) )
|
||||
typedef unsigned __int64 u64;
|
||||
typedef signed __int64 s64;
|
||||
typedef uint64_t u64;
|
||||
typedef int64_t s64;
|
||||
#else
|
||||
typedef unsigned long long u64;
|
||||
typedef signed long long s64;
|
||||
typedef unsigned char u8;
|
||||
typedef signed char s8;
|
||||
|
||||
typedef unsigned short u16;
|
||||
typedef signed short s16;
|
||||
|
||||
typedef unsigned int u32;
|
||||
typedef signed int s32;
|
||||
|
||||
# if defined( _MSC_VER ) || ( defined( WIN32 ) && !defined( __MINGW32__ ) )
|
||||
typedef unsigned __int64 u64;
|
||||
typedef signed __int64 s64;
|
||||
# else
|
||||
typedef unsigned long long u64;
|
||||
typedef signed long long s64;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef u8 byte_t;
|
||||
|
||||
/* Boolean type */
|
||||
#ifdef BOOLEAN_T_IN_SYS_TYPES_H
|
||||
/* <sys/types.h> already included */
|
||||
#elif defined(BOOLEAN_T_IN_PTHREAD_H)
|
||||
# include <pthread.h>
|
||||
#elif defined(BOOLEAN_T_IN_CTHREADS_H)
|
||||
# include <cthreads.h>
|
||||
#else
|
||||
typedef int boolean_t;
|
||||
#endif
|
||||
#ifdef SYS_GNU
|
||||
# define _MACH_I386_BOOLEAN_H_
|
||||
#endif
|
||||
typedef u8 byte_t;
|
||||
|
||||
/* ptrdiff_t definition */
|
||||
#ifdef HAVE_STDDEF_H
|
||||
@ -113,95 +113,131 @@ typedef s64 mtime_t;
|
||||
* Classes declaration
|
||||
*****************************************************************************/
|
||||
|
||||
/* Plugins */
|
||||
struct plugin_bank_s;
|
||||
struct plugin_info_s;
|
||||
/* System */
|
||||
VLC_DECLARE_STRUCT(main_sys)
|
||||
|
||||
typedef struct plugin_bank_s * p_plugin_bank_t;
|
||||
typedef struct plugin_info_s * p_plugin_info_t;
|
||||
/* Messages */
|
||||
VLC_DECLARE_STRUCT(msg_bank)
|
||||
VLC_DECLARE_STRUCT(msg_subscription)
|
||||
|
||||
/* Playlist */
|
||||
struct playlist_s;
|
||||
struct playlist_item_s;
|
||||
struct module_s;
|
||||
struct module_config_s;
|
||||
VLC_DECLARE_STRUCT(playlist)
|
||||
VLC_DECLARE_STRUCT(playlist_item)
|
||||
|
||||
typedef struct playlist_s * p_playlist_t;
|
||||
typedef struct playlist_item_s * p_playlist_item_t;
|
||||
typedef struct module_s * p_module_t;
|
||||
typedef struct module_config_s * p_module_config_t;
|
||||
/* Modules */
|
||||
VLC_DECLARE_STRUCT(module_bank)
|
||||
VLC_DECLARE_STRUCT(module)
|
||||
VLC_DECLARE_STRUCT(module_config)
|
||||
VLC_DECLARE_STRUCT(module_symbols)
|
||||
VLC_DECLARE_STRUCT(module_functions)
|
||||
|
||||
/* Interface */
|
||||
struct intf_thread_s;
|
||||
struct intf_sys_s;
|
||||
struct intf_console_s;
|
||||
struct intf_msg_s;
|
||||
struct intf_channel_s;
|
||||
|
||||
typedef struct intf_thread_s * p_intf_thread_t;
|
||||
typedef struct intf_sys_s * p_intf_sys_t;
|
||||
typedef struct intf_console_s * p_intf_console_t;
|
||||
typedef struct intf_msg_s * p_intf_msg_t;
|
||||
typedef struct intf_channel_s * p_intf_channel_t;
|
||||
VLC_DECLARE_STRUCT(intf_thread)
|
||||
VLC_DECLARE_STRUCT(intf_sys)
|
||||
VLC_DECLARE_STRUCT(intf_console)
|
||||
VLC_DECLARE_STRUCT(intf_msg)
|
||||
VLC_DECLARE_STRUCT(intf_channel)
|
||||
|
||||
/* Input */
|
||||
struct input_thread_s;
|
||||
struct input_channel_s;
|
||||
struct input_cfg_s;
|
||||
struct input_area_s;
|
||||
|
||||
typedef struct input_thread_s * p_input_thread_t;
|
||||
typedef struct input_channel_s * p_input_channel_t;
|
||||
typedef struct input_cfg_s * p_input_cfg_t;
|
||||
typedef struct input_area_s * p_input_area_t;
|
||||
VLC_DECLARE_STRUCT(input_thread)
|
||||
VLC_DECLARE_STRUCT(input_channel)
|
||||
VLC_DECLARE_STRUCT(input_cfg)
|
||||
VLC_DECLARE_STRUCT(input_area)
|
||||
VLC_DECLARE_STRUCT(input_buffers)
|
||||
VLC_DECLARE_STRUCT(input_socket)
|
||||
|
||||
/* Audio */
|
||||
struct aout_thread_s;
|
||||
struct aout_sys_s;
|
||||
|
||||
typedef struct aout_thread_s * p_aout_thread_t;
|
||||
typedef struct aout_sys_s * p_aout_sys_t;
|
||||
VLC_DECLARE_STRUCT(aout_thread)
|
||||
VLC_DECLARE_STRUCT(aout_sys)
|
||||
VLC_DECLARE_STRUCT(aout_fifo)
|
||||
|
||||
/* Video */
|
||||
struct vout_thread_s;
|
||||
struct vout_font_s;
|
||||
struct vout_sys_s;
|
||||
struct chroma_sys_s;
|
||||
struct vdec_thread_s;
|
||||
struct vpar_thread_s;
|
||||
struct video_parser_s;
|
||||
|
||||
typedef struct vout_thread_s * p_vout_thread_t;
|
||||
typedef struct vout_font_s * p_vout_font_t;
|
||||
typedef struct vout_sys_s * p_vout_sys_t;
|
||||
typedef struct chroma_sys_s * p_chroma_sys_t;
|
||||
typedef struct vdec_thread_s * p_vdec_thread_t;
|
||||
typedef struct vpar_thread_s * p_vpar_thread_t;
|
||||
typedef struct video_parser_s * p_video_parser_t;
|
||||
VLC_DECLARE_STRUCT(vout_thread)
|
||||
VLC_DECLARE_STRUCT(vout_font)
|
||||
VLC_DECLARE_STRUCT(vout_sys)
|
||||
VLC_DECLARE_STRUCT(chroma_sys)
|
||||
VLC_DECLARE_STRUCT(picture)
|
||||
VLC_DECLARE_STRUCT(picture_sys)
|
||||
VLC_DECLARE_STRUCT(picture_heap)
|
||||
VLC_DECLARE_STRUCT(subpicture)
|
||||
VLC_DECLARE_STRUCT(subpicture_sys)
|
||||
|
||||
/* Decoders */
|
||||
struct decoder_config_s;
|
||||
struct decoder_fifo_s;
|
||||
VLC_DECLARE_STRUCT(decoder_fifo)
|
||||
|
||||
/* Misc */
|
||||
struct macroblock_s;
|
||||
struct data_packet_s;
|
||||
struct imdct_s;
|
||||
struct complex_s;
|
||||
struct dm_par_s;
|
||||
struct picture_s;
|
||||
struct picture_sys_s;
|
||||
struct picture_heap_s;
|
||||
struct es_descriptor_s;
|
||||
struct pgrm_descriptor_s;
|
||||
struct pes_packet_s;
|
||||
struct input_area_s;
|
||||
struct bit_stream_s;
|
||||
struct input_buffers_s;
|
||||
struct network_socket_s;
|
||||
struct intf_subscription_s;
|
||||
VLC_DECLARE_STRUCT(macroblock)
|
||||
VLC_DECLARE_STRUCT(data_packet)
|
||||
VLC_DECLARE_STRUCT(data_buffer)
|
||||
VLC_DECLARE_STRUCT(downmix)
|
||||
VLC_DECLARE_STRUCT(imdct)
|
||||
VLC_DECLARE_STRUCT(complex)
|
||||
VLC_DECLARE_STRUCT(dm_par)
|
||||
VLC_DECLARE_STRUCT(es_descriptor)
|
||||
VLC_DECLARE_STRUCT(pgrm_descriptor)
|
||||
VLC_DECLARE_STRUCT(stream_descriptor)
|
||||
VLC_DECLARE_STRUCT(stream_position)
|
||||
VLC_DECLARE_STRUCT(stream_ctrl)
|
||||
VLC_DECLARE_STRUCT(pes_packet)
|
||||
VLC_DECLARE_STRUCT(bit_stream)
|
||||
VLC_DECLARE_STRUCT(network_socket)
|
||||
VLC_DECLARE_STRUCT(iso639_lang)
|
||||
|
||||
typedef struct iso639_lang_s iso639_lang_t;
|
||||
/*****************************************************************************
|
||||
* OS-specific headers and thread types
|
||||
*****************************************************************************/
|
||||
#include "os_specific.h"
|
||||
#include "vlc_threads.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Compiler-specific workarounds
|
||||
*****************************************************************************/
|
||||
#if defined( __BORLANDC__ )
|
||||
# undef HAVE_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Common structure members
|
||||
*****************************************************************************/
|
||||
|
||||
/* VLC_COMMON_MEMBERS : members common to all basic vlc objects */
|
||||
#define VLC_COMMON_MEMBERS \
|
||||
int i_object_id; \
|
||||
int i_object_type; \
|
||||
char *psz_object_type; \
|
||||
char *psz_object_name; \
|
||||
\
|
||||
/* Thread properties, if any */ \
|
||||
vlc_bool_t b_thread; \
|
||||
vlc_thread_t thread_id; \
|
||||
vlc_mutex_t thread_lock; \
|
||||
vlc_cond_t thread_wait; \
|
||||
\
|
||||
volatile vlc_bool_t b_error; /* set by the object */ \
|
||||
volatile vlc_bool_t b_die; /* set by the outside */ \
|
||||
volatile vlc_bool_t b_dead; /* set by the object */ \
|
||||
\
|
||||
vlc_object_t * p_this; /* a pointer to ourselves */ \
|
||||
vlc_t * p_vlc; /* root of all evil */ \
|
||||
\
|
||||
volatile int i_refcount; \
|
||||
vlc_object_t ** pp_parents; /* our parents */ \
|
||||
volatile int i_parents; \
|
||||
vlc_object_t ** pp_children; /* our children */ \
|
||||
volatile int i_children; \
|
||||
\
|
||||
/* Just a reminder so that people don't cast garbage */ \
|
||||
int be_sure_to_add_VLC_COMMON_MEMBERS_to_struct; \
|
||||
|
||||
/* The real vlc_object_t type. Yes, it's that simple :-) */
|
||||
struct vlc_object_s
|
||||
{
|
||||
VLC_COMMON_MEMBERS
|
||||
};
|
||||
|
||||
/* CAST_TO_VLC_OBJECT: attempt at doing a clever cast */
|
||||
#define CAST_TO_VLC_OBJECT( x ) \
|
||||
((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct
|
||||
|
||||
/*****************************************************************************
|
||||
* Macros and inline functions
|
||||
@ -499,221 +535,15 @@ typedef __int64 off_t;
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Debug macros
|
||||
*****************************************************************************/
|
||||
/* ASSERT: this macro is used to test that a pointer is not nul. It inserts
|
||||
* the needed code when the program is compiled with the debug option, but
|
||||
* does nothing when not in debug mode. */
|
||||
#ifdef DEBUG
|
||||
# define ASSERT(p_Mem) \
|
||||
if (!(p_Mem)) \
|
||||
intf_ErrMsg("Void pointer error: " \
|
||||
"%s line %d (variable %s at address %p)\n", \
|
||||
__FILE__, __LINE__, #p_Mem, &p_Mem);
|
||||
#else
|
||||
# define ASSERT(p_Mem)
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
* Plug-in stuff
|
||||
*****************************************************************************/
|
||||
typedef struct module_symbols_s
|
||||
{
|
||||
struct main_s* p_main;
|
||||
struct module_bank_s* p_module_bank;
|
||||
struct input_bank_s* p_input_bank;
|
||||
struct aout_bank_s* p_aout_bank;
|
||||
struct vout_bank_s* p_vout_bank;
|
||||
|
||||
int ( * config_GetIntVariable ) ( const char * );
|
||||
float ( * config_GetFloatVariable ) ( const char * );
|
||||
char * ( * config_GetPszVariable ) ( const char * );
|
||||
void ( * config_PutIntVariable ) ( const char *, int );
|
||||
void ( * config_PutFloatVariable ) ( const char *, float );
|
||||
void ( * config_PutPszVariable ) ( const char *, char * );
|
||||
int ( * config_LoadConfigFile ) ( const char * );
|
||||
int ( * config_SaveConfigFile ) ( const char * );
|
||||
struct module_config_s * ( * config_FindConfig ) ( const char * );
|
||||
struct module_config_s * ( * config_Duplicate ) ( struct module_config_s* );
|
||||
void ( * config_SetCallbacks ) ( struct module_config_s *,
|
||||
struct module_config_s * );
|
||||
void ( * config_UnsetCallbacks ) ( struct module_config_s * );
|
||||
|
||||
struct intf_subscription_s * ( * intf_MsgSub ) ( void );
|
||||
void ( * intf_MsgUnsub ) ( struct intf_subscription_s * );
|
||||
|
||||
void ( * intf_Msg ) ( char *, ... );
|
||||
void ( * intf_ErrMsg ) ( char *, ... );
|
||||
void ( * intf_StatMsg ) ( char *, ... );
|
||||
void ( * intf_WarnMsg ) ( int, char *, ... );
|
||||
|
||||
int ( * intf_PlaylistAdd ) ( struct playlist_s *, int, const char* );
|
||||
int ( * intf_PlaylistDelete ) ( struct playlist_s *, int );
|
||||
void ( * intf_PlaylistNext ) ( struct playlist_s * );
|
||||
void ( * intf_PlaylistPrev ) ( struct playlist_s * );
|
||||
void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
|
||||
void ( * intf_PlaylistJumpto ) ( struct playlist_s *, int );
|
||||
void ( * intf_UrlDecode ) ( char * );
|
||||
int ( * intf_Eject ) ( const char * );
|
||||
|
||||
void ( * msleep ) ( mtime_t );
|
||||
mtime_t ( * mdate ) ( void );
|
||||
char * ( * mstrtime ) ( char *, mtime_t );
|
||||
|
||||
int ( * network_ChannelCreate )( void );
|
||||
int ( * network_ChannelJoin ) ( int );
|
||||
|
||||
int ( * input_SetProgram ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s * );
|
||||
void ( * input_SetStatus ) ( struct input_thread_s *, int );
|
||||
void ( * input_Seek ) ( struct input_thread_s *, off_t );
|
||||
void ( * input_DumpStream ) ( struct input_thread_s * );
|
||||
char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
|
||||
int ( * input_ChangeES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s *, u8 );
|
||||
int ( * input_ToggleES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s *, boolean_t );
|
||||
int ( * input_ChangeArea ) ( struct input_thread_s *,
|
||||
struct input_area_s * );
|
||||
int ( * input_ChangeProgram ) ( struct input_thread_s *, u16 );
|
||||
struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
|
||||
u16 );
|
||||
struct pgrm_descriptor_s * ( * input_FindProgram )
|
||||
( struct input_thread_s *, u16 );
|
||||
struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *, u16, size_t );
|
||||
void ( * input_DelES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s * );
|
||||
int ( * input_SelectES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s * );
|
||||
int ( * input_UnselectES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s * );
|
||||
struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
|
||||
u16, size_t );
|
||||
void ( * input_DelProgram ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s * );
|
||||
struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
|
||||
void ( * input_DelArea ) ( struct input_thread_s *,
|
||||
struct input_area_s * );
|
||||
|
||||
void ( * InitBitstream ) ( struct bit_stream_s *,
|
||||
struct decoder_fifo_s *,
|
||||
void ( * ) ( struct bit_stream_s *,
|
||||
boolean_t ),
|
||||
void * );
|
||||
void ( * BitstreamNextDataPacket )( struct bit_stream_s * );
|
||||
boolean_t ( * NextDataPacket ) ( struct decoder_fifo_s *,
|
||||
struct data_packet_s ** );
|
||||
void ( * DecoderError ) ( struct decoder_fifo_s * p_fifo );
|
||||
int ( * input_InitStream ) ( struct input_thread_s *, size_t );
|
||||
void ( * input_EndStream ) ( struct input_thread_s * );
|
||||
|
||||
void ( * input_ParsePES ) ( struct input_thread_s *,
|
||||
struct es_descriptor_s * );
|
||||
void ( * input_GatherPES ) ( struct input_thread_s *,
|
||||
struct data_packet_s *,
|
||||
struct es_descriptor_s *,
|
||||
boolean_t, boolean_t );
|
||||
void ( * input_DecodePES ) ( struct decoder_fifo_s *,
|
||||
struct pes_packet_s * );
|
||||
struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
|
||||
struct data_packet_s * );
|
||||
ssize_t ( * input_ReadPS ) ( struct input_thread_s *,
|
||||
struct data_packet_s ** );
|
||||
void ( * input_DemuxPS ) ( struct input_thread_s *,
|
||||
struct data_packet_s * );
|
||||
ssize_t ( * input_ReadTS ) ( struct input_thread_s *,
|
||||
struct data_packet_s ** );
|
||||
void ( * input_DemuxTS ) ( struct input_thread_s *,
|
||||
struct data_packet_s *,
|
||||
void(* pf_psi_callback)
|
||||
( struct input_thread_s *,
|
||||
struct data_packet_s *,
|
||||
struct es_descriptor_s *,
|
||||
boolean_t ) );
|
||||
void ( * input_ClockManageRef ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *,
|
||||
mtime_t );
|
||||
int ( * input_ClockManageControl ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *,
|
||||
mtime_t );
|
||||
mtime_t ( *input_ClockGetTS ) ( struct input_thread_s *,
|
||||
struct pgrm_descriptor_s *,
|
||||
mtime_t );
|
||||
void ( * input_FDSeek ) ( struct input_thread_s *, off_t );
|
||||
void ( * input_FDClose ) ( struct input_thread_s * );
|
||||
void ( * input_FDNetworkClose ) ( struct input_thread_s * );
|
||||
ssize_t ( * input_FDRead ) ( struct input_thread_s *, byte_t *,
|
||||
size_t );
|
||||
ssize_t ( * input_FDNetworkRead ) ( struct input_thread_s *, byte_t *,
|
||||
size_t );
|
||||
|
||||
void * ( * input_BuffersInit )( void );
|
||||
void ( * input_BuffersEnd )( struct input_buffers_s * );
|
||||
struct data_buffer_s * ( * input_NewBuffer )( struct input_buffers_s *, size_t );
|
||||
void ( * input_ReleaseBuffer )( struct input_buffers_s *, struct data_buffer_s * );
|
||||
struct data_packet_s * ( * input_ShareBuffer )( struct input_buffers_s *,
|
||||
struct data_buffer_s * );
|
||||
struct data_packet_s * ( * input_NewPacket )( struct input_buffers_s *, size_t );
|
||||
void ( * input_DeletePacket )( struct input_buffers_s *, struct data_packet_s * );
|
||||
struct pes_packet_s * ( * input_NewPES )( struct input_buffers_s * );
|
||||
void ( * input_DeletePES )( struct input_buffers_s *, struct pes_packet_s * );
|
||||
ssize_t ( * input_FillBuffer )( struct input_thread_s * );
|
||||
ssize_t ( * input_Peek )( struct input_thread_s *, byte_t **, size_t );
|
||||
ssize_t ( * input_SplitBuffer )( struct input_thread_s *, struct data_packet_s **, size_t );
|
||||
int ( * input_AccessInit )( struct input_thread_s * );
|
||||
void ( * input_AccessReinit )( struct input_thread_s * );
|
||||
void ( * input_AccessEnd )( struct input_thread_s * );
|
||||
|
||||
struct aout_fifo_s * ( * aout_CreateFifo ) ( int, int, int, int, void * );
|
||||
void ( * aout_DestroyFifo ) ( struct aout_fifo_s * );
|
||||
|
||||
struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u32, int );
|
||||
void ( * vout_DestroyThread ) ( struct vout_thread_s *, int * );
|
||||
|
||||
struct picture_s * ( * vout_CreatePicture )
|
||||
( struct vout_thread_s *,
|
||||
boolean_t, boolean_t, boolean_t );
|
||||
void ( * vout_AllocatePicture )( struct picture_s *, int, int, u32 );
|
||||
void ( * vout_DisplayPicture ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( * vout_DestroyPicture ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( * vout_LinkPicture ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( * vout_UnlinkPicture ) ( struct vout_thread_s *,
|
||||
struct picture_s * );
|
||||
void ( * vout_DatePicture ) ( struct vout_thread_s *,
|
||||
struct picture_s *, mtime_t );
|
||||
void ( * vout_PlacePicture ) ( struct vout_thread_s *, int, int,
|
||||
int *, int *, int *, int * );
|
||||
int ( * vout_ChromaCmp ) ( u32, u32 );
|
||||
|
||||
struct subpicture_s * (* vout_CreateSubPicture)
|
||||
( struct vout_thread_s *, int, int );
|
||||
void ( * vout_DestroySubPicture ) ( struct vout_thread_s *,
|
||||
struct subpicture_s * );
|
||||
void ( * vout_DisplaySubPicture ) ( struct vout_thread_s *,
|
||||
struct subpicture_s * );
|
||||
|
||||
u32 ( * UnalignedShowBits ) ( struct bit_stream_s *, unsigned int );
|
||||
void ( * UnalignedRemoveBits ) ( struct bit_stream_s * );
|
||||
u32 ( * UnalignedGetBits ) ( struct bit_stream_s *, unsigned int );
|
||||
void ( * CurrentPTS ) ( struct bit_stream_s *, mtime_t *,
|
||||
mtime_t * );
|
||||
|
||||
const iso639_lang_t * ( * GetLang_1 ) ( const char * );
|
||||
const iso639_lang_t * ( * GetLang_2T ) ( const char * );
|
||||
const iso639_lang_t * ( * GetLang_2B ) ( const char * );
|
||||
const char * ( * DecodeLanguage ) ( u16 );
|
||||
|
||||
struct module_s * ( * module_Need ) ( int, char *, void * );
|
||||
void ( * module_Unneed ) ( struct module_s * );
|
||||
|
||||
} module_symbols_t;
|
||||
|
||||
#ifdef __PLUGIN__
|
||||
extern module_symbols_t* p_symbols;
|
||||
#ifndef __PLUGIN__
|
||||
# define VLC_EXPORT( type, name, args ) type name args;
|
||||
#else
|
||||
# define VLC_EXPORT( type, name, args ) ;
|
||||
extern module_symbols_t* p_symbols;
|
||||
#endif
|
||||
|
||||
#include "vlc_symbols.h"
|
||||
|
25
include/vlc_cpu.h
Normal file
25
include/vlc_cpu.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*****************************************************************************
|
||||
* cpu.h: CPU type detection
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: vlc_cpu.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
u32 CPUCapabilities( vlc_object_t * );
|
||||
|
123
include/vlc_messages.h
Normal file
123
include/vlc_messages.h
Normal file
@ -0,0 +1,123 @@
|
||||
/*****************************************************************************
|
||||
* messages.h: messages interface
|
||||
* This library provides basic functions for threads to interact with user
|
||||
* interface, such as message output.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
|
||||
* $Id: vlc_messages.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* msg_item_t
|
||||
*****************************************************************************
|
||||
* Store a single message.
|
||||
*****************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
int i_type; /* message type, see below */
|
||||
char * psz_module;
|
||||
char * psz_msg; /* the message itself */
|
||||
|
||||
#if 0
|
||||
mtime_t date; /* date of the message */
|
||||
char * psz_file; /* file in which the function was called */
|
||||
char * psz_function; /* function from which the function was called */
|
||||
int i_line; /* line at which the function was called */
|
||||
#endif
|
||||
} msg_item_t;
|
||||
|
||||
/* Message types */
|
||||
#define VLC_MSG_INFO 0 /* standard messages */
|
||||
#define VLC_MSG_ERR 1 /* error messages */
|
||||
#define VLC_MSG_WARN 2 /* warning messages */
|
||||
#define VLC_MSG_DBG 3 /* debug messages */
|
||||
|
||||
/*****************************************************************************
|
||||
* msg_bank_t
|
||||
*****************************************************************************
|
||||
* Store all data requiered by messages interfaces.
|
||||
*****************************************************************************/
|
||||
struct msg_bank_s
|
||||
{
|
||||
/* Message queue lock */
|
||||
vlc_mutex_t lock;
|
||||
|
||||
/* Message queue */
|
||||
msg_item_t msg[VLC_MSG_QSIZE]; /* message queue */
|
||||
int i_start;
|
||||
int i_stop;
|
||||
|
||||
/* Subscribers */
|
||||
int i_sub;
|
||||
msg_subscription_t **pp_sub;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* msg_subscription_t
|
||||
*****************************************************************************
|
||||
* Used by interface plugins which subscribe to the message bank.
|
||||
*****************************************************************************/
|
||||
struct msg_subscription_s
|
||||
{
|
||||
int i_start;
|
||||
int* pi_stop;
|
||||
|
||||
msg_item_t* p_msg;
|
||||
vlc_mutex_t* p_lock;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) );
|
||||
VLC_EXPORT( void, __msg_Info, ( void *, const char *, ... ) );
|
||||
VLC_EXPORT( void, __msg_Err, ( void *, const char *, ... ) );
|
||||
VLC_EXPORT( void, __msg_Warn, ( void *, const char *, ... ) );
|
||||
VLC_EXPORT( void, __msg_Dbg, ( void *, const char *, ... ) );
|
||||
|
||||
#ifdef HAVE_VARIADIC_MACROS
|
||||
|
||||
# define msg_Info( p_this, psz_format, args... ) \
|
||||
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_INFO, MODULE_STRING, \
|
||||
psz_format, ## args )
|
||||
|
||||
# define msg_Err( p_this, psz_format, args... ) \
|
||||
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_ERR, MODULE_STRING, \
|
||||
psz_format, ## args )
|
||||
|
||||
# define msg_Warn( p_this, psz_format, args... ) \
|
||||
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_WARN, MODULE_STRING, \
|
||||
psz_format, ## args )
|
||||
|
||||
# define msg_Dbg( p_this, psz_format, args... ) \
|
||||
__msg_Generic( CAST_TO_VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
|
||||
psz_format, ## args )
|
||||
|
||||
#else /* HAVE_VARIADIC_MACROS */
|
||||
|
||||
# define msg_Info __msg_Info
|
||||
# define msg_Err __msg_Err
|
||||
# define msg_Warn __msg_Warn
|
||||
# define msg_Dbg __msg_Dbg
|
||||
|
||||
#endif /* HAVE_VARIADIC_MACROS */
|
||||
|
90
include/vlc_objects.h
Normal file
90
include/vlc_objects.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*****************************************************************************
|
||||
* vlc_objects.h: vlc_object_t definition.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: vlc_objects.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
|
||||
*****************************************************************************/
|
||||
|
||||
/* Object types */
|
||||
#define VLC_OBJECT_ROOT (-1)
|
||||
#define VLC_OBJECT_MODULE (-2)
|
||||
#define VLC_OBJECT_INTF (-3)
|
||||
#define VLC_OBJECT_PLAYLIST (-4)
|
||||
#define VLC_OBJECT_INPUT (-5)
|
||||
#define VLC_OBJECT_DECODER (-6)
|
||||
#define VLC_OBJECT_VOUT (-7)
|
||||
#define VLC_OBJECT_AOUT (-8)
|
||||
#define VLC_OBJECT_PRIVATE (-666)
|
||||
|
||||
/* Object search mode */
|
||||
#define FIND_PARENT 0x0001
|
||||
#define FIND_CHILD 0x0002
|
||||
#define FIND_ANYWHERE 0x0003
|
||||
|
||||
#define FIND_STRICT 0x0010
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
VLC_EXPORT( void *, __vlc_object_create, ( vlc_object_t *, int ) );
|
||||
VLC_EXPORT( void, __vlc_object_destroy, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
|
||||
VLC_EXPORT( void, __vlc_object_yield, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, __vlc_object_unlink, ( vlc_object_t *, vlc_object_t * ) );
|
||||
VLC_EXPORT( void, __vlc_object_unlink_all, ( vlc_object_t * ) );
|
||||
VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
|
||||
#if 0
|
||||
//VLC_EXPORT( void, __vlc_object_setchild, ( vlc_object_t *, vlc_object_t * ) );
|
||||
#endif
|
||||
|
||||
VLC_EXPORT( void, __vlc_dumpstructure, ( vlc_object_t * ) );
|
||||
|
||||
#define vlc_object_create(a,b) \
|
||||
__vlc_object_create( CAST_TO_VLC_OBJECT(a), b )
|
||||
|
||||
#define vlc_object_destroy(a) \
|
||||
__vlc_object_destroy( CAST_TO_VLC_OBJECT(a) )
|
||||
|
||||
#define vlc_object_find(a,b,c) \
|
||||
__vlc_object_find( CAST_TO_VLC_OBJECT(a),b,c)
|
||||
|
||||
#define vlc_object_yield(a) \
|
||||
__vlc_object_yield( CAST_TO_VLC_OBJECT(a) )
|
||||
|
||||
#define vlc_object_release(a) \
|
||||
__vlc_object_release( CAST_TO_VLC_OBJECT(a) )
|
||||
|
||||
#define vlc_object_unlink(a,b) \
|
||||
__vlc_object_unlink( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
|
||||
|
||||
#define vlc_object_unlink_all(a) \
|
||||
__vlc_object_unlink_all( CAST_TO_VLC_OBJECT(a) )
|
||||
|
||||
#define vlc_object_attach(a,b) \
|
||||
__vlc_object_attach( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
|
||||
|
||||
#if 0
|
||||
#define vlc_object_setchild(a,b) \
|
||||
__vlc_object_setchild( CAST_TO_VLC_OBJECT(a), CAST_TO_VLC_OBJECT(b) )
|
||||
#endif
|
||||
|
||||
#define vlc_dumpstructure(a) \
|
||||
__vlc_dumpstructure( CAST_TO_VLC_OBJECT(a) )
|
||||
|
273
include/vlc_symbols.h
Normal file
273
include/vlc_symbols.h
Normal file
@ -0,0 +1,273 @@
|
||||
/* DO NOT EDIT THIS FILE ! It was generated by bootstrap.sh */
|
||||
|
||||
struct module_symbols_s
|
||||
{
|
||||
aout_fifo_t * (* aout_CreateFifo_inner) ( vlc_object_t *, int, int, int, int, void * ) ;
|
||||
void (* aout_DestroyFifo_inner) ( aout_fifo_t *p_fifo ) ;
|
||||
int (* __config_GetInt_inner) (vlc_object_t *, const char *) ;
|
||||
void (* __config_PutInt_inner) (vlc_object_t *, const char *, int) ;
|
||||
float (* __config_GetFloat_inner) (vlc_object_t *, const char *) ;
|
||||
void (* __config_PutFloat_inner) (vlc_object_t *, const char *, float) ;
|
||||
char * (* __config_GetPsz_inner) (vlc_object_t *, const char *) ;
|
||||
void (* __config_PutPsz_inner) (vlc_object_t *, const char *, char *) ;
|
||||
int (* config_LoadCmdLine_inner) ( vlc_object_t *, int *, char *[], vlc_bool_t ) ;
|
||||
char * (* config_GetHomeDir_inner) ( void ) ;
|
||||
int (* config_LoadConfigFile_inner) ( vlc_object_t *, const char * ) ;
|
||||
int (* config_SaveConfigFile_inner) ( vlc_object_t *, const char * ) ;
|
||||
module_config_t * (* config_FindConfig_inner) ( vlc_object_t *, const char *psz_name ) ;
|
||||
void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
|
||||
void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ;
|
||||
void (* config_UnsetCallbacks_inner) ( module_config_t * ) ;
|
||||
void (* InitBitstream_inner) ( bit_stream_t *, decoder_fifo_t *, void ( * )( bit_stream_t *, vlc_bool_t ), void * p_callback_arg ) ;
|
||||
vlc_bool_t (* NextDataPacket_inner) ( decoder_fifo_t *, data_packet_t ** ) ;
|
||||
void (* BitstreamNextDataPacket_inner) ( bit_stream_t * ) ;
|
||||
u32 (* UnalignedShowBits_inner) ( bit_stream_t *, unsigned int ) ;
|
||||
void (* UnalignedRemoveBits_inner) ( bit_stream_t * ) ;
|
||||
u32 (* UnalignedGetBits_inner) ( bit_stream_t *, unsigned int ) ;
|
||||
void (* CurrentPTS_inner) ( bit_stream_t *, mtime_t *, mtime_t * ) ;
|
||||
void (* DecoderError_inner) ( decoder_fifo_t * p_fifo ) ;
|
||||
void (* __input_SetStatus_inner) ( vlc_object_t *, int ) ;
|
||||
void (* __input_Seek_inner) ( vlc_object_t *, off_t, int ) ;
|
||||
void (* __input_Tell_inner) ( vlc_object_t *, stream_position_t * ) ;
|
||||
void (* input_DumpStream_inner) ( input_thread_t * ) ;
|
||||
char * (* input_OffsetToTime_inner) ( input_thread_t *, char *, off_t ) ;
|
||||
int (* input_ChangeES_inner) ( input_thread_t *, es_descriptor_t *, u8 ) ;
|
||||
int (* input_ToggleES_inner) ( input_thread_t *, es_descriptor_t *, vlc_bool_t ) ;
|
||||
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
|
||||
int (* input_ChangeProgram_inner) ( input_thread_t *, u16 ) ;
|
||||
int (* input_InitStream_inner) ( input_thread_t *, size_t ) ;
|
||||
void (* input_EndStream_inner) ( input_thread_t * ) ;
|
||||
pgrm_descriptor_t * (* input_FindProgram_inner) ( input_thread_t *, u16 ) ;
|
||||
pgrm_descriptor_t * (* input_AddProgram_inner) ( input_thread_t *, u16, size_t ) ;
|
||||
void (* input_DelProgram_inner) ( input_thread_t *, pgrm_descriptor_t * ) ;
|
||||
int (* input_SetProgram_inner) ( input_thread_t *, pgrm_descriptor_t * ) ;
|
||||
input_area_t * (* input_AddArea_inner) ( input_thread_t * ) ;
|
||||
void (* input_DelArea_inner) ( input_thread_t *, input_area_t * ) ;
|
||||
es_descriptor_t * (* input_FindES_inner) ( input_thread_t *, u16 ) ;
|
||||
es_descriptor_t * (* input_AddES_inner) ( input_thread_t *, pgrm_descriptor_t *, u16, size_t ) ;
|
||||
void (* input_DelES_inner) ( input_thread_t *, es_descriptor_t * ) ;
|
||||
int (* input_SelectES_inner) ( input_thread_t *, es_descriptor_t * ) ;
|
||||
int (* input_UnselectES_inner) ( input_thread_t *, es_descriptor_t * ) ;
|
||||
void (* input_DecodePES_inner) ( decoder_fifo_t *, pes_packet_t * ) ;
|
||||
int (* input_ClockManageControl_inner) ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) ;
|
||||
void (* input_ClockManageRef_inner) ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) ;
|
||||
mtime_t (* input_ClockGetTS_inner) ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) ;
|
||||
void * (* input_BuffersInit_inner) ( vlc_object_t * ) ;
|
||||
void (* input_BuffersEnd_inner) ( input_thread_t *, input_buffers_t * ) ;
|
||||
data_buffer_t * (* input_NewBuffer_inner) ( input_buffers_t *, size_t ) ;
|
||||
void (* input_ReleaseBuffer_inner) ( input_buffers_t *, data_buffer_t * ) ;
|
||||
data_packet_t * (* input_ShareBuffer_inner) ( input_buffers_t *, data_buffer_t * ) ;
|
||||
data_packet_t * (* input_NewPacket_inner) ( input_buffers_t *, size_t ) ;
|
||||
void (* input_DeletePacket_inner) ( input_buffers_t *, data_packet_t * ) ;
|
||||
pes_packet_t * (* input_NewPES_inner) ( input_buffers_t * ) ;
|
||||
void (* input_DeletePES_inner) ( input_buffers_t *, pes_packet_t * ) ;
|
||||
ssize_t (* input_FillBuffer_inner) ( input_thread_t * ) ;
|
||||
ssize_t (* input_Peek_inner) ( input_thread_t *, byte_t **, size_t ) ;
|
||||
ssize_t (* input_SplitBuffer_inner) ( input_thread_t *, data_packet_t **, size_t ) ;
|
||||
int (* input_AccessInit_inner) ( input_thread_t * ) ;
|
||||
void (* input_AccessReinit_inner) ( input_thread_t * ) ;
|
||||
void (* input_AccessEnd_inner) ( input_thread_t * ) ;
|
||||
void (* input_ParsePES_inner) ( input_thread_t *, es_descriptor_t * ) ;
|
||||
void (* input_GatherPES_inner) ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t, vlc_bool_t ) ;
|
||||
ssize_t (* input_ReadPS_inner) ( input_thread_t *, data_packet_t ** ) ;
|
||||
es_descriptor_t * (* input_ParsePS_inner) ( input_thread_t *, data_packet_t * ) ;
|
||||
ssize_t (* input_ReadTS_inner) ( input_thread_t *, data_packet_t ** ) ;
|
||||
void (* input_DemuxPS_inner) ( input_thread_t *, data_packet_t * ) ;
|
||||
void (* input_DemuxTS_inner) ( input_thread_t *, data_packet_t *, void(*) ( input_thread_t *, data_packet_t *, es_descriptor_t *, vlc_bool_t ) ) ;
|
||||
void (* input_FDClose_inner) ( input_thread_t * ) ;
|
||||
void (* input_FDNetworkClose_inner) ( input_thread_t * ) ;
|
||||
ssize_t (* input_FDRead_inner) ( input_thread_t *, byte_t *, size_t ) ;
|
||||
ssize_t (* input_FDNetworkRead_inner) ( input_thread_t *, byte_t *, size_t ) ;
|
||||
void (* input_FDSeek_inner) ( input_thread_t *, off_t ) ;
|
||||
msg_subscription_t* (* msg_Subscribe_inner) ( vlc_object_t * ) ;
|
||||
void (* msg_Unsubscribe_inner) ( vlc_object_t *, msg_subscription_t * ) ;
|
||||
int (* intf_Eject_inner) ( vlc_object_t *, const char * ) ;
|
||||
const iso639_lang_t * (* GetLang_1_inner) ( const char * ) ;
|
||||
const iso639_lang_t * (* GetLang_2T_inner) ( const char * ) ;
|
||||
const iso639_lang_t * (* GetLang_2B_inner) ( const char * ) ;
|
||||
const char * (* DecodeLanguage_inner) ( u16 ) ;
|
||||
module_t * (* __module_Need_inner) ( vlc_object_t *, int, char *, void * ) ;
|
||||
void (* module_Unneed_inner) ( module_t * ) ;
|
||||
char * (* mstrtime_inner) ( char *psz_buffer, mtime_t date ) ;
|
||||
mtime_t (* mdate_inner) ( void ) ;
|
||||
void (* mwait_inner) ( mtime_t date ) ;
|
||||
void (* msleep_inner) ( mtime_t delay ) ;
|
||||
int (* network_ChannelJoin_inner) ( vlc_object_t *, int ) ;
|
||||
int (* network_ChannelCreate_inner) ( vlc_object_t * ) ;
|
||||
void (* playlist_Command_inner) ( playlist_t *, int, int ) ;
|
||||
int (* playlist_Add_inner) ( vlc_object_t *, int, const char * ) ;
|
||||
int (* playlist_Delete_inner) ( playlist_t *, int ) ;
|
||||
int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
|
||||
int (* vlc_threads_end_inner) ( void ) ;
|
||||
int (* __vlc_mutex_init_inner) ( vlc_object_t *, vlc_mutex_t * ) ;
|
||||
int (* __vlc_mutex_destroy_inner) ( char *, int, vlc_mutex_t * ) ;
|
||||
int (* vlc_cond_init_inner) ( vlc_cond_t * ) ;
|
||||
int (* __vlc_cond_destroy_inner) ( char *, int, vlc_cond_t * ) ;
|
||||
int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ;
|
||||
void (* __vlc_thread_ready_inner) ( vlc_object_t * ) ;
|
||||
void (* __vlc_thread_join_inner) ( vlc_object_t *, char *, int ) ;
|
||||
vout_thread_t * (* vout_CreateThread_inner) ( vlc_object_t *, int, int, u32, int ) ;
|
||||
void (* vout_DestroyThread_inner) ( vout_thread_t * ) ;
|
||||
int (* vout_ChromaCmp_inner) ( u32, u32 ) ;
|
||||
picture_t * (* vout_CreatePicture_inner) ( vout_thread_t *, vlc_bool_t, vlc_bool_t, vlc_bool_t ) ;
|
||||
void (* vout_AllocatePicture_inner) ( vout_thread_t *, picture_t *, int, int, u32 ) ;
|
||||
void (* vout_DestroyPicture_inner) ( vout_thread_t *, picture_t * ) ;
|
||||
void (* vout_DisplayPicture_inner) ( vout_thread_t *, picture_t * ) ;
|
||||
void (* vout_DatePicture_inner) ( vout_thread_t *, picture_t *, mtime_t ) ;
|
||||
void (* vout_LinkPicture_inner) ( vout_thread_t *, picture_t * ) ;
|
||||
void (* vout_UnlinkPicture_inner) ( vout_thread_t *, picture_t * ) ;
|
||||
void (* vout_PlacePicture_inner) ( vout_thread_t *, int, int, int *, int *, int *, int * ) ;
|
||||
subpicture_t * (* vout_CreateSubPicture_inner) ( vout_thread_t *, int, int ) ;
|
||||
void (* vout_DestroySubPicture_inner) ( vout_thread_t *, subpicture_t * ) ;
|
||||
void (* vout_DisplaySubPicture_inner) ( vout_thread_t *, subpicture_t * ) ;
|
||||
void (* __msg_Generic_inner) ( vlc_object_t *, int, const char *, const char *, ... ) ;
|
||||
void (* __msg_Info_inner) ( void *, const char *, ... ) ;
|
||||
void (* __msg_Err_inner) ( void *, const char *, ... ) ;
|
||||
void (* __msg_Warn_inner) ( void *, const char *, ... ) ;
|
||||
void (* __msg_Dbg_inner) ( void *, const char *, ... ) ;
|
||||
void * (* __vlc_object_create_inner) ( vlc_object_t *, int ) ;
|
||||
void (* __vlc_object_destroy_inner) ( vlc_object_t * ) ;
|
||||
void * (* __vlc_object_find_inner) ( vlc_object_t *, int, int ) ;
|
||||
void (* __vlc_object_yield_inner) ( vlc_object_t * ) ;
|
||||
void (* __vlc_object_release_inner) ( vlc_object_t * ) ;
|
||||
void (* __vlc_object_unlink_inner) ( vlc_object_t *, vlc_object_t * ) ;
|
||||
void (* __vlc_object_unlink_all_inner) ( vlc_object_t * ) ;
|
||||
void (* __vlc_object_attach_inner) ( vlc_object_t *, vlc_object_t * ) ;
|
||||
void (* __vlc_dumpstructure_inner) ( vlc_object_t * ) ;
|
||||
};
|
||||
|
||||
#ifdef __PLUGIN__
|
||||
# define aout_CreateFifo p_symbols->aout_CreateFifo_inner
|
||||
# define aout_DestroyFifo p_symbols->aout_DestroyFifo_inner
|
||||
# define __config_GetInt p_symbols->__config_GetInt_inner
|
||||
# define __config_PutInt p_symbols->__config_PutInt_inner
|
||||
# define __config_GetFloat p_symbols->__config_GetFloat_inner
|
||||
# define __config_PutFloat p_symbols->__config_PutFloat_inner
|
||||
# define __config_GetPsz p_symbols->__config_GetPsz_inner
|
||||
# define __config_PutPsz p_symbols->__config_PutPsz_inner
|
||||
# define config_LoadCmdLine p_symbols->config_LoadCmdLine_inner
|
||||
# define config_GetHomeDir p_symbols->config_GetHomeDir_inner
|
||||
# define config_LoadConfigFile p_symbols->config_LoadConfigFile_inner
|
||||
# define config_SaveConfigFile p_symbols->config_SaveConfigFile_inner
|
||||
# define config_FindConfig p_symbols->config_FindConfig_inner
|
||||
# define config_Duplicate p_symbols->config_Duplicate_inner
|
||||
# define config_SetCallbacks p_symbols->config_SetCallbacks_inner
|
||||
# define config_UnsetCallbacks p_symbols->config_UnsetCallbacks_inner
|
||||
# define InitBitstream p_symbols->InitBitstream_inner
|
||||
# define NextDataPacket p_symbols->NextDataPacket_inner
|
||||
# define BitstreamNextDataPacket p_symbols->BitstreamNextDataPacket_inner
|
||||
# define UnalignedShowBits p_symbols->UnalignedShowBits_inner
|
||||
# define UnalignedRemoveBits p_symbols->UnalignedRemoveBits_inner
|
||||
# define UnalignedGetBits p_symbols->UnalignedGetBits_inner
|
||||
# define CurrentPTS p_symbols->CurrentPTS_inner
|
||||
# define DecoderError p_symbols->DecoderError_inner
|
||||
# define __input_SetStatus p_symbols->__input_SetStatus_inner
|
||||
# define __input_Seek p_symbols->__input_Seek_inner
|
||||
# define __input_Tell p_symbols->__input_Tell_inner
|
||||
# define input_DumpStream p_symbols->input_DumpStream_inner
|
||||
# define input_OffsetToTime p_symbols->input_OffsetToTime_inner
|
||||
# define input_ChangeES p_symbols->input_ChangeES_inner
|
||||
# define input_ToggleES p_symbols->input_ToggleES_inner
|
||||
# define input_ChangeArea p_symbols->input_ChangeArea_inner
|
||||
# define input_ChangeProgram p_symbols->input_ChangeProgram_inner
|
||||
# define input_InitStream p_symbols->input_InitStream_inner
|
||||
# define input_EndStream p_symbols->input_EndStream_inner
|
||||
# define input_FindProgram p_symbols->input_FindProgram_inner
|
||||
# define input_AddProgram p_symbols->input_AddProgram_inner
|
||||
# define input_DelProgram p_symbols->input_DelProgram_inner
|
||||
# define input_SetProgram p_symbols->input_SetProgram_inner
|
||||
# define input_AddArea p_symbols->input_AddArea_inner
|
||||
# define input_DelArea p_symbols->input_DelArea_inner
|
||||
# define input_FindES p_symbols->input_FindES_inner
|
||||
# define input_AddES p_symbols->input_AddES_inner
|
||||
# define input_DelES p_symbols->input_DelES_inner
|
||||
# define input_SelectES p_symbols->input_SelectES_inner
|
||||
# define input_UnselectES p_symbols->input_UnselectES_inner
|
||||
# define input_DecodePES p_symbols->input_DecodePES_inner
|
||||
# define input_ClockManageControl p_symbols->input_ClockManageControl_inner
|
||||
# define input_ClockManageRef p_symbols->input_ClockManageRef_inner
|
||||
# define input_ClockGetTS p_symbols->input_ClockGetTS_inner
|
||||
# define input_BuffersInit p_symbols->input_BuffersInit_inner
|
||||
# define input_BuffersEnd p_symbols->input_BuffersEnd_inner
|
||||
# define input_NewBuffer p_symbols->input_NewBuffer_inner
|
||||
# define input_ReleaseBuffer p_symbols->input_ReleaseBuffer_inner
|
||||
# define input_ShareBuffer p_symbols->input_ShareBuffer_inner
|
||||
# define input_NewPacket p_symbols->input_NewPacket_inner
|
||||
# define input_DeletePacket p_symbols->input_DeletePacket_inner
|
||||
# define input_NewPES p_symbols->input_NewPES_inner
|
||||
# define input_DeletePES p_symbols->input_DeletePES_inner
|
||||
# define input_FillBuffer p_symbols->input_FillBuffer_inner
|
||||
# define input_Peek p_symbols->input_Peek_inner
|
||||
# define input_SplitBuffer p_symbols->input_SplitBuffer_inner
|
||||
# define input_AccessInit p_symbols->input_AccessInit_inner
|
||||
# define input_AccessReinit p_symbols->input_AccessReinit_inner
|
||||
# define input_AccessEnd p_symbols->input_AccessEnd_inner
|
||||
# define input_ParsePES p_symbols->input_ParsePES_inner
|
||||
# define input_GatherPES p_symbols->input_GatherPES_inner
|
||||
# define input_ReadPS p_symbols->input_ReadPS_inner
|
||||
# define input_ParsePS p_symbols->input_ParsePS_inner
|
||||
# define input_ReadTS p_symbols->input_ReadTS_inner
|
||||
# define input_DemuxPS p_symbols->input_DemuxPS_inner
|
||||
# define input_DemuxTS p_symbols->input_DemuxTS_inner
|
||||
# define input_FDClose p_symbols->input_FDClose_inner
|
||||
# define input_FDNetworkClose p_symbols->input_FDNetworkClose_inner
|
||||
# define input_FDRead p_symbols->input_FDRead_inner
|
||||
# define input_FDNetworkRead p_symbols->input_FDNetworkRead_inner
|
||||
# define input_FDSeek p_symbols->input_FDSeek_inner
|
||||
# define msg_Subscribe p_symbols->msg_Subscribe_inner
|
||||
# define msg_Unsubscribe p_symbols->msg_Unsubscribe_inner
|
||||
# define intf_Eject p_symbols->intf_Eject_inner
|
||||
# define GetLang_1 p_symbols->GetLang_1_inner
|
||||
# define GetLang_2T p_symbols->GetLang_2T_inner
|
||||
# define GetLang_2B p_symbols->GetLang_2B_inner
|
||||
# define DecodeLanguage p_symbols->DecodeLanguage_inner
|
||||
# define __module_Need p_symbols->__module_Need_inner
|
||||
# define module_Unneed p_symbols->module_Unneed_inner
|
||||
# define mstrtime p_symbols->mstrtime_inner
|
||||
# define mdate p_symbols->mdate_inner
|
||||
# define mwait p_symbols->mwait_inner
|
||||
# define msleep p_symbols->msleep_inner
|
||||
# define network_ChannelJoin p_symbols->network_ChannelJoin_inner
|
||||
# define network_ChannelCreate p_symbols->network_ChannelCreate_inner
|
||||
# define playlist_Command p_symbols->playlist_Command_inner
|
||||
# define playlist_Add p_symbols->playlist_Add_inner
|
||||
# define playlist_Delete p_symbols->playlist_Delete_inner
|
||||
# define __vlc_threads_init p_symbols->__vlc_threads_init_inner
|
||||
# define vlc_threads_end p_symbols->vlc_threads_end_inner
|
||||
# define __vlc_mutex_init p_symbols->__vlc_mutex_init_inner
|
||||
# define __vlc_mutex_destroy p_symbols->__vlc_mutex_destroy_inner
|
||||
# define vlc_cond_init p_symbols->vlc_cond_init_inner
|
||||
# define __vlc_cond_destroy p_symbols->__vlc_cond_destroy_inner
|
||||
# define __vlc_thread_create p_symbols->__vlc_thread_create_inner
|
||||
# define __vlc_thread_ready p_symbols->__vlc_thread_ready_inner
|
||||
# define __vlc_thread_join p_symbols->__vlc_thread_join_inner
|
||||
# define vout_CreateThread p_symbols->vout_CreateThread_inner
|
||||
# define vout_DestroyThread p_symbols->vout_DestroyThread_inner
|
||||
# define vout_ChromaCmp p_symbols->vout_ChromaCmp_inner
|
||||
# define vout_CreatePicture p_symbols->vout_CreatePicture_inner
|
||||
# define vout_AllocatePicture p_symbols->vout_AllocatePicture_inner
|
||||
# define vout_DestroyPicture p_symbols->vout_DestroyPicture_inner
|
||||
# define vout_DisplayPicture p_symbols->vout_DisplayPicture_inner
|
||||
# define vout_DatePicture p_symbols->vout_DatePicture_inner
|
||||
# define vout_LinkPicture p_symbols->vout_LinkPicture_inner
|
||||
# define vout_UnlinkPicture p_symbols->vout_UnlinkPicture_inner
|
||||
# define vout_PlacePicture p_symbols->vout_PlacePicture_inner
|
||||
# define vout_CreateSubPicture p_symbols->vout_CreateSubPicture_inner
|
||||
# define vout_DestroySubPicture p_symbols->vout_DestroySubPicture_inner
|
||||
# define vout_DisplaySubPicture p_symbols->vout_DisplaySubPicture_inner
|
||||
# define __msg_Generic p_symbols->__msg_Generic_inner
|
||||
# define __msg_Info p_symbols->__msg_Info_inner
|
||||
# define __msg_Err p_symbols->__msg_Err_inner
|
||||
# define __msg_Warn p_symbols->__msg_Warn_inner
|
||||
# define __msg_Dbg p_symbols->__msg_Dbg_inner
|
||||
# define __vlc_object_create p_symbols->__vlc_object_create_inner
|
||||
# define __vlc_object_destroy p_symbols->__vlc_object_destroy_inner
|
||||
# define __vlc_object_find p_symbols->__vlc_object_find_inner
|
||||
# define __vlc_object_yield p_symbols->__vlc_object_yield_inner
|
||||
# define __vlc_object_release p_symbols->__vlc_object_release_inner
|
||||
# define __vlc_object_unlink p_symbols->__vlc_object_unlink_inner
|
||||
# define __vlc_object_unlink_all p_symbols->__vlc_object_unlink_all_inner
|
||||
# define __vlc_object_attach p_symbols->__vlc_object_attach_inner
|
||||
# define __vlc_dumpstructure p_symbols->__vlc_dumpstructure_inner
|
||||
#endif /* __PLUGIN__ */
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This header provides a portable threads implementation.
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: threads.h,v 1.42 2002/04/27 22:11:22 gbazin Exp $
|
||||
* $Id: vlc_threads.h,v 1.1 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@via.ecp.fr>
|
||||
@ -36,17 +36,17 @@
|
||||
#elif defined( ST_INIT_IN_ST_H ) /* State threads */
|
||||
# include <st.h>
|
||||
|
||||
#elif defined( WIN32 )
|
||||
#elif defined( WIN32 ) /* Win32 API */
|
||||
# include <process.h>
|
||||
|
||||
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */
|
||||
# include <pthread.h>
|
||||
# ifdef DEBUG
|
||||
/* Needed for pthread_cond_timedwait */
|
||||
/* Needed for pthread_cond_timedwait */
|
||||
# include <errno.h>
|
||||
# endif
|
||||
/* This is not prototyped under Linux, though it exists. */
|
||||
int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
|
||||
/* This is not prototyped under Linux, though it exists. */
|
||||
int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
|
||||
|
||||
#elif defined( HAVE_CTHREADS_H ) /* GNUMach */
|
||||
# include <cthreads.h>
|
||||
@ -106,8 +106,9 @@ typedef HANDLE vlc_thread_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CRITICAL_SECTION csection;
|
||||
HANDLE mutex;
|
||||
CRITICAL_SECTION csection;
|
||||
HANDLE mutex;
|
||||
SIGNALOBJECTANDWAIT SignalObjectAndWait;
|
||||
} vlc_mutex_t;
|
||||
|
||||
typedef struct
|
||||
@ -127,16 +128,18 @@ typedef pthread_cond_t vlc_cond_t;
|
||||
typedef cthread_t vlc_thread_t;
|
||||
|
||||
/* Those structs are the ones defined in /include/cthreads.h but we need
|
||||
* to handle (*foo) where foo is a (mutex_t) while they handle (foo) where
|
||||
* to handle (&foo) where foo is a (mutex_t) while they handle (foo) where
|
||||
* foo is a (mutex_t*) */
|
||||
typedef struct s_mutex {
|
||||
typedef struct
|
||||
{
|
||||
spin_lock_t held;
|
||||
spin_lock_t lock;
|
||||
char *name;
|
||||
struct cthread_queue queue;
|
||||
} vlc_mutex_t;
|
||||
|
||||
typedef struct s_condition {
|
||||
typedef struct
|
||||
{
|
||||
spin_lock_t lock;
|
||||
struct cthread_queue queue;
|
||||
char *name;
|
||||
@ -164,45 +167,3 @@ typedef struct
|
||||
|
||||
#endif
|
||||
|
||||
typedef void *(*vlc_thread_func_t)(void *p_data);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototype for GPROF wrapper
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef GPROF
|
||||
/* Wrapper function for profiling */
|
||||
static void * vlc_thread_wrapper ( void *p_wrapper );
|
||||
|
||||
# ifdef WIN32
|
||||
|
||||
# define ITIMER_REAL 1
|
||||
# define ITIMER_PROF 2
|
||||
|
||||
struct itimerval
|
||||
{
|
||||
struct timeval it_value;
|
||||
struct timeval it_interval;
|
||||
};
|
||||
|
||||
int setitimer(int kind, const struct itimerval* itnew, struct itimerval* itold);
|
||||
|
||||
# endif /* WIN32 */
|
||||
|
||||
typedef struct wrapper_s
|
||||
{
|
||||
/* Data lock access */
|
||||
vlc_mutex_t lock;
|
||||
vlc_cond_t wait;
|
||||
|
||||
/* Data used to spawn the real thread */
|
||||
vlc_thread_func_t func;
|
||||
void *p_data;
|
||||
|
||||
/* Profiling timer passed to the thread */
|
||||
struct itimerval itimer;
|
||||
|
||||
} wrapper_t;
|
||||
|
||||
#endif /* GPROF */
|
@ -2,7 +2,7 @@
|
||||
* win32_specific.h: Win32 specific features
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: win32_specific.h,v 1.2 2002/04/02 23:43:57 gbazin Exp $
|
||||
* $Id: win32_specific.h,v 1.3 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Samuel Hocevar <sam@zoy.org>
|
||||
* Gildas Bazin <gbazin@netcourrier.com>
|
||||
@ -33,9 +33,9 @@ typedef BOOL (WINAPI *SIGNALOBJECTANDWAIT)( HANDLE, HANDLE, DWORD, BOOL );
|
||||
* This structure is a system specific descriptor. It describes the Win32
|
||||
* properties of the program.
|
||||
*****************************************************************************/
|
||||
typedef struct main_sys_s
|
||||
struct main_sys_s
|
||||
{
|
||||
SIGNALOBJECTANDWAIT SignalObjectAndWait;
|
||||
boolean_t b_fast_pthread;
|
||||
vlc_bool_t b_fast_pthread;
|
||||
};
|
||||
|
||||
} main_sys_t;
|
||||
|
@ -8,7 +8,7 @@ export CC=arm-linux-gcc
|
||||
export LD=arm-linux-ld
|
||||
export STRIP=arm-linux-strip
|
||||
export CONFIG_FLAGS="--enable-release --prefix=/usr --disable-gtk --enable-fb --enable-sdl --disable-xvideo --disable-plugins --with-tuning=strongarm1100 --x-includes=/skiff/local/arm-linux/include --x-libraries=/skiff/local/arm-linux/lib/X11 --with-sdl-config-path=/skiff/local/bin --with-mad=/skiff/local/arm-linux"
|
||||
export VIDDIR="usr/share/videolan"
|
||||
export VIDDIR="usr/share/vlc"
|
||||
export PIXDIR="usr/share/pixmaps"
|
||||
export DESTDIR=/tmp/vlc
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* (http://liba52.sf.net/).
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: a52.c,v 1.15 2002/05/31 21:56:01 massiot Exp $
|
||||
* $Id: a52.c,v 1.16 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -30,12 +30,9 @@
|
||||
#include <string.h> /* strdup() */
|
||||
#include <inttypes.h> /* int16_t .. */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#ifdef USE_A52DEC_TREE /* liba52 header file */
|
||||
#include "include/a52.h"
|
||||
@ -51,12 +48,12 @@
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static int decoder_Probe ( u8 * );
|
||||
static int decoder_Run ( decoder_config_t * );
|
||||
static int decoder_Run ( decoder_fifo_t * );
|
||||
static int DecodeFrame ( a52_adec_thread_t * );
|
||||
static int InitThread ( a52_adec_thread_t * );
|
||||
static void EndThread ( a52_adec_thread_t * );
|
||||
|
||||
static void BitstreamCallback ( bit_stream_t *, boolean_t );
|
||||
static void BitstreamCallback ( bit_stream_t *, vlc_bool_t );
|
||||
static void float2s16_2 ( float *, int16_t * );
|
||||
static inline int16_t convert ( int32_t );
|
||||
|
||||
@ -76,8 +73,8 @@ void _M( adec_getfunctions )( function_list_t * p_function_list )
|
||||
#define DYNRNG_LONGTEXT N_( \
|
||||
"Dynamic range compression makes the loud sounds softer, and the soft " \
|
||||
"sounds louder, so you can more easily listen to the stream in a noisy " \
|
||||
"environment without disturbing anyone.\nIf you disable the dynamic range"\
|
||||
" compression the playback will be more adapted to a movie theater or a " \
|
||||
"environment without disturbing anyone. If you disable the dynamic range "\
|
||||
"compression the playback will be more adapted to a movie theater or a " \
|
||||
"listening room.")
|
||||
|
||||
MODULE_CONFIG_START
|
||||
@ -88,7 +85,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("a52 ATSC A/52 aka AC-3 audio decoder module") )
|
||||
ADD_CAPABILITY( DECODER, 40 )
|
||||
ADD_SHORTCUT( "a52" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
MODULE_ACTIVATE_START
|
||||
@ -112,18 +108,16 @@ static int decoder_Probe( u8 *pi_type )
|
||||
/*****************************************************************************
|
||||
* decoder_Run: this function is called just after the thread is created
|
||||
*****************************************************************************/
|
||||
static int decoder_Run ( decoder_config_t *p_config )
|
||||
static int decoder_Run ( decoder_fifo_t *p_fifo )
|
||||
{
|
||||
a52_adec_thread_t *p_a52_adec;
|
||||
|
||||
/* Allocate the memory needed to store the thread's structure */
|
||||
p_a52_adec =
|
||||
(a52_adec_thread_t *)malloc( sizeof(a52_adec_thread_t) );
|
||||
p_a52_adec = (a52_adec_thread_t *)malloc( sizeof(a52_adec_thread_t) );
|
||||
if (p_a52_adec == NULL)
|
||||
{
|
||||
intf_ErrMsg ( "a52 error: not enough memory "
|
||||
"for decoder_Run() to allocate p_a52_adec" );
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
msg_Err( p_fifo, "out of memory" );
|
||||
DecoderError( p_fifo );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -134,12 +128,12 @@ static int decoder_Run ( decoder_config_t *p_config )
|
||||
* Initialize the thread properties
|
||||
*/
|
||||
p_a52_adec->p_aout_fifo = NULL;
|
||||
p_a52_adec->p_config = p_config;
|
||||
p_a52_adec->p_fifo = p_a52_adec->p_config->p_decoder_fifo;
|
||||
p_a52_adec->p_fifo = p_fifo;
|
||||
|
||||
if( InitThread( p_a52_adec ) )
|
||||
{
|
||||
intf_ErrMsg( "a52 error: could not initialize thread" );
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
msg_Err( p_a52_adec->p_fifo, "could not initialize thread" );
|
||||
DecoderError( p_fifo );
|
||||
free( p_a52_adec );
|
||||
return( -1 );
|
||||
}
|
||||
@ -168,13 +162,13 @@ static int decoder_Run ( decoder_config_t *p_config )
|
||||
|
||||
if( !p_a52_adec->frame_size )
|
||||
{
|
||||
intf_WarnMsg( 3, "a52: a52_syncinfo failed" );
|
||||
msg_Warn( p_a52_adec->p_fifo, "a52_syncinfo failed" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( DecodeFrame( p_a52_adec ) && !p_a52_adec->p_fifo->b_die )
|
||||
{
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
DecoderError( p_fifo );
|
||||
free( p_a52_adec );
|
||||
return( -1 );
|
||||
}
|
||||
@ -198,18 +192,15 @@ static int decoder_Run ( decoder_config_t *p_config )
|
||||
*****************************************************************************/
|
||||
static int InitThread( a52_adec_thread_t * p_a52_adec )
|
||||
{
|
||||
intf_WarnMsg( 3, "a52: InitThread" );
|
||||
|
||||
/* Initialize liba52 */
|
||||
p_a52_adec->p_a52_state = a52_init( 0 );
|
||||
if( p_a52_adec->p_a52_state == NULL )
|
||||
{
|
||||
intf_ErrMsg ( "a52 error: InitThread() unable to initialize "
|
||||
"liba52" );
|
||||
msg_Err( p_a52_adec->p_fifo, "unable to initialize liba52" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
p_a52_adec->b_dynrng = config_GetIntVariable( "a52-dynrng" );
|
||||
p_a52_adec->b_dynrng = config_GetInt( p_a52_adec->p_fifo, "a52-dynrng" );
|
||||
|
||||
/* Init the BitStream */
|
||||
InitBitstream( &p_a52_adec->bit_stream,
|
||||
@ -243,8 +234,8 @@ static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
|
||||
/* Creating the audio output fifo if not created yet */
|
||||
if( p_a52_adec->p_aout_fifo == NULL )
|
||||
{
|
||||
p_a52_adec->p_aout_fifo = aout_CreateFifo( AOUT_FIFO_PCM,
|
||||
p_a52_adec->i_channels,
|
||||
p_a52_adec->p_aout_fifo = aout_CreateFifo( p_a52_adec->p_fifo->p_this,
|
||||
AOUT_FIFO_PCM, p_a52_adec->i_channels,
|
||||
p_a52_adec->sample_rate,
|
||||
AC3DEC_FRAME_SIZE * p_a52_adec->i_channels,
|
||||
NULL );
|
||||
@ -292,7 +283,9 @@ static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
|
||||
for( i = 0; i < 6; i++ )
|
||||
{
|
||||
if( a52_block( p_a52_adec->p_a52_state ) )
|
||||
intf_WarnMsg( 5, "a52: a52_block failed for block %i", i );
|
||||
{
|
||||
msg_Warn( p_a52_adec->p_fifo, "a52_block failed for block %i", i );
|
||||
}
|
||||
|
||||
float2s16_2( a52_samples( p_a52_adec->p_a52_state ),
|
||||
((int16_t *)p_buffer) + i * 256 * p_a52_adec->i_channels );
|
||||
@ -313,8 +306,6 @@ static int DecodeFrame( a52_adec_thread_t * p_a52_adec )
|
||||
*****************************************************************************/
|
||||
static void EndThread (a52_adec_thread_t *p_a52_adec)
|
||||
{
|
||||
intf_WarnMsg ( 3, "a52: EndThread" );
|
||||
|
||||
/* If the audio output fifo was created, we destroy it */
|
||||
if (p_a52_adec->p_aout_fifo != NULL)
|
||||
{
|
||||
@ -362,7 +353,7 @@ static void float2s16_2 (float * _f, int16_t * s16)
|
||||
* This function is called by input's NextDataPacket.
|
||||
*****************************************************************************/
|
||||
static void BitstreamCallback ( bit_stream_t * p_bit_stream,
|
||||
boolean_t b_new_pes )
|
||||
vlc_bool_t b_new_pes )
|
||||
{
|
||||
if( b_new_pes )
|
||||
{
|
||||
|
@ -4,7 +4,7 @@
|
||||
* (http://liba52.sf.net/).
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: a52.h,v 1.3 2002/05/20 15:03:33 gbazin Exp $
|
||||
* $Id: a52.h,v 1.4 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Gildas Bazin <gbazin@netcourrier.com>
|
||||
*
|
||||
@ -36,7 +36,7 @@ typedef struct a52_adec_thread_s
|
||||
int flags;
|
||||
int sample_rate;
|
||||
int bit_rate;
|
||||
boolean_t b_dynrng;
|
||||
vlc_bool_t b_dynrng;
|
||||
|
||||
/* The bit stream structure handles the PES stream at the bit level */
|
||||
bit_stream_t bit_stream;
|
||||
@ -46,7 +46,6 @@ typedef struct a52_adec_thread_s
|
||||
*/
|
||||
decoder_fifo_t *p_fifo; /* stores the PES stream data */
|
||||
data_packet_t *p_data;
|
||||
decoder_config_t *p_config;
|
||||
|
||||
/*
|
||||
* Output properties
|
||||
|
@ -2,7 +2,7 @@
|
||||
* vout_aa.c: Aa video output display method for testing purposes
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2002 VideoLAN
|
||||
* $Id: aa.c,v 1.4 2002/05/27 18:26:31 sam Exp $
|
||||
* $Id: aa.c,v 1.5 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
|
||||
*
|
||||
@ -30,11 +30,9 @@
|
||||
|
||||
#include <aalib.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "video.h"
|
||||
#include "video_output.h"
|
||||
#include "interface.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/vout.h>
|
||||
#include <vlc/intf.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Capabilities defined in the other files.
|
||||
@ -51,7 +49,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("ASCII-art video output module") )
|
||||
ADD_CAPABILITY( VOUT, 10 )
|
||||
ADD_SHORTCUT( "aa" )
|
||||
ADD_SHORTCUT( "aalib" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
@ -70,27 +67,26 @@ MODULE_DEACTIVATE_STOP
|
||||
* This structure is part of the video output thread descriptor.
|
||||
* It describes the aa specific properties of an output thread.
|
||||
*****************************************************************************/
|
||||
typedef struct vout_sys_s
|
||||
struct vout_sys_s
|
||||
{
|
||||
struct aa_context* aa_context;
|
||||
aa_palette palette;
|
||||
int i_width; /* width of main window */
|
||||
int i_height; /* height of main window */
|
||||
|
||||
} vout_sys_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static int vout_Create ( struct vout_thread_s * );
|
||||
static int vout_Init ( struct vout_thread_s * );
|
||||
static void vout_End ( struct vout_thread_s * );
|
||||
static void vout_Destroy ( struct vout_thread_s * );
|
||||
static int vout_Manage ( struct vout_thread_s * );
|
||||
static void vout_Render ( struct vout_thread_s *, struct picture_s * );
|
||||
static void vout_Display ( struct vout_thread_s *, struct picture_s * );
|
||||
static int vout_Create ( vout_thread_t * );
|
||||
static int vout_Init ( vout_thread_t * );
|
||||
static void vout_End ( vout_thread_t * );
|
||||
static void vout_Destroy ( vout_thread_t * );
|
||||
static int vout_Manage ( vout_thread_t * );
|
||||
static void vout_Render ( vout_thread_t *, picture_t * );
|
||||
static void vout_Display ( vout_thread_t *, picture_t * );
|
||||
|
||||
static void SetPalette ( struct vout_thread_s *, u16 *, u16 *, u16 * );
|
||||
static void SetPalette ( vout_thread_t *, u16 *, u16 *, u16 * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Functions exported as capabilities. They are declared as static so that
|
||||
@ -118,7 +114,7 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
|
||||
if( p_vout->p_sys == NULL )
|
||||
{
|
||||
intf_ErrMsg("error: %s", strerror(ENOMEM) );
|
||||
msg_Err( p_vout, "out of memory" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -127,7 +123,7 @@ static int vout_Create( vout_thread_t *p_vout )
|
||||
|
||||
if (!(p_vout->p_sys->aa_context = aa_autoinit(&aa_defparams)))
|
||||
{
|
||||
intf_ErrMsg( "vout error: cannot initialize AA-lib. Sorry" );
|
||||
msg_Err( p_vout, "cannot initialize aalib" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -221,10 +217,16 @@ static int vout_Manage( vout_thread_t *p_vout )
|
||||
{
|
||||
case AA_MOUSE:
|
||||
aa_getmouse( p_vout->p_sys->aa_context, &x, &y, &b );
|
||||
if ( b & AA_BUTTON3 ) {
|
||||
vlc_mutex_lock( &p_main->p_intf->change_lock );
|
||||
p_main->p_intf->b_menu_change = 1;
|
||||
vlc_mutex_unlock( &p_main->p_intf->change_lock );
|
||||
if ( b & AA_BUTTON3 )
|
||||
{
|
||||
intf_thread_t *p_intf;
|
||||
p_intf = vlc_object_find( p_vout->p_vlc, VLC_OBJECT_INTF,
|
||||
FIND_CHILD );
|
||||
if( p_intf )
|
||||
{
|
||||
p_intf->b_menu_change = 1;
|
||||
vlc_object_release( p_intf );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AA_RESIZE:
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_adec.c: ac3 decoder module main file
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_adec.c,v 1.31 2002/05/27 16:01:42 fenrir Exp $
|
||||
* $Id: ac3_adec.c,v 1.32 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Lespinasse <walken@zoy.org>
|
||||
*
|
||||
@ -27,21 +27,16 @@
|
||||
#include <stdlib.h> /* malloc(), free() */
|
||||
#include <string.h> /* memset() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h> /* getpid() */
|
||||
#endif
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include "input_ext-intf.h" /* MPEG?_AUDIO_ES */
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#define AC3DEC_FRAME_SIZE (2*1536)
|
||||
@ -50,11 +45,11 @@
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static int decoder_Probe ( u8 * );
|
||||
static int decoder_Run ( decoder_config_t * );
|
||||
static int InitThread ( ac3dec_thread_t * p_adec );
|
||||
static void EndThread ( ac3dec_thread_t * p_adec );
|
||||
static int decoder_Run ( decoder_fifo_t * );
|
||||
static int InitThread ( ac3dec_t * p_adec );
|
||||
static void EndThread ( ac3dec_t * p_adec );
|
||||
static void BitstreamCallback ( bit_stream_t *p_bit_stream,
|
||||
boolean_t b_new_pes );
|
||||
vlc_bool_t b_new_pes );
|
||||
|
||||
/*****************************************************************************
|
||||
* Capabilities
|
||||
@ -84,7 +79,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("software AC3 decoder") )
|
||||
ADD_CAPABILITY( DECODER, 50 )
|
||||
ADD_SHORTCUT( "ac3_adec" )
|
||||
ADD_SHORTCUT( "ac3" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
@ -107,36 +101,160 @@ static int decoder_Probe( u8 *pi_type )
|
||||
return ( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* decoder_Run: this function is called just after the thread is created
|
||||
*****************************************************************************/
|
||||
static int decoder_Run ( decoder_fifo_t * p_fifo )
|
||||
{
|
||||
ac3dec_t * p_ac3dec;
|
||||
void * p_orig; /* pointer before memalign */
|
||||
vlc_bool_t b_sync = 0;
|
||||
|
||||
/* Allocate the memory needed to store the thread's structure */
|
||||
p_ac3dec = (ac3dec_t *)vlc_memalign( &p_orig, 16, sizeof(ac3dec_t) );
|
||||
memset( p_ac3dec, 0, sizeof( ac3dec_t ) );
|
||||
|
||||
if( p_ac3dec == NULL )
|
||||
{
|
||||
msg_Err( p_fifo, "out of memory" );
|
||||
DecoderError( p_fifo );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the thread properties
|
||||
*/
|
||||
p_ac3dec->p_fifo = p_fifo;
|
||||
if( InitThread( p_ac3dec ) )
|
||||
{
|
||||
msg_Err( p_fifo, "could not initialize thread" );
|
||||
DecoderError( p_fifo );
|
||||
free( p_orig );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* ac3 decoder thread's main loop */
|
||||
/* FIXME : do we have enough room to store the decoded frames ?? */
|
||||
while ((!p_ac3dec->p_fifo->b_die) && (!p_ac3dec->p_fifo->b_error))
|
||||
{
|
||||
s16 * buffer;
|
||||
ac3_sync_info_t sync_info;
|
||||
|
||||
if( !b_sync )
|
||||
{
|
||||
int i_sync_ptr;
|
||||
#define p_bit_stream (&p_ac3dec->bit_stream)
|
||||
|
||||
/* Go to the next PES packet and jump to sync_ptr */
|
||||
do {
|
||||
BitstreamNextDataPacket( p_bit_stream );
|
||||
} while( !p_bit_stream->p_decoder_fifo->b_die
|
||||
&& !p_bit_stream->p_decoder_fifo->b_error
|
||||
&& p_bit_stream->p_data !=
|
||||
p_bit_stream->p_decoder_fifo->p_first->p_first );
|
||||
i_sync_ptr = *(p_bit_stream->p_byte - 2) << 8
|
||||
| *(p_bit_stream->p_byte - 1);
|
||||
p_bit_stream->p_byte += i_sync_ptr;
|
||||
|
||||
/* Empty the bit FIFO and realign the bit stream */
|
||||
p_bit_stream->fifo.buffer = 0;
|
||||
p_bit_stream->fifo.i_available = 0;
|
||||
AlignWord( p_bit_stream );
|
||||
b_sync = 1;
|
||||
#undef p_bit_stream
|
||||
}
|
||||
|
||||
if (ac3_sync_frame (p_ac3dec, &sync_info))
|
||||
{
|
||||
b_sync = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( ( p_ac3dec->p_aout_fifo != NULL ) &&
|
||||
( p_ac3dec->p_aout_fifo->i_rate != sync_info.sample_rate ) )
|
||||
{
|
||||
/* Make sure the output thread leaves the NextFrame() function */
|
||||
vlc_mutex_lock (&(p_ac3dec->p_aout_fifo->data_lock));
|
||||
aout_DestroyFifo (p_ac3dec->p_aout_fifo);
|
||||
vlc_cond_signal (&(p_ac3dec->p_aout_fifo->data_wait));
|
||||
vlc_mutex_unlock (&(p_ac3dec->p_aout_fifo->data_lock));
|
||||
|
||||
p_ac3dec->p_aout_fifo = NULL;
|
||||
}
|
||||
|
||||
/* Creating the audio output fifo if not created yet */
|
||||
if (p_ac3dec->p_aout_fifo == NULL ) {
|
||||
p_ac3dec->p_aout_fifo =
|
||||
aout_CreateFifo( p_ac3dec->p_fifo->p_this, AOUT_FIFO_PCM, 2,
|
||||
sync_info.sample_rate, AC3DEC_FRAME_SIZE, NULL );
|
||||
if ( p_ac3dec->p_aout_fifo == NULL )
|
||||
{
|
||||
p_ac3dec->p_fifo->b_error = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentPTS( &p_ac3dec->bit_stream,
|
||||
&p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->i_end_frame],
|
||||
NULL );
|
||||
if( !p_ac3dec->p_aout_fifo->date[p_ac3dec->p_aout_fifo->i_end_frame] )
|
||||
{
|
||||
p_ac3dec->p_aout_fifo->date[
|
||||
p_ac3dec->p_aout_fifo->i_end_frame] =
|
||||
LAST_MDATE;
|
||||
}
|
||||
|
||||
buffer = ((s16 *)p_ac3dec->p_aout_fifo->buffer) +
|
||||
(p_ac3dec->p_aout_fifo->i_end_frame * AC3DEC_FRAME_SIZE);
|
||||
|
||||
if (ac3_decode_frame (p_ac3dec, buffer))
|
||||
{
|
||||
b_sync = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
vlc_mutex_lock (&p_ac3dec->p_aout_fifo->data_lock);
|
||||
p_ac3dec->p_aout_fifo->i_end_frame =
|
||||
(p_ac3dec->p_aout_fifo->i_end_frame + 1) & AOUT_FIFO_SIZE;
|
||||
vlc_cond_signal (&p_ac3dec->p_aout_fifo->data_wait);
|
||||
vlc_mutex_unlock (&p_ac3dec->p_aout_fifo->data_lock);
|
||||
|
||||
RealignBits(&p_ac3dec->bit_stream);
|
||||
}
|
||||
|
||||
/* If b_error is set, the ac3 decoder thread enters the error loop */
|
||||
if (p_ac3dec->p_fifo->b_error)
|
||||
{
|
||||
DecoderError( p_ac3dec->p_fifo );
|
||||
}
|
||||
|
||||
/* End of the ac3 decoder thread */
|
||||
EndThread (p_ac3dec);
|
||||
|
||||
free( p_orig );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* InitThread: initialize data before entering main loop
|
||||
*****************************************************************************/
|
||||
static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
static int InitThread( ac3dec_t * p_ac3dec )
|
||||
{
|
||||
char *psz_name;
|
||||
|
||||
/*
|
||||
* Thread properties
|
||||
*/
|
||||
p_ac3thread->p_fifo = p_ac3thread->p_config->p_decoder_fifo;
|
||||
|
||||
p_ac3thread->ac3_decoder =
|
||||
vlc_memalign( &p_ac3thread->ac3_decoder_orig, 16, sizeof(ac3dec_t) );
|
||||
memset( p_ac3thread->ac3_decoder, 0, sizeof( ac3dec_t ) );
|
||||
|
||||
/*
|
||||
* Choose the best downmix module
|
||||
*/
|
||||
#define DOWNMIX p_ac3thread->ac3_decoder->downmix
|
||||
psz_name = config_GetPszVariable( DOWNMIX_METHOD_VAR );
|
||||
DOWNMIX.p_module = module_Need( MODULE_CAPABILITY_DOWNMIX, psz_name,
|
||||
NULL );
|
||||
#define DOWNMIX p_ac3dec->downmix
|
||||
psz_name = config_GetPsz( p_ac3dec->p_fifo, DOWNMIX_METHOD_VAR );
|
||||
DOWNMIX.p_module = module_Need( p_ac3dec->p_fifo,
|
||||
MODULE_CAPABILITY_DOWNMIX, psz_name, NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( DOWNMIX.p_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "ac3dec error: no suitable downmix module" );
|
||||
free( p_ac3thread->ac3_decoder_orig );
|
||||
msg_Err( p_ac3dec->p_fifo, "no suitable downmix module" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -154,21 +272,20 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
/*
|
||||
* Choose the best IMDCT module
|
||||
*/
|
||||
p_ac3thread->ac3_decoder->imdct =
|
||||
vlc_memalign( &p_ac3thread->ac3_decoder->imdct_orig, 16, sizeof(imdct_t) );
|
||||
p_ac3dec->imdct = vlc_memalign( &p_ac3dec->imdct_orig,
|
||||
16, sizeof(imdct_t) );
|
||||
|
||||
#define IMDCT p_ac3thread->ac3_decoder->imdct
|
||||
psz_name = config_GetPszVariable( IMDCT_METHOD_VAR );
|
||||
IMDCT->p_module = module_Need( MODULE_CAPABILITY_IMDCT, psz_name,
|
||||
NULL );
|
||||
#define IMDCT p_ac3dec->imdct
|
||||
psz_name = config_GetPsz( p_ac3dec->p_fifo, IMDCT_METHOD_VAR );
|
||||
IMDCT->p_module = module_Need( p_ac3dec->p_fifo,
|
||||
MODULE_CAPABILITY_IMDCT, psz_name, NULL );
|
||||
if( psz_name ) free( psz_name );
|
||||
|
||||
if( IMDCT->p_module == NULL )
|
||||
{
|
||||
intf_ErrMsg( "ac3dec error: no suitable IMDCT module" );
|
||||
module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module );
|
||||
free( p_ac3thread->ac3_decoder->imdct_orig );
|
||||
free( p_ac3thread->ac3_decoder_orig );
|
||||
msg_Err( p_ac3dec->p_fifo, "no suitable IMDCT module" );
|
||||
module_Unneed( p_ac3dec->downmix.p_module );
|
||||
free( p_ac3dec->imdct_orig );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -181,9 +298,8 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
#undef F
|
||||
|
||||
/* Initialize the ac3 decoder structures */
|
||||
p_ac3thread->ac3_decoder->samples =
|
||||
vlc_memalign( &p_ac3thread->ac3_decoder->samples_orig,
|
||||
16, 6 * 256 * sizeof(float) );
|
||||
p_ac3dec->samples = vlc_memalign( &p_ac3dec->samples_orig,
|
||||
16, 6 * 256 * sizeof(float) );
|
||||
|
||||
IMDCT->buf = vlc_memalign( &IMDCT->buf_orig,
|
||||
16, N/4 * sizeof(complex_t) );
|
||||
@ -217,178 +333,40 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
|
||||
16, 64 * sizeof(complex_t) );
|
||||
#undef IMDCT
|
||||
|
||||
_M( ac3_init )( p_ac3thread->ac3_decoder );
|
||||
_M( ac3_init )( p_ac3dec );
|
||||
|
||||
/*
|
||||
* Initialize the output properties
|
||||
*/
|
||||
p_ac3thread->p_aout_fifo = NULL;
|
||||
p_ac3dec->p_aout_fifo = NULL;
|
||||
|
||||
/*
|
||||
* Bit stream
|
||||
*/
|
||||
InitBitstream(&p_ac3thread->ac3_decoder->bit_stream,
|
||||
p_ac3thread->p_config->p_decoder_fifo,
|
||||
BitstreamCallback, (void *) p_ac3thread );
|
||||
InitBitstream( &p_ac3dec->bit_stream, p_ac3dec->p_fifo,
|
||||
BitstreamCallback, (void *) p_ac3dec );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* decoder_Run: this function is called just after the thread is created
|
||||
*****************************************************************************/
|
||||
static int decoder_Run ( decoder_config_t * p_config )
|
||||
{
|
||||
ac3dec_thread_t * p_ac3thread;
|
||||
void * p_ac3thread_orig; /* pointer before memalign */
|
||||
boolean_t b_sync = 0;
|
||||
|
||||
/* Allocate the memory needed to store the thread's structure */
|
||||
p_ac3thread = (ac3dec_thread_t *)vlc_memalign( &p_ac3thread_orig, 16,
|
||||
sizeof(ac3dec_thread_t) );
|
||||
|
||||
if( p_ac3thread == NULL )
|
||||
{
|
||||
intf_ErrMsg ( "ac3_adec error: not enough memory "
|
||||
"for decoder_Run() to allocate p_ac3thread" );
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the thread properties
|
||||
*/
|
||||
p_ac3thread->p_config = p_config;
|
||||
if( InitThread( p_ac3thread ) )
|
||||
{
|
||||
intf_ErrMsg( "ac3_adec error: could not initialize thread" );
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
free( p_ac3thread_orig );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* ac3 decoder thread's main loop */
|
||||
/* FIXME : do we have enough room to store the decoded frames ?? */
|
||||
while ((!p_ac3thread->p_fifo->b_die) && (!p_ac3thread->p_fifo->b_error))
|
||||
{
|
||||
s16 * buffer;
|
||||
ac3_sync_info_t sync_info;
|
||||
|
||||
if( !b_sync )
|
||||
{
|
||||
int i_sync_ptr;
|
||||
#define p_bit_stream (&p_ac3thread->ac3_decoder->bit_stream)
|
||||
|
||||
/* Go to the next PES packet and jump to sync_ptr */
|
||||
do {
|
||||
BitstreamNextDataPacket( p_bit_stream );
|
||||
} while( !p_bit_stream->p_decoder_fifo->b_die
|
||||
&& !p_bit_stream->p_decoder_fifo->b_error
|
||||
&& p_bit_stream->p_data !=
|
||||
p_bit_stream->p_decoder_fifo->p_first->p_first );
|
||||
i_sync_ptr = *(p_bit_stream->p_byte - 2) << 8
|
||||
| *(p_bit_stream->p_byte - 1);
|
||||
p_bit_stream->p_byte += i_sync_ptr;
|
||||
|
||||
/* Empty the bit FIFO and realign the bit stream */
|
||||
p_bit_stream->fifo.buffer = 0;
|
||||
p_bit_stream->fifo.i_available = 0;
|
||||
AlignWord( p_bit_stream );
|
||||
b_sync = 1;
|
||||
#undef p_bit_stream
|
||||
}
|
||||
|
||||
if (ac3_sync_frame (p_ac3thread->ac3_decoder, &sync_info))
|
||||
{
|
||||
b_sync = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if( ( p_ac3thread->p_aout_fifo != NULL ) &&
|
||||
( p_ac3thread->p_aout_fifo->i_rate != sync_info.sample_rate ) )
|
||||
{
|
||||
/* Make sure the output thread leaves the NextFrame() function */
|
||||
vlc_mutex_lock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
aout_DestroyFifo (p_ac3thread->p_aout_fifo);
|
||||
vlc_cond_signal (&(p_ac3thread->p_aout_fifo->data_wait));
|
||||
vlc_mutex_unlock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
|
||||
p_ac3thread->p_aout_fifo = NULL;
|
||||
}
|
||||
|
||||
/* Creating the audio output fifo if not created yet */
|
||||
if (p_ac3thread->p_aout_fifo == NULL )
|
||||
{
|
||||
p_ac3thread->p_aout_fifo = aout_CreateFifo( AOUT_FIFO_PCM, 2,
|
||||
sync_info.sample_rate, AC3DEC_FRAME_SIZE, NULL );
|
||||
if ( p_ac3thread->p_aout_fifo == NULL )
|
||||
{
|
||||
p_ac3thread->p_fifo->b_error = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CurrentPTS( &p_ac3thread->ac3_decoder->bit_stream,
|
||||
&p_ac3thread->p_aout_fifo->date[p_ac3thread->p_aout_fifo->i_end_frame],
|
||||
NULL );
|
||||
if( !p_ac3thread->p_aout_fifo->date[p_ac3thread->p_aout_fifo->i_end_frame] )
|
||||
{
|
||||
p_ac3thread->p_aout_fifo->date[
|
||||
p_ac3thread->p_aout_fifo->i_end_frame] =
|
||||
LAST_MDATE;
|
||||
}
|
||||
|
||||
buffer = ((s16 *)p_ac3thread->p_aout_fifo->buffer) +
|
||||
(p_ac3thread->p_aout_fifo->i_end_frame * AC3DEC_FRAME_SIZE);
|
||||
|
||||
if (ac3_decode_frame (p_ac3thread->ac3_decoder, buffer))
|
||||
{
|
||||
b_sync = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
vlc_mutex_lock (&p_ac3thread->p_aout_fifo->data_lock);
|
||||
p_ac3thread->p_aout_fifo->i_end_frame =
|
||||
(p_ac3thread->p_aout_fifo->i_end_frame + 1) & AOUT_FIFO_SIZE;
|
||||
vlc_cond_signal (&p_ac3thread->p_aout_fifo->data_wait);
|
||||
vlc_mutex_unlock (&p_ac3thread->p_aout_fifo->data_lock);
|
||||
|
||||
RealignBits(&p_ac3thread->ac3_decoder->bit_stream);
|
||||
}
|
||||
|
||||
/* If b_error is set, the ac3 decoder thread enters the error loop */
|
||||
if (p_ac3thread->p_fifo->b_error)
|
||||
{
|
||||
DecoderError( p_ac3thread->p_fifo );
|
||||
}
|
||||
|
||||
/* End of the ac3 decoder thread */
|
||||
EndThread (p_ac3thread);
|
||||
|
||||
free( p_ac3thread_orig );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* EndThread : ac3 decoder thread destruction
|
||||
*****************************************************************************/
|
||||
static void EndThread (ac3dec_thread_t * p_ac3thread)
|
||||
static void EndThread (ac3dec_t * p_ac3dec)
|
||||
{
|
||||
/* If the audio output fifo was created, we destroy it */
|
||||
if (p_ac3thread->p_aout_fifo != NULL)
|
||||
if (p_ac3dec->p_aout_fifo != NULL)
|
||||
{
|
||||
aout_DestroyFifo (p_ac3thread->p_aout_fifo);
|
||||
aout_DestroyFifo (p_ac3dec->p_aout_fifo);
|
||||
|
||||
/* Make sure the output thread leaves the NextFrame() function */
|
||||
vlc_mutex_lock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
vlc_cond_signal (&(p_ac3thread->p_aout_fifo->data_wait));
|
||||
vlc_mutex_unlock (&(p_ac3thread->p_aout_fifo->data_lock));
|
||||
vlc_mutex_lock (&(p_ac3dec->p_aout_fifo->data_lock));
|
||||
vlc_cond_signal (&(p_ac3dec->p_aout_fifo->data_wait));
|
||||
vlc_mutex_unlock (&(p_ac3dec->p_aout_fifo->data_lock));
|
||||
}
|
||||
|
||||
/* Free allocated structures */
|
||||
#define IMDCT p_ac3thread->ac3_decoder->imdct
|
||||
#define IMDCT p_ac3dec->imdct
|
||||
free( IMDCT->w_1_orig );
|
||||
free( IMDCT->w_64_orig );
|
||||
free( IMDCT->w_32_orig );
|
||||
@ -406,15 +384,14 @@ static void EndThread (ac3dec_thread_t * p_ac3thread)
|
||||
free( IMDCT->buf_orig );
|
||||
#undef IMDCT
|
||||
|
||||
free( p_ac3thread->ac3_decoder->samples_orig );
|
||||
free( p_ac3dec->samples_orig );
|
||||
|
||||
/* Unlock the modules */
|
||||
module_Unneed( p_ac3thread->ac3_decoder->downmix.p_module );
|
||||
module_Unneed( p_ac3thread->ac3_decoder->imdct->p_module );
|
||||
module_Unneed( p_ac3dec->downmix.p_module );
|
||||
module_Unneed( p_ac3dec->imdct->p_module );
|
||||
|
||||
/* Free what's left of the decoder */
|
||||
free( p_ac3thread->ac3_decoder->imdct_orig );
|
||||
free( p_ac3thread->ac3_decoder_orig );
|
||||
free( p_ac3dec->imdct_orig );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -423,7 +400,7 @@ static void EndThread (ac3dec_thread_t * p_ac3thread)
|
||||
* This function is called by input's NextDataPacket.
|
||||
*****************************************************************************/
|
||||
static void BitstreamCallback ( bit_stream_t * p_bit_stream,
|
||||
boolean_t b_new_pes )
|
||||
vlc_bool_t b_new_pes )
|
||||
{
|
||||
if( b_new_pes )
|
||||
{
|
||||
|
@ -1,10 +1,11 @@
|
||||
/*****************************************************************************
|
||||
* ac3_adec.h : ac3 decoder thread interface
|
||||
* ac3_adec.h : ac3 decoder interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: ac3_adec.h,v 1.3 2002/04/05 01:05:22 gbazin Exp $
|
||||
* $Id: ac3_adec.h,v 1.4 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Renaud Dartus <reno@videolan.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -22,15 +23,349 @@
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
* ac3dec_thread_t : ac3 decoder thread descriptor
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
vlc_thread_t ac3dec_CreateThread( decoder_fifo_t * p_fifo );
|
||||
|
||||
/**** ac3 decoder API - public ac3 decoder structures */
|
||||
|
||||
typedef struct ac3dec_s ac3dec_t;
|
||||
|
||||
typedef struct ac3_sync_info_s {
|
||||
int sample_rate; /* sample rate in Hz */
|
||||
int frame_size; /* frame size in bytes */
|
||||
int bit_rate; /* nominal bit rate in kbps */
|
||||
} ac3_sync_info_t;
|
||||
|
||||
|
||||
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
|
||||
|
||||
int _M( ac3_init )(ac3dec_t * p_ac3dec);
|
||||
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
|
||||
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
|
||||
|
||||
/**** EVERYTHING AFTER THIS POINT IS PRIVATE ! DO NOT USE DIRECTLY ****/
|
||||
|
||||
/**** ac3 decoder internal structures ****/
|
||||
|
||||
/* The following structures are filled in by their corresponding parse_*
|
||||
* functions. See http://www.atsc.org/Standards/A52/a_52.pdf for
|
||||
* full details on each field. Indented fields are used to denote
|
||||
* conditional fields.
|
||||
*/
|
||||
|
||||
typedef struct syncinfo_s {
|
||||
/* Sync word == 0x0B77 */
|
||||
/* u16 syncword; */
|
||||
/* crc for the first 5/8 of the sync block */
|
||||
/* u16 crc1; */
|
||||
/* Stream Sampling Rate (kHz) 0 = 48, 1 = 44.1, 2 = 32, 3 = reserved */
|
||||
u16 fscod;
|
||||
/* Frame size code */
|
||||
u16 frmsizecod;
|
||||
|
||||
/* Information not in the AC-3 bitstream, but derived */
|
||||
/* Frame size in 16 bit words */
|
||||
u16 frame_size;
|
||||
/* Bit rate in kilobits */
|
||||
//u16 bit_rate;
|
||||
} syncinfo_t;
|
||||
|
||||
typedef struct bsi_s {
|
||||
/* Bit stream identification == 0x8 */
|
||||
u16 bsid;
|
||||
/* Bit stream mode */
|
||||
u16 bsmod;
|
||||
/* Audio coding mode */
|
||||
u16 acmod;
|
||||
/* If we're using the centre channel then */
|
||||
/* centre mix level */
|
||||
u16 cmixlev;
|
||||
/* If we're using the surround channel then */
|
||||
/* surround mix level */
|
||||
u16 surmixlev;
|
||||
/* If we're in 2/0 mode then */
|
||||
/* Dolby surround mix level - NOT USED - */
|
||||
u16 dsurmod;
|
||||
/* Low frequency effects on */
|
||||
u16 lfeon;
|
||||
/* Dialogue Normalization level */
|
||||
u16 dialnorm;
|
||||
/* Compression exists */
|
||||
u16 compre;
|
||||
/* Compression level */
|
||||
u16 compr;
|
||||
/* Language code exists */
|
||||
u16 langcode;
|
||||
/* Language code */
|
||||
u16 langcod;
|
||||
/* Audio production info exists*/
|
||||
u16 audprodie;
|
||||
u16 mixlevel;
|
||||
u16 roomtyp;
|
||||
/* If we're in dual mono mode (acmod == 0) then extra stuff */
|
||||
u16 dialnorm2;
|
||||
u16 compr2e;
|
||||
u16 compr2;
|
||||
u16 langcod2e;
|
||||
u16 langcod2;
|
||||
u16 audprodi2e;
|
||||
u16 mixlevel2;
|
||||
u16 roomtyp2;
|
||||
/* Copyright bit */
|
||||
u16 copyrightb;
|
||||
/* Original bit */
|
||||
u16 origbs;
|
||||
/* Timecode 1 exists */
|
||||
u16 timecod1e;
|
||||
/* Timecode 1 */
|
||||
u16 timecod1;
|
||||
/* Timecode 2 exists */
|
||||
u16 timecod2e;
|
||||
/* Timecode 2 */
|
||||
u16 timecod2;
|
||||
/* Additional bit stream info exists */
|
||||
u16 addbsie;
|
||||
/* Additional bit stream length - 1 (in bytes) */
|
||||
u16 addbsil;
|
||||
/* Additional bit stream information (max 64 bytes) */
|
||||
u8 addbsi[64];
|
||||
|
||||
/* Information not in the AC-3 bitstream, but derived */
|
||||
/* Number of channels (excluding LFE)
|
||||
* Derived from acmod */
|
||||
u16 nfchans;
|
||||
} bsi_t;
|
||||
|
||||
/* more pain */
|
||||
typedef struct audblk_s {
|
||||
/* block switch bit indexed by channel num */
|
||||
u16 blksw[5];
|
||||
/* dither enable bit indexed by channel num */
|
||||
u16 dithflag[5];
|
||||
/* dynamic range gain exists */
|
||||
u16 dynrnge;
|
||||
/* dynamic range gain */
|
||||
u16 dynrng;
|
||||
/* if acmod==0 then */
|
||||
/* dynamic range 2 gain exists */
|
||||
u16 dynrng2e;
|
||||
/* dynamic range 2 gain */
|
||||
u16 dynrng2;
|
||||
/* coupling strategy exists */
|
||||
u16 cplstre;
|
||||
/* coupling in use */
|
||||
u16 cplinu;
|
||||
/* channel coupled */
|
||||
u16 chincpl[5];
|
||||
/* if acmod==2 then */
|
||||
/* Phase flags in use */
|
||||
u16 phsflginu;
|
||||
/* coupling begin frequency code */
|
||||
u16 cplbegf;
|
||||
/* coupling end frequency code */
|
||||
u16 cplendf;
|
||||
/* coupling band structure bits */
|
||||
u16 cplbndstrc[18];
|
||||
/* Do coupling co-ords exist for this channel? */
|
||||
u16 cplcoe[5];
|
||||
/* Master coupling co-ordinate */
|
||||
u16 mstrcplco[5];
|
||||
/* Per coupling band coupling co-ordinates */
|
||||
u16 cplcoexp[5][18];
|
||||
u16 cplcomant[5][18];
|
||||
/* Phase flags for dual mono */
|
||||
u16 phsflg[18];
|
||||
/* Is there a rematrixing strategy */
|
||||
u16 rematstr;
|
||||
/* Rematrixing bits */
|
||||
u16 rematflg[4];
|
||||
/* Coupling exponent strategy */
|
||||
u16 cplexpstr;
|
||||
/* Exponent strategy for full bandwidth channels */
|
||||
u16 chexpstr[5];
|
||||
/* Exponent strategy for lfe channel */
|
||||
u16 lfeexpstr;
|
||||
/* Channel bandwidth for independent channels */
|
||||
u16 chbwcod[5];
|
||||
/* The absolute coupling exponent */
|
||||
u16 cplabsexp;
|
||||
/* Coupling channel exponents (D15 mode gives 18 * 12 /3 encoded exponents */
|
||||
u16 cplexps[18 * 12 / 3];
|
||||
/* Sanity checking constant */
|
||||
u32 magic2;
|
||||
/* fbw channel exponents */
|
||||
u16 exps[5][252 / 3];
|
||||
/* channel gain range */
|
||||
u16 gainrng[5];
|
||||
/* low frequency exponents */
|
||||
u16 lfeexps[3];
|
||||
|
||||
/* Bit allocation info */
|
||||
u16 baie;
|
||||
/* Slow decay code */
|
||||
u16 sdcycod;
|
||||
/* Fast decay code */
|
||||
u16 fdcycod;
|
||||
/* Slow gain code */
|
||||
u16 sgaincod;
|
||||
/* dB per bit code */
|
||||
u16 dbpbcod;
|
||||
/* masking floor code */
|
||||
u16 floorcod;
|
||||
|
||||
/* SNR offset info */
|
||||
u16 snroffste;
|
||||
/* coarse SNR offset */
|
||||
u16 csnroffst;
|
||||
/* coupling fine SNR offset */
|
||||
u16 cplfsnroffst;
|
||||
/* coupling fast gain code */
|
||||
u16 cplfgaincod;
|
||||
/* fbw fine SNR offset */
|
||||
u16 fsnroffst[5];
|
||||
/* fbw fast gain code */
|
||||
u16 fgaincod[5];
|
||||
/* lfe fine SNR offset */
|
||||
u16 lfefsnroffst;
|
||||
/* lfe fast gain code */
|
||||
u16 lfefgaincod;
|
||||
|
||||
/* Coupling leak info */
|
||||
u16 cplleake;
|
||||
/* coupling fast leak initialization */
|
||||
u16 cplfleak;
|
||||
/* coupling slow leak initialization */
|
||||
u16 cplsleak;
|
||||
|
||||
/* delta bit allocation info */
|
||||
u16 deltbaie;
|
||||
/* coupling delta bit allocation exists */
|
||||
u16 cpldeltbae;
|
||||
/* fbw delta bit allocation exists */
|
||||
u16 deltbae[5];
|
||||
/* number of cpl delta bit segments */
|
||||
u16 cpldeltnseg;
|
||||
/* coupling delta bit allocation offset */
|
||||
u16 cpldeltoffst[8];
|
||||
/* coupling delta bit allocation length */
|
||||
u16 cpldeltlen[8];
|
||||
/* coupling delta bit allocation length */
|
||||
u16 cpldeltba[8];
|
||||
/* number of delta bit segments */
|
||||
u16 deltnseg[5];
|
||||
/* fbw delta bit allocation offset */
|
||||
u16 deltoffst[5][8];
|
||||
/* fbw delta bit allocation length */
|
||||
u16 deltlen[5][8];
|
||||
/* fbw delta bit allocation length */
|
||||
u16 deltba[5][8];
|
||||
|
||||
/* skip length exists */
|
||||
u16 skiple;
|
||||
/* skip length */
|
||||
u16 skipl;
|
||||
|
||||
/* channel mantissas */
|
||||
// u16 chmant[5][256];
|
||||
|
||||
/* coupling mantissas */
|
||||
float cpl_flt[ 256 ];
|
||||
// u16 cplmant[256];
|
||||
|
||||
/* coupling mantissas */
|
||||
// u16 lfemant[7];
|
||||
|
||||
/* -- Information not in the bitstream, but derived thereof -- */
|
||||
|
||||
/* Number of coupling sub-bands */
|
||||
u16 ncplsubnd;
|
||||
|
||||
/* Number of combined coupling sub-bands
|
||||
* Derived from ncplsubnd and cplbndstrc */
|
||||
u16 ncplbnd;
|
||||
|
||||
/* Number of exponent groups by channel
|
||||
* Derived from strmant, endmant */
|
||||
u16 nchgrps[5];
|
||||
|
||||
/* Number of coupling exponent groups
|
||||
* Derived from cplbegf, cplendf, cplexpstr */
|
||||
u16 ncplgrps;
|
||||
|
||||
/* End mantissa numbers of fbw channels */
|
||||
u16 endmant[5];
|
||||
|
||||
/* Start and end mantissa numbers for the coupling channel */
|
||||
u16 cplstrtmant;
|
||||
u16 cplendmant;
|
||||
|
||||
/* Decoded exponent info */
|
||||
u16 fbw_exp[5][256];
|
||||
u16 cpl_exp[256];
|
||||
u16 lfe_exp[7];
|
||||
|
||||
/* Bit allocation pointer results */
|
||||
u16 fbw_bap[5][256];
|
||||
/* FIXME?? figure out exactly how many entries there should be (253-37?) */
|
||||
u16 cpl_bap[256];
|
||||
u16 lfe_bap[7];
|
||||
} audblk_t;
|
||||
|
||||
/* Everything you wanted to know about band structure */
|
||||
|
||||
/*
|
||||
* The entire frequency domain is represented by 256 real
|
||||
* floating point fourier coefficients. Only the lower 253
|
||||
* coefficients are actually utilized however. We use arrays
|
||||
* of 256 to be efficient in some cases.
|
||||
*
|
||||
* The 5 full bandwidth channels (fbw) can have their higher
|
||||
* frequencies coupled together. These coupled channels then
|
||||
* share their high frequency components.
|
||||
*
|
||||
* This coupling band is broken up into 18 sub-bands starting
|
||||
* at mantissa number 37. Each sub-band is 12 bins wide.
|
||||
*
|
||||
* There are 50 bit allocation sub-bands which cover the entire
|
||||
* frequency range. The sub-bands are of non-uniform width, and
|
||||
* approximate a 1/6 octave scale.
|
||||
*/
|
||||
|
||||
typedef struct bit_allocate_s
|
||||
{
|
||||
s16 psd[256];
|
||||
s16 bndpsd[256];
|
||||
s16 excite[256];
|
||||
s16 mask[256];
|
||||
s16 sdecay;
|
||||
s16 fdecay;
|
||||
s16 sgain;
|
||||
s16 dbknee;
|
||||
s16 floor;
|
||||
} bit_allocate_t;
|
||||
|
||||
/* These store the persistent state of the packed mantissas */
|
||||
typedef struct mantissa_s
|
||||
{
|
||||
float q_1[2];
|
||||
float q_2[2];
|
||||
float q_4[1];
|
||||
s32 q_1_pointer;
|
||||
s32 q_2_pointer;
|
||||
s32 q_4_pointer;
|
||||
u16 lfsr_state;
|
||||
} mantissa_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* ac3dec_t : ac3 decoder thread descriptor
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct ac3dec_thread_s
|
||||
struct ac3dec_s
|
||||
{
|
||||
/*
|
||||
* Decoder properties
|
||||
*/
|
||||
ac3dec_t * ac3_decoder;
|
||||
void * ac3_decoder_orig; /* pointer before memalign */
|
||||
|
||||
/*
|
||||
@ -42,16 +377,33 @@ typedef struct ac3dec_thread_s
|
||||
* Input properties
|
||||
*/
|
||||
decoder_fifo_t * p_fifo; /* stores the PES stream data */
|
||||
decoder_config_t * p_config;
|
||||
|
||||
/* The bit stream structure handles the PES stream at the bit level */
|
||||
bit_stream_t bit_stream;
|
||||
int i_available;
|
||||
unsigned int total_bits_read; /* temporary */
|
||||
|
||||
/*
|
||||
* Decoder properties
|
||||
*/
|
||||
syncinfo_t syncinfo;
|
||||
bsi_t bsi;
|
||||
audblk_t audblk;
|
||||
|
||||
dm_par_t dm_par;
|
||||
|
||||
bit_allocate_t bit_allocate;
|
||||
mantissa_t mantissa;
|
||||
downmix_t downmix;
|
||||
|
||||
/*
|
||||
* Output properties
|
||||
*/
|
||||
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
|
||||
|
||||
} ac3dec_thread_t;
|
||||
float * samples;
|
||||
void * samples_orig; /* pointer before memalign */
|
||||
imdct_t * imdct;
|
||||
void * imdct_orig; /* pointer before memalign */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Prototypes
|
||||
*****************************************************************************/
|
||||
vlc_thread_t ac3dec_CreateThread( decoder_config_t * p_config );
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_bit_allocate.c: ac3 allocation tables
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: ac3_bit_allocate.c,v 1.7 2002/05/18 17:47:46 sam Exp $
|
||||
* $Id: ac3_bit_allocate.c,v 1.8 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -28,14 +28,12 @@
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memcpy() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#include "ac3_internal.h" /* DELTA_BIT_REUSE */
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_decoder.c: core ac3 decoder
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_decoder.c,v 1.7 2002/04/23 23:44:36 fenrir Exp $
|
||||
* $Id: ac3_decoder.c,v 1.8 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Michel Lespinasse <walken@zoy.org>
|
||||
@ -28,16 +28,11 @@
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memcpy() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h" /* ac3dec_thread_t */
|
||||
|
||||
#include "ac3_internal.h"
|
||||
@ -56,11 +51,10 @@ int _M( ac3_init )(ac3dec_t * p_ac3dec)
|
||||
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer)
|
||||
{
|
||||
int i;
|
||||
ac3dec_thread_t * p_ac3thread = (ac3dec_thread_t *) p_ac3dec->bit_stream.p_callback_arg;
|
||||
|
||||
if (parse_bsi (p_ac3dec))
|
||||
{
|
||||
intf_WarnMsg (3,"ac3dec warn: error during parsing");
|
||||
msg_Warn( p_ac3dec->p_fifo, "parse error" );
|
||||
parse_auxdata (p_ac3dec);
|
||||
return 1;
|
||||
}
|
||||
@ -86,26 +80,26 @@ int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer)
|
||||
(p_ac3dec->bsi.nfchans + p_ac3dec->bsi.lfeon));
|
||||
|
||||
|
||||
if( p_ac3thread->p_fifo->b_die || p_ac3thread->p_fifo->b_error )
|
||||
if( p_ac3dec->p_fifo->b_die || p_ac3dec->p_fifo->b_error )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( parse_audblk( p_ac3dec, i ) )
|
||||
{
|
||||
intf_WarnMsg( 3, "ac3dec warning: error during audioblock" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "audioblock error" );
|
||||
parse_auxdata( p_ac3dec );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( p_ac3thread->p_fifo->b_die || p_ac3thread->p_fifo->b_error )
|
||||
if( p_ac3dec->p_fifo->b_die || p_ac3dec->p_fifo->b_error )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( exponent_unpack( p_ac3dec ) )
|
||||
{
|
||||
intf_WarnMsg( 3, "ac3dec warning: error during unpack" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "unpack error" );
|
||||
parse_auxdata( p_ac3dec );
|
||||
return 1;
|
||||
}
|
||||
@ -113,7 +107,7 @@ int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer)
|
||||
bit_allocate (p_ac3dec);
|
||||
mantissa_unpack (p_ac3dec);
|
||||
|
||||
if( p_ac3thread->p_fifo->b_die || p_ac3thread->p_fifo->b_error )
|
||||
if( p_ac3dec->p_fifo->b_die || p_ac3dec->p_fifo->b_error )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_exponent.c: ac3 exponent calculations
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_exponent.c,v 1.6 2001/12/30 07:09:54 sam Exp $
|
||||
* $Id: ac3_exponent.c,v 1.7 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Michel Lespinasse <walken@zoy.org>
|
||||
@ -28,16 +28,12 @@
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memcpy(), memset() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#include "ac3_internal.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_exponent.h: ac3 exponent calculations
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000 VideoLAN
|
||||
* $Id: ac3_exponent.h,v 1.2 2002/05/18 17:47:46 sam Exp $
|
||||
* $Id: ac3_exponent.h,v 1.3 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Michel Lespinasse <walken@zoy.org>
|
||||
@ -57,9 +57,9 @@ static const s16 exps_3[128] =
|
||||
#define UNPACK_CPL 2
|
||||
#define UNPACK_LFE 4
|
||||
|
||||
static inline int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
|
||||
static inline int exp_unpack_ch( ac3dec_t * p_ac3dec, u16 type,
|
||||
u16 expstr, u16 ngrps, u16 initial_exp,
|
||||
u16 exps[], u16 * dest)
|
||||
u16 exps[], u16 * dest )
|
||||
{
|
||||
u16 i,j;
|
||||
s16 exp_acc;
|
||||
@ -88,7 +88,7 @@ static inline int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
|
||||
{
|
||||
if (exps[i] > 124)
|
||||
{
|
||||
intf_ErrMsg ( "ac3dec error: invalid exponent" );
|
||||
msg_Err( p_ac3dec->p_fifo, "invalid exponent" );
|
||||
return 1;
|
||||
}
|
||||
exp_acc += (exps_1[exps[i]] /*- 2*/);
|
||||
@ -105,7 +105,7 @@ static inline int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
|
||||
{
|
||||
if (exps[i] > 124)
|
||||
{
|
||||
intf_ErrMsg ( "ac3dec error: invalid exponent" );
|
||||
msg_Err( p_ac3dec->p_fifo, "invalid exponent" );
|
||||
return 1;
|
||||
}
|
||||
exp_acc += (exps_1[exps[i]] /*- 2*/);
|
||||
@ -125,7 +125,7 @@ static inline int exp_unpack_ch (ac3dec_t * p_ac3dec, u16 type,
|
||||
{
|
||||
if (exps[i] > 124)
|
||||
{
|
||||
intf_ErrMsg ( "ac3dec error: invalid exponent" );
|
||||
msg_Err( p_ac3dec->p_fifo, "invalid exponent" );
|
||||
return 1;
|
||||
}
|
||||
exp_acc += (exps_1[exps[i]] /*- 2*/);
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_imdct.c: ac3 DCT
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_imdct.c,v 1.8 2002/04/23 23:44:36 fenrir Exp $
|
||||
* $Id: ac3_imdct.c,v 1.9 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -31,14 +31,12 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_mantissa.c: ac3 mantissa computation
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_mantissa.c,v 1.6 2001/12/30 07:09:54 sam Exp $
|
||||
* $Id: ac3_mantissa.c,v 1.7 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -28,16 +28,12 @@
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memcpy() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#include "ac3_mantissa.h"
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_mantissa.h: ac3 mantissa computation
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: ac3_mantissa.h,v 1.2 2002/05/18 17:47:46 sam Exp $
|
||||
* $Id: ac3_mantissa.h,v 1.3 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -245,8 +245,8 @@ static inline u16 dither_gen (mantissa_t * p_mantissa)
|
||||
|
||||
|
||||
/* Fetch an unpacked, left justified, and properly biased/dithered mantissa value */
|
||||
static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
u16 exp)
|
||||
static inline float coeff_get_float( ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
u16 exp )
|
||||
{
|
||||
u16 group_code = 0;
|
||||
|
||||
@ -270,7 +270,7 @@ static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
p_ac3dec->total_bits_read += 5;
|
||||
if ((group_code = GetBits (&p_ac3dec->bit_stream,5)) > 26)
|
||||
{
|
||||
intf_WarnMsg ( 3, "ac3dec warn: invalid mantissa (1)" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "invalid mantissa (1)" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
p_ac3dec->total_bits_read += 7;
|
||||
if ((group_code = GetBits (&p_ac3dec->bit_stream,7)) > 124)
|
||||
{
|
||||
intf_WarnMsg ( 3, "ac3dec warn: invalid mantissa (2)" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "invalid mantissa (2)" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -306,7 +306,7 @@ static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
p_ac3dec->total_bits_read += 3;
|
||||
if ((group_code = GetBits (&p_ac3dec->bit_stream,3)) > 6)
|
||||
{
|
||||
intf_WarnMsg ( 3, "ac3dec warn: invalid mantissa (3)" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "invalid mantissa (3)" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
p_ac3dec->total_bits_read += 7;
|
||||
if ((group_code = GetBits (&p_ac3dec->bit_stream,7)) > 120)
|
||||
{
|
||||
intf_WarnMsg ( 3, "ac3dec warn: invalid mantissa (4)" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "invalid mantissa (4)" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ static inline float coeff_get_float (ac3dec_t * p_ac3dec, u16 bap, u16 dithflag,
|
||||
p_ac3dec->total_bits_read += 4;
|
||||
if ((group_code = GetBits (&p_ac3dec->bit_stream,4)) > 14)
|
||||
{
|
||||
intf_WarnMsg ( 3, "ac3dec warn: invalid mantissa (5)" );
|
||||
msg_Warn( p_ac3dec->p_fifo, "invalid mantissa (5)" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_parse.c: ac3 parsing procedures
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_parse.c,v 1.8 2002/03/06 03:27:17 sam Exp $
|
||||
* $Id: ac3_parse.c,v 1.9 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -28,17 +28,12 @@
|
||||
*****************************************************************************/
|
||||
#include <string.h> /* memset() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h" /* ac3dec_thread_t */
|
||||
#include "ac3_adec.h"
|
||||
|
||||
#include "ac3_internal.h" /* EXP_REUSE */
|
||||
|
||||
@ -101,15 +96,13 @@ static void parse_audblk_stats (ac3dec_t * p_ac3dec);
|
||||
/* Parse a syncinfo structure */
|
||||
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info)
|
||||
{
|
||||
ac3dec_thread_t * p_ac3dec_t = (ac3dec_thread_t *) p_ac3dec->bit_stream.p_callback_arg;
|
||||
|
||||
p_ac3dec->total_bits_read = 0;
|
||||
p_ac3dec->i_available = 0;
|
||||
|
||||
/* sync word - should be 0x0b77 */
|
||||
RealignBits(&p_ac3dec->bit_stream);
|
||||
while( (ShowBits (&p_ac3dec->bit_stream,16)) != 0x0b77 &&
|
||||
(!p_ac3dec_t->p_fifo->b_die) && (!p_ac3dec_t->p_fifo->b_error))
|
||||
(!p_ac3dec->p_fifo->b_die) && (!p_ac3dec->p_fifo->b_error))
|
||||
{
|
||||
RemoveBits (&p_ac3dec->bit_stream,8);
|
||||
p_ac3dec->total_bits_read += 8;
|
||||
@ -298,10 +291,7 @@ int parse_bsi (ac3dec_t * p_ac3dec)
|
||||
}
|
||||
p_ac3dec->total_bits_read += 25;
|
||||
|
||||
if( p_main->b_stats )
|
||||
{
|
||||
parse_bsi_stats (p_ac3dec);
|
||||
}
|
||||
parse_bsi_stats (p_ac3dec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -776,10 +766,7 @@ int parse_audblk (ac3dec_t * p_ac3dec, int blknum)
|
||||
p_ac3dec->total_bits_read += 8 * p_ac3dec->audblk.skipl + 9;
|
||||
}
|
||||
|
||||
if( p_main->b_stats )
|
||||
{
|
||||
parse_audblk_stats(p_ac3dec);
|
||||
}
|
||||
parse_audblk_stats(p_ac3dec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_rematrix.c: ac3 audio rematrixing
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999-2001 VideoLAN
|
||||
* $Id: ac3_rematrix.c,v 1.7 2002/05/18 17:47:46 sam Exp $
|
||||
* $Id: ac3_rematrix.c,v 1.8 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Michel Kaempf <maxx@via.ecp.fr>
|
||||
* Aaron Holtzman <aholtzma@engr.uvic.ca>
|
||||
@ -25,14 +25,12 @@
|
||||
/*****************************************************************************
|
||||
* Preamble
|
||||
*****************************************************************************/
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
|
||||
#include "ac3_imdct.h"
|
||||
#include "ac3_downmix.h"
|
||||
#include "ac3_decoder.h"
|
||||
#include "ac3_adec.h"
|
||||
|
||||
struct rematrix_band_s {
|
||||
u32 start;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: ac3_spdif.c,v 1.26 2002/05/27 16:01:42 fenrir Exp $
|
||||
* $Id: ac3_spdif.c,v 1.27 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Stéphane Borel <stef@via.ecp.fr>
|
||||
* Juha Yrjola <jyrjola@cc.hut.fi>
|
||||
@ -31,27 +31,24 @@
|
||||
#include <string.h> /* memcpy() */
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/decoder.h>
|
||||
#include <vlc/aout.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "audio_output.h"
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-dec.h"
|
||||
|
||||
#include "ac3_spdif.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Local Prototypes
|
||||
****************************************************************************/
|
||||
static int decoder_Probe ( u8 * );
|
||||
static int decoder_Run ( decoder_config_t * );
|
||||
static int decoder_Run ( decoder_fifo_t * );
|
||||
static int InitThread ( ac3_spdif_thread_t * );
|
||||
static void EndThread ( ac3_spdif_thread_t * );
|
||||
static void BitstreamCallback ( bit_stream_t *, boolean_t );
|
||||
static void BitstreamCallback ( bit_stream_t *, vlc_bool_t );
|
||||
|
||||
int ac3_parse_syncinfo ( struct ac3_spdif_thread_s * );
|
||||
|
||||
@ -118,7 +115,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("SPDIF pass-through AC3 decoder") )
|
||||
ADD_CAPABILITY( DECODER, 0 )
|
||||
ADD_SHORTCUT( "ac3_spdif" )
|
||||
ADD_SHORTCUT( "pass_through" )
|
||||
ADD_SHORTCUT( "pass" )
|
||||
MODULE_INIT_STOP
|
||||
@ -147,11 +143,11 @@ static int decoder_Probe( u8 *pi_type )
|
||||
****************************************************************************
|
||||
* This function is called just after the thread is launched.
|
||||
****************************************************************************/
|
||||
static int decoder_Run( decoder_config_t * p_config )
|
||||
static int decoder_Run( decoder_fifo_t * p_fifo )
|
||||
{
|
||||
ac3_spdif_thread_t * p_spdif;
|
||||
mtime_t i_frame_time;
|
||||
boolean_t b_sync;
|
||||
vlc_bool_t b_sync;
|
||||
/* PTS of the current frame */
|
||||
mtime_t i_current_pts = 0;
|
||||
u16 i_length;
|
||||
@ -161,18 +157,17 @@ static int decoder_Run( decoder_config_t * p_config )
|
||||
|
||||
if( p_spdif == NULL )
|
||||
{
|
||||
intf_ErrMsg ( "spdif error: not enough memory "
|
||||
"for spdif_CreateThread() to create the new thread");
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
msg_Err( p_fifo, "out of memory" );
|
||||
DecoderError( p_fifo );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
p_spdif->p_config = p_config;
|
||||
p_spdif->p_fifo = p_fifo;
|
||||
|
||||
if (InitThread( p_spdif ) )
|
||||
{
|
||||
intf_ErrMsg( "spdif error: could not initialize thread" );
|
||||
DecoderError( p_config->p_decoder_fifo );
|
||||
msg_Err( p_fifo, "could not initialize thread" );
|
||||
DecoderError( p_fifo );
|
||||
free( p_spdif );
|
||||
return( -1 );
|
||||
}
|
||||
@ -194,8 +189,8 @@ static int decoder_Run( decoder_config_t * p_config )
|
||||
i_frame_time;
|
||||
if( i_delta > i_frame_time || i_delta < -i_frame_time )
|
||||
{
|
||||
intf_WarnMsg( 3, "spdif warning: date discontinuity (%d)",
|
||||
i_delta );
|
||||
msg_Warn( p_fifo,
|
||||
"date discontinuity (%d)", i_delta );
|
||||
}
|
||||
i_current_pts = p_spdif->i_real_pts;
|
||||
p_spdif->i_real_pts = 0;
|
||||
@ -257,7 +252,7 @@ static int decoder_Run( decoder_config_t * p_config )
|
||||
****************************************************************************/
|
||||
static int InitThread( ac3_spdif_thread_t * p_spdif )
|
||||
{
|
||||
boolean_t b_sync = 0;
|
||||
vlc_bool_t b_sync = 0;
|
||||
|
||||
/* Temporary buffer to store first ac3 frame */
|
||||
p_spdif->p_ac3 = malloc( SPDIF_FRAME_SIZE );
|
||||
@ -271,9 +266,9 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
|
||||
/*
|
||||
* Initialize the thread properties
|
||||
*/
|
||||
p_spdif->p_fifo = p_spdif->p_config->p_decoder_fifo;
|
||||
p_spdif->p_fifo = p_spdif->p_fifo;
|
||||
|
||||
InitBitstream( &p_spdif->bit_stream, p_spdif->p_config->p_decoder_fifo,
|
||||
InitBitstream( &p_spdif->bit_stream, p_spdif->p_fifo,
|
||||
BitstreamCallback, (void*)p_spdif );
|
||||
|
||||
/* Find syncword */
|
||||
@ -299,7 +294,7 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
|
||||
/* Check stream properties */
|
||||
if( ac3_parse_syncinfo( p_spdif ) < 0 )
|
||||
{
|
||||
intf_ErrMsg( "spdif error: stream not valid");
|
||||
msg_Err( p_spdif->p_fifo, "stream not valid" );
|
||||
|
||||
return( -1 );
|
||||
}
|
||||
@ -309,27 +304,28 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
|
||||
* but all rates should be supported by the decoder (32, 44.1, 48) */
|
||||
if( p_spdif->ac3_info.i_sample_rate != 48000 )
|
||||
{
|
||||
intf_ErrMsg( "spdif error: Only 48000 Hz streams tested"
|
||||
"expect weird things !" );
|
||||
msg_Err( p_spdif->p_fifo,
|
||||
"only 48000 Hz streams tested, expect weird things!" );
|
||||
}
|
||||
|
||||
/* The audio output need to be ready for an ac3 stream */
|
||||
p_spdif->i_previous_format = config_GetIntVariable( "audio-format" );
|
||||
config_PutIntVariable( "audio-format", 8 );
|
||||
p_spdif->i_previous_format = config_GetInt( p_spdif->p_fifo,
|
||||
"audio-format" );
|
||||
config_PutInt( p_spdif->p_fifo, "audio-format", 8 );
|
||||
|
||||
/* Creating the audio output fifo */
|
||||
p_spdif->p_aout_fifo = aout_CreateFifo( AOUT_FIFO_SPDIF, 1,
|
||||
p_spdif->ac3_info.i_sample_rate,
|
||||
p_spdif->ac3_info.i_frame_size,
|
||||
NULL );
|
||||
p_spdif->p_aout_fifo =
|
||||
aout_CreateFifo( p_spdif->p_fifo->p_this, AOUT_FIFO_SPDIF,
|
||||
1, p_spdif->ac3_info.i_sample_rate,
|
||||
p_spdif->ac3_info.i_frame_size, NULL );
|
||||
|
||||
if( p_spdif->p_aout_fifo == NULL )
|
||||
{
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
intf_WarnMsg( 3, "spdif: aout fifo #%d created",
|
||||
p_spdif->p_aout_fifo->i_fifo );
|
||||
msg_Dbg( p_spdif->p_fifo, "aout fifo #%d created",
|
||||
p_spdif->p_aout_fifo->i_fifo );
|
||||
|
||||
/* Put read data into fifo */
|
||||
memcpy( (u8*)(p_spdif->p_aout_fifo->buffer) +
|
||||
@ -365,7 +361,8 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
|
||||
}
|
||||
|
||||
/* restore previous setting for output format */
|
||||
config_PutIntVariable( "audio-format", p_spdif->i_previous_format );
|
||||
config_PutInt( p_spdif->p_fifo, "audio-format",
|
||||
p_spdif->i_previous_format );
|
||||
|
||||
/* Destroy descriptor */
|
||||
free( p_spdif );
|
||||
@ -377,7 +374,7 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
|
||||
* This function is called by input's NextDataPacket.
|
||||
*****************************************************************************/
|
||||
static void BitstreamCallback( bit_stream_t * p_bit_stream,
|
||||
boolean_t b_new_pes )
|
||||
vlc_bool_t b_new_pes )
|
||||
{
|
||||
ac3_spdif_thread_t * p_spdif;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* ac3_spdif.h: header for ac3 pass-through
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: ac3_spdif.h,v 1.3 2002/03/15 01:47:16 stef Exp $
|
||||
* $Id: ac3_spdif.h,v 1.4 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Stéphane Borel <stef@via.ecp.fr>
|
||||
*
|
||||
@ -68,7 +68,6 @@ typedef struct ac3_spdif_thread_s
|
||||
* Input properties
|
||||
*/
|
||||
decoder_fifo_t * p_fifo; /* stores the PES stream data */
|
||||
decoder_config_t * p_config;
|
||||
|
||||
/* The bit stream structure handles the PES stream at the bit level */
|
||||
bit_stream_t bit_stream;
|
||||
|
@ -2,7 +2,7 @@
|
||||
* file.c: file input (file: access plug-in)
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001, 2002 VideoLAN
|
||||
* $Id: file.c,v 1.6 2002/05/22 17:17:45 sam Exp $
|
||||
* $Id: file.c,v 1.7 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -31,7 +31,8 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/input.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
@ -39,16 +40,11 @@
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include "input_ext-plugins.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static void input_getfunctions( function_list_t * );
|
||||
static int FileOpen ( struct input_thread_s * );
|
||||
static int FileOpen ( input_thread_t * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
@ -59,7 +55,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("Standard filesystem file reading") )
|
||||
ADD_CAPABILITY( ACCESS, 50 )
|
||||
ADD_SHORTCUT( "file" )
|
||||
ADD_SHORTCUT( "stream" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
@ -95,7 +90,7 @@ static int FileOpen( input_thread_t * p_input )
|
||||
int i_stat;
|
||||
struct stat stat_info;
|
||||
input_socket_t * p_access_data;
|
||||
boolean_t b_stdin;
|
||||
vlc_bool_t b_stdin;
|
||||
|
||||
p_input->i_mtu = 0;
|
||||
|
||||
@ -103,8 +98,8 @@ static int FileOpen( input_thread_t * p_input )
|
||||
|
||||
if( !b_stdin && (i_stat = stat( psz_name, &stat_info )) == (-1) )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot stat() file `%s' (%s)",
|
||||
psz_name, strerror(errno));
|
||||
msg_Err( p_input, "cannot stat() file `%s' (%s)",
|
||||
psz_name, strerror(errno));
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -145,8 +140,7 @@ static int FileOpen( input_thread_t * p_input )
|
||||
else
|
||||
{
|
||||
vlc_mutex_unlock( &p_input->stream.stream_lock );
|
||||
intf_ErrMsg( "input error: unknown file type for `%s'",
|
||||
psz_name );
|
||||
msg_Err( p_input, "unknown file type for `%s'", psz_name );
|
||||
return( -1 );
|
||||
}
|
||||
}
|
||||
@ -155,12 +149,12 @@ static int FileOpen( input_thread_t * p_input )
|
||||
p_input->stream.i_method = INPUT_METHOD_FILE;
|
||||
vlc_mutex_unlock( &p_input->stream.stream_lock );
|
||||
|
||||
intf_WarnMsg( 2, "input: opening file `%s'", psz_name );
|
||||
msg_Dbg( p_input, "opening file `%s'", psz_name );
|
||||
p_access_data = malloc( sizeof(input_socket_t) );
|
||||
p_input->p_access_data = (void *)p_access_data;
|
||||
if( p_access_data == NULL )
|
||||
{
|
||||
intf_ErrMsg( "input error: Out of memory" );
|
||||
msg_Err( p_input, "out of memory" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -171,8 +165,8 @@ static int FileOpen( input_thread_t * p_input )
|
||||
else if( (p_access_data->i_handle = open( psz_name,
|
||||
/*O_NONBLOCK | O_LARGEFILE*/ 0 )) == (-1) )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot open file %s (%s)", psz_name,
|
||||
strerror(errno) );
|
||||
msg_Err( p_input, "cannot open file %s (%s)", psz_name,
|
||||
strerror(errno) );
|
||||
free( p_access_data );
|
||||
return( -1 );
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* http.c: HTTP access plug-in
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001, 2002 VideoLAN
|
||||
* $Id: http.c,v 1.10 2002/05/22 23:11:00 massiot Exp $
|
||||
* $Id: http.c,v 1.11 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -31,7 +31,8 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/input.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
@ -49,21 +50,16 @@
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include "input_ext-plugins.h"
|
||||
|
||||
#include "network.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static void input_getfunctions( function_list_t * );
|
||||
static int HTTPOpen ( struct input_thread_s * );
|
||||
static void HTTPClose ( struct input_thread_s * );
|
||||
static int HTTPSetProgram ( struct input_thread_s * , pgrm_descriptor_t * );
|
||||
static void HTTPSeek ( struct input_thread_s *, off_t );
|
||||
static int HTTPOpen ( input_thread_t * );
|
||||
static void HTTPClose ( input_thread_t * );
|
||||
static int HTTPSetProgram ( input_thread_t *, pgrm_descriptor_t * );
|
||||
static void HTTPSeek ( input_thread_t *, off_t );
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
@ -74,7 +70,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("HTTP access plug-in") )
|
||||
ADD_CAPABILITY( ACCESS, 0 )
|
||||
ADD_SHORTCUT( "http" )
|
||||
ADD_SHORTCUT( "http4" )
|
||||
ADD_SHORTCUT( "http6" )
|
||||
MODULE_INIT_STOP
|
||||
@ -122,12 +117,12 @@ typedef struct _input_socket_s
|
||||
static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
|
||||
{
|
||||
_input_socket_t * p_access_data = p_input->p_access_data;
|
||||
struct module_s * p_network;
|
||||
module_t * p_network;
|
||||
char psz_buffer[256];
|
||||
byte_t * psz_parser;
|
||||
|
||||
/* Find an appropriate network module */
|
||||
p_network = module_Need( MODULE_CAPABILITY_NETWORK,
|
||||
p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
|
||||
p_access_data->psz_network,
|
||||
&p_access_data->socket_desc );
|
||||
if( p_network == NULL )
|
||||
@ -153,7 +148,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
|
||||
if( send( p_access_data->_socket.i_handle, psz_buffer,
|
||||
strlen( psz_buffer ), 0 ) == (-1) )
|
||||
{
|
||||
intf_ErrMsg( "http error: cannot send request (%s)", strerror(errno) );
|
||||
msg_Err( p_input, "cannot send request (%s)", strerror(errno) );
|
||||
input_FDNetworkClose( p_input );
|
||||
return( -1 );
|
||||
}
|
||||
@ -178,7 +173,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
|
||||
{
|
||||
if( input_Peek( p_input, &psz_parser, MAX_LINE ) <= 0 )
|
||||
{
|
||||
intf_ErrMsg( "http error: not enough data" );
|
||||
msg_Err( p_input, "not enough data" );
|
||||
input_FDNetworkClose( p_input );
|
||||
return( -1 );
|
||||
}
|
||||
@ -238,18 +233,18 @@ static int HTTPOpen( input_thread_t * p_input )
|
||||
p_access_data = p_input->p_access_data = malloc( sizeof(_input_socket_t) );
|
||||
if( p_access_data == NULL )
|
||||
{
|
||||
intf_ErrMsg( "http error: Out of memory" );
|
||||
msg_Err( p_input, "out of memory" );
|
||||
free(psz_name);
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
p_access_data->psz_name = psz_name;
|
||||
p_access_data->psz_network = "";
|
||||
if( config_GetIntVariable( "ipv4" ) )
|
||||
if( config_GetInt( p_input, "ipv4" ) )
|
||||
{
|
||||
p_access_data->psz_network = "ipv4";
|
||||
}
|
||||
if( config_GetIntVariable( "ipv6" ) )
|
||||
if( config_GetInt( p_input, "ipv6" ) )
|
||||
{
|
||||
p_access_data->psz_network = "ipv6";
|
||||
}
|
||||
@ -304,8 +299,7 @@ static int HTTPOpen( input_thread_t * p_input )
|
||||
i_server_port = strtol( psz_server_port, &psz_parser, 10 );
|
||||
if( *psz_parser )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot parse server port near %s",
|
||||
psz_parser );
|
||||
msg_Err( p_input, "cannot parse server port near %s", psz_parser );
|
||||
free( p_input->p_access_data );
|
||||
free( psz_name );
|
||||
return( -1 );
|
||||
@ -319,7 +313,7 @@ static int HTTPOpen( input_thread_t * p_input )
|
||||
|
||||
if( !*psz_server_addr )
|
||||
{
|
||||
intf_ErrMsg( "input error: no server given" );
|
||||
msg_Err( p_input, "no server given" );
|
||||
free( p_input->p_access_data );
|
||||
free( psz_name );
|
||||
return( -1 );
|
||||
@ -382,7 +376,7 @@ static int HTTPOpen( input_thread_t * p_input )
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_ErrMsg( "input error: http_proxy environment variable is invalid !" );
|
||||
msg_Err( p_input, "http_proxy environment variable is invalid!" );
|
||||
free( p_input->p_access_data );
|
||||
free( psz_name );
|
||||
return( -1 );
|
||||
@ -409,8 +403,8 @@ static int HTTPOpen( input_thread_t * p_input )
|
||||
}
|
||||
p_access_data->psz_buffer[sizeof(p_access_data->psz_buffer) - 1] = '\0';
|
||||
|
||||
intf_WarnMsg( 2, "input: opening server=%s port=%d path=%s",
|
||||
psz_server_addr, i_server_port, psz_path );
|
||||
msg_Dbg( p_input, "opening server=%s port=%d path=%s",
|
||||
psz_server_addr, i_server_port, psz_path );
|
||||
|
||||
vlc_mutex_lock( &p_input->stream.stream_lock );
|
||||
p_input->stream.b_pace_control = 1;
|
||||
@ -448,7 +442,7 @@ static void HTTPSeek( input_thread_t * p_input, off_t i_pos )
|
||||
{
|
||||
_input_socket_t * p_access_data = p_input->p_access_data;
|
||||
close( p_access_data->_socket.i_handle );
|
||||
intf_WarnMsg( 2, "http: seeking to position %lld", i_pos );
|
||||
msg_Dbg( p_input, "seeking to position %lld", i_pos );
|
||||
HTTPConnect( p_input, i_pos );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* udp.c: raw UDP access plug-in
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001, 2002 VideoLAN
|
||||
* $Id: udp.c,v 1.10 2002/05/15 13:07:18 marcari Exp $
|
||||
* $Id: udp.c,v 1.11 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Christophe Massiot <massiot@via.ecp.fr>
|
||||
*
|
||||
@ -31,7 +31,8 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/input.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
@ -39,18 +40,13 @@
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include "input_ext-plugins.h"
|
||||
|
||||
#include "network.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static void input_getfunctions( function_list_t * );
|
||||
static int UDPOpen ( struct input_thread_s * );
|
||||
static int UDPOpen ( input_thread_t * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
@ -61,7 +57,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("Raw UDP access plug-in") )
|
||||
ADD_CAPABILITY( ACCESS, 0 )
|
||||
ADD_SHORTCUT( "udp" )
|
||||
ADD_SHORTCUT( "udpstream" )
|
||||
ADD_SHORTCUT( "udp4" )
|
||||
ADD_SHORTCUT( "udp6" )
|
||||
@ -96,7 +91,7 @@ static void input_getfunctions( function_list_t * p_function_list )
|
||||
static int UDPOpen( input_thread_t * p_input )
|
||||
{
|
||||
input_socket_t * p_access_data;
|
||||
struct module_s * p_network;
|
||||
module_t * p_network;
|
||||
char * psz_network = "";
|
||||
char * psz_name = strdup(p_input->psz_name);
|
||||
char * psz_parser = psz_name;
|
||||
@ -107,11 +102,11 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
int i_bind_port = 0, i_server_port = 0;
|
||||
network_socket_t socket_desc;
|
||||
|
||||
if( config_GetIntVariable( "ipv4" ) )
|
||||
if( config_GetInt( p_input, "ipv4" ) )
|
||||
{
|
||||
psz_network = "ipv4";
|
||||
}
|
||||
if( config_GetIntVariable( "ipv6" ) )
|
||||
if( config_GetInt( p_input, "ipv6" ) )
|
||||
{
|
||||
psz_network = "ipv6";
|
||||
}
|
||||
@ -205,8 +200,7 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
i_server_port = strtol( psz_server_port, &psz_parser, 10 );
|
||||
if( *psz_parser )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot parse server port near %s",
|
||||
psz_parser );
|
||||
msg_Err( p_input, "cannot parse server port near %s", psz_parser );
|
||||
free(psz_name);
|
||||
return( -1 );
|
||||
}
|
||||
@ -217,8 +211,7 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
i_bind_port = strtol( psz_bind_port, &psz_parser, 10 );
|
||||
if( *psz_parser )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot parse bind port near %s",
|
||||
psz_parser );
|
||||
msg_Err( p_input, "cannot parse bind port near %s", psz_parser );
|
||||
free(psz_name);
|
||||
return( -1 );
|
||||
}
|
||||
@ -233,19 +226,19 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
|
||||
if( *psz_server_addr || i_server_port )
|
||||
{
|
||||
intf_ErrMsg("input warning: this UDP syntax is deprecated ; the server argument will be");
|
||||
intf_ErrMsg("ignored (%s:%d). If you wanted to enter a multicast address",
|
||||
psz_server_addr, i_server_port);
|
||||
intf_ErrMsg("or local port, type : %s:@%s:%d",
|
||||
*p_input->psz_access ? p_input->psz_access : "udp",
|
||||
psz_server_addr, i_server_port );
|
||||
msg_Err( p_input, "this UDP syntax is deprecated; the server argument will be");
|
||||
msg_Err( p_input, "ignored (%s:%d). If you wanted to enter a multicast address",
|
||||
psz_server_addr, i_server_port);
|
||||
msg_Err( p_input, "or local port, type : %s:@%s:%d",
|
||||
*p_input->psz_access ? p_input->psz_access : "udp",
|
||||
psz_server_addr, i_server_port );
|
||||
|
||||
i_server_port = 0;
|
||||
psz_server_addr = "";
|
||||
}
|
||||
|
||||
intf_WarnMsg( 2, "input: opening server=%s:%d local=%s:%d",
|
||||
psz_server_addr, i_server_port, psz_bind_addr, i_bind_port );
|
||||
msg_Dbg( p_input, "opening server=%s:%d local=%s:%d",
|
||||
psz_server_addr, i_server_port, psz_bind_addr, i_bind_port );
|
||||
|
||||
/* Prepare the network_socket_t structure */
|
||||
socket_desc.i_type = NETWORK_UDP;
|
||||
@ -255,8 +248,8 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
socket_desc.i_server_port = i_server_port;
|
||||
|
||||
/* Find an appropriate network module */
|
||||
p_network = module_Need( MODULE_CAPABILITY_NETWORK, psz_network,
|
||||
&socket_desc );
|
||||
p_network = module_Need( p_input, MODULE_CAPABILITY_NETWORK,
|
||||
psz_network, &socket_desc );
|
||||
free(psz_name);
|
||||
if( p_network == NULL )
|
||||
{
|
||||
@ -267,7 +260,7 @@ static int UDPOpen( input_thread_t * p_input )
|
||||
p_access_data = p_input->p_access_data = malloc( sizeof(input_socket_t) );
|
||||
if( p_access_data == NULL )
|
||||
{
|
||||
intf_ErrMsg( "input error: Out of memory" );
|
||||
msg_Err( p_input, "out of memory" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* alsa.c : alsa plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000-2001 VideoLAN
|
||||
* $Id: alsa.c,v 1.17 2002/04/21 10:32:20 sam Exp $
|
||||
* $Id: alsa.c,v 1.18 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Henri Fallon <henri@videolan.org> - Original Author
|
||||
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
|
||||
@ -27,15 +27,13 @@
|
||||
*****************************************************************************/
|
||||
#include <errno.h> /* ENOMEM */
|
||||
#include <string.h> /* strerror() */
|
||||
#include <stdio.h> /* "intf_msg.h" */
|
||||
#include <stdlib.h> /* calloc(), malloc(), free() */
|
||||
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h" /* aout_thread_t */
|
||||
|
||||
/*****************************************************************************
|
||||
* Capabilities defined in the other files.
|
||||
*****************************************************************************/
|
||||
@ -57,7 +55,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("ALSA audio module") )
|
||||
ADD_CAPABILITY( AOUT, 50 )
|
||||
ADD_SHORTCUT( "alsa" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
MODULE_ACTIVATE_START
|
||||
@ -82,7 +79,7 @@ typedef struct alsa_card_s
|
||||
|
||||
/* here we store plugin dependant informations */
|
||||
|
||||
typedef struct aout_sys_s
|
||||
struct aout_sys_s
|
||||
{
|
||||
snd_pcm_t * p_alsa_handle;
|
||||
unsigned long buffer_time;
|
||||
@ -93,7 +90,7 @@ typedef struct aout_sys_s
|
||||
unsigned int bytes_per_sample;
|
||||
unsigned int samples_per_frame;
|
||||
unsigned int bytes_per_frame;
|
||||
} aout_sys_t;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Functions exported as capabilities. They are declared as static so that
|
||||
@ -122,8 +119,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
|
||||
if( p_aout->p_sys == NULL )
|
||||
{
|
||||
intf_ErrMsg( "aout error: failed allocating memory for ALSA (%s)",
|
||||
strerror(ENOMEM) );
|
||||
msg_Err( p_aout, "out of memory" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -147,8 +143,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
psz_alsadev, SND_PCM_STREAM_PLAYBACK, 0);
|
||||
if( i_ret != 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: could not open ALSA device (%s)",
|
||||
snd_strerror( i_ret ) );
|
||||
msg_Err( p_aout, "cannot open ALSA device (%s)", snd_strerror(i_ret) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -203,7 +198,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
i_rv = snd_pcm_hw_params_any( p_aout->p_sys->p_alsa_handle, p_hw );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to retrieve initial parameters" );
|
||||
msg_Err( p_aout, "unable to retrieve initial parameters" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -211,7 +206,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set interleaved stream format" );
|
||||
msg_Err( p_aout, "unable to set interleaved stream format" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -219,8 +214,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
p_hw, i_format );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set stream sample size and word"
|
||||
" order" );
|
||||
msg_Err( p_aout, "unable to set stream sample size and word order" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -228,7 +222,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
p_aout->i_channels );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set number of output channels" );
|
||||
msg_Err( p_aout, "unable to set number of output channels" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -236,7 +230,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
p_aout->i_rate, 0 );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set sample rate" );
|
||||
msg_Err( p_aout, "unable to set sample rate" );
|
||||
return( -1 );
|
||||
}
|
||||
p_aout->p_sys->rate = i_rv;
|
||||
@ -247,7 +241,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
0 );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set buffer time" );
|
||||
msg_Err( p_aout, "unable to set buffer time" );
|
||||
return( -1 );
|
||||
}
|
||||
p_aout->p_sys->buffer_time = i_rv;
|
||||
@ -256,7 +250,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
p_hw, p_aout->p_sys->buffer_time / p_aout->p_sys->bytes_per_frame, 0 );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set period time" );
|
||||
msg_Err( p_aout, "unable to set period time" );
|
||||
return( -1 );
|
||||
}
|
||||
p_aout->p_sys->period_time = i_rv;
|
||||
@ -264,7 +258,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
i_rv = snd_pcm_hw_params(p_aout->p_sys->p_alsa_handle, p_hw);
|
||||
if (i_rv < 0)
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set hardware configuration" );
|
||||
msg_Err( p_aout, "unable to set hardware configuration" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -288,7 +282,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
i_rv = snd_pcm_sw_params( p_aout->p_sys->p_alsa_handle, p_sw );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to set software configuration" );
|
||||
msg_Err( p_aout, "unable to set software configuration" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -305,14 +299,14 @@ static void aout_HandleXrun(aout_thread_t *p_aout)
|
||||
{
|
||||
int i_rv;
|
||||
|
||||
intf_ErrMsg( "aout error: resetting output after buffer underrun" );
|
||||
msg_Err( p_aout, "resetting output after buffer underrun" );
|
||||
|
||||
// i_rv = snd_pcm_reset( p_aout->p_sys->p_alsa_handle );
|
||||
i_rv = snd_pcm_prepare( p_aout->p_sys->p_alsa_handle );
|
||||
if( i_rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: unable to recover from buffer underrun (%s)",
|
||||
snd_strerror( i_rv ) );
|
||||
msg_Err( p_aout, "unable to recover from buffer underrun (%s)",
|
||||
snd_strerror( i_rv ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,8 +331,8 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
|
||||
|
||||
if( i_alsa_get_status_returns )
|
||||
{
|
||||
intf_ErrMsg ( "aout error: failed getting alsa buffer info (%s)",
|
||||
snd_strerror ( i_alsa_get_status_returns ) );
|
||||
msg_Err( p_aout, "failed getting alsa buffer info (%s)",
|
||||
snd_strerror ( i_alsa_get_status_returns ) );
|
||||
return ( -1 );
|
||||
}
|
||||
|
||||
@ -354,8 +348,8 @@ static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
|
||||
break;
|
||||
|
||||
default:
|
||||
intf_ErrMsg( "aout error: unhandled condition %i",
|
||||
snd_pcm_status_get_state( p_status ) );
|
||||
msg_Err( p_aout, "unhandled condition %i",
|
||||
snd_pcm_status_get_state( p_status ) );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -385,8 +379,8 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
|
||||
if( (signed int) rv < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: failed writing to output (%s)",
|
||||
snd_strerror( rv ) );
|
||||
msg_Err( p_aout, "failed writing to output (%s)",
|
||||
snd_strerror( rv ) );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -405,8 +399,8 @@ static void aout_Close( aout_thread_t *p_aout )
|
||||
|
||||
if( i_close_returns )
|
||||
{
|
||||
intf_ErrMsg( "aout error: failed closing ALSA device (%s)",
|
||||
i_close_returns, snd_strerror( i_close_returns ) );
|
||||
msg_Err( p_aout, "failed closing ALSA device (%s)",
|
||||
snd_strerror( i_close_returns ) );
|
||||
}
|
||||
|
||||
free( p_aout->p_sys );
|
||||
|
@ -1 +1 @@
|
||||
arts_SOURCES = arts.c aout_arts.c
|
||||
arts_SOURCES = arts.c
|
||||
|
@ -1,152 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* aout_arts.c : aRts functions library
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
*
|
||||
* Authors: Blindauer Emmanuel <manu@agat.net>
|
||||
*
|
||||
* 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 <errno.h> /* ENOMEM */
|
||||
#include <fcntl.h> /* open(), O_WRONLY */
|
||||
#include <string.h> /* strerror() */
|
||||
#include <unistd.h> /* write(), close() */
|
||||
#include <stdio.h> /* "intf_msg.h" */
|
||||
#include <stdlib.h> /* calloc(), malloc(), free() */
|
||||
|
||||
#include <artsc.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h" /* aout_thread_t */
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_sys_t: arts audio output method descriptor
|
||||
*****************************************************************************
|
||||
* This structure is part of the audio output thread descriptor.
|
||||
* It describes some arts specific variables.
|
||||
*****************************************************************************/
|
||||
typedef struct aout_sys_s
|
||||
{
|
||||
arts_stream_t stream;
|
||||
|
||||
} aout_sys_t;
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes.
|
||||
*****************************************************************************/
|
||||
static int aout_Open ( aout_thread_t *p_aout );
|
||||
static int aout_SetFormat ( aout_thread_t *p_aout );
|
||||
static int aout_GetBufInfo ( aout_thread_t *p_aout, int i_buffer_info );
|
||||
static void aout_Play ( aout_thread_t *p_aout,
|
||||
byte_t *buffer, int i_size );
|
||||
static void aout_Close ( aout_thread_t *p_aout );
|
||||
|
||||
/*****************************************************************************
|
||||
* Functions exported as capabilities. They are declared as static so that
|
||||
* we don't pollute the namespace too much.
|
||||
*****************************************************************************/
|
||||
void _M( aout_getfunctions )( function_list_t * p_function_list )
|
||||
{
|
||||
p_function_list->functions.aout.pf_open = aout_Open;
|
||||
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
|
||||
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
|
||||
p_function_list->functions.aout.pf_play = aout_Play;
|
||||
p_function_list->functions.aout.pf_close = aout_Close;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Open: initialize arts connection to server
|
||||
*****************************************************************************/
|
||||
static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
int i_err = 0;
|
||||
|
||||
/* Allocate structure */
|
||||
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
|
||||
if( p_aout->p_sys == NULL )
|
||||
{
|
||||
intf_ErrMsg("error: %s", strerror(ENOMEM) );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
i_err = arts_init();
|
||||
|
||||
if (i_err < 0)
|
||||
{
|
||||
intf_ErrMsg( "aout error: arts_init (%s)", arts_error_text(i_err) );
|
||||
free( p_aout->p_sys );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
p_aout->p_sys->stream =
|
||||
arts_play_stream( p_aout->i_rate, 16, p_aout->i_channels, "vlc" );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_SetFormat: set the output format
|
||||
*****************************************************************************/
|
||||
static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
{
|
||||
/*Not ready*/
|
||||
/* p_aout->i_latency = esd_get_latency(i_fd);*/
|
||||
p_aout->i_latency = 0;
|
||||
|
||||
//intf_WarnMsg( 5, "aout_arts_latency: %d",p_aout->i_latency);
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_GetBufInfo: buffer status query
|
||||
*****************************************************************************/
|
||||
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
|
||||
{
|
||||
/* arbitrary value that should be changed */
|
||||
return( i_buffer_limit );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Play: play a sound samples buffer
|
||||
*****************************************************************************
|
||||
* This function writes a buffer of i_length bytes in the socket
|
||||
*****************************************************************************/
|
||||
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
{
|
||||
|
||||
int i_err = arts_write( p_aout->p_sys->stream, buffer, i_size );
|
||||
|
||||
if( i_err < 0 )
|
||||
{
|
||||
intf_ErrMsg( "aout error: arts_write (%s)", arts_error_text(i_err) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Close: close the Esound socket
|
||||
*****************************************************************************/
|
||||
static void aout_Close( aout_thread_t *p_aout )
|
||||
{
|
||||
arts_close_stream( p_aout->p_sys->stream );
|
||||
free( p_aout->p_sys );
|
||||
}
|
||||
|
@ -23,15 +23,37 @@
|
||||
/*****************************************************************************
|
||||
* Preamble
|
||||
*****************************************************************************/
|
||||
#include <stdlib.h> /* malloc(), free() */
|
||||
#include <string.h> /* strdup() */
|
||||
#include <errno.h> /* ENOMEM */
|
||||
#include <fcntl.h> /* open(), O_WRONLY */
|
||||
#include <string.h> /* strerror() */
|
||||
#include <unistd.h> /* write(), close() */
|
||||
#include <stdlib.h> /* calloc(), malloc(), free() */
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
|
||||
#include <artsc.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Capabilities defined in the other files.
|
||||
* aout_sys_t: arts audio output method descriptor
|
||||
*****************************************************************************
|
||||
* This structure is part of the audio output thread descriptor.
|
||||
* It describes some arts specific variables.
|
||||
*****************************************************************************/
|
||||
void _M( aout_getfunctions )( function_list_t * p_function_list );
|
||||
struct aout_sys_s
|
||||
{
|
||||
arts_stream_t stream;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
* Local prototypes.
|
||||
*****************************************************************************/
|
||||
static void aout_getfunctions ( function_list_t * );
|
||||
static int aout_Open ( aout_thread_t * );
|
||||
static int aout_SetFormat ( aout_thread_t * );
|
||||
static int aout_GetBufInfo ( aout_thread_t *, int );
|
||||
static void aout_Play ( aout_thread_t *, byte_t *, int );
|
||||
static void aout_Close ( aout_thread_t * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
@ -42,13 +64,102 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( _("aRts audio module") )
|
||||
ADD_CAPABILITY( AOUT, 50 )
|
||||
ADD_SHORTCUT( "arts" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
MODULE_ACTIVATE_START
|
||||
_M( aout_getfunctions )( &p_module->p_functions->aout );
|
||||
aout_getfunctions( &p_module->p_functions->aout );
|
||||
MODULE_ACTIVATE_STOP
|
||||
|
||||
MODULE_DEACTIVATE_START
|
||||
MODULE_DEACTIVATE_STOP
|
||||
|
||||
/*****************************************************************************
|
||||
* Functions exported as capabilities. They are declared as static so that
|
||||
* we don't pollute the namespace too much.
|
||||
*****************************************************************************/
|
||||
static void aout_getfunctions( function_list_t * p_function_list )
|
||||
{
|
||||
p_function_list->functions.aout.pf_open = aout_Open;
|
||||
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
|
||||
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
|
||||
p_function_list->functions.aout.pf_play = aout_Play;
|
||||
p_function_list->functions.aout.pf_close = aout_Close;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Open: initialize arts connection to server
|
||||
*****************************************************************************/
|
||||
static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
int i_err = 0;
|
||||
|
||||
/* Allocate structure */
|
||||
p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
|
||||
if( p_aout->p_sys == NULL )
|
||||
{
|
||||
msg_Err( p_aout, "out of memory" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
i_err = arts_init();
|
||||
|
||||
if (i_err < 0)
|
||||
{
|
||||
msg_Err( p_aout, "arts_init failed (%s)", arts_error_text(i_err) );
|
||||
free( p_aout->p_sys );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
p_aout->p_sys->stream =
|
||||
arts_play_stream( p_aout->i_rate, 16, p_aout->i_channels, "vlc" );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_SetFormat: set the output format
|
||||
*****************************************************************************/
|
||||
static int aout_SetFormat( aout_thread_t *p_aout )
|
||||
{
|
||||
/*Not ready*/
|
||||
/* p_aout->i_latency = esd_get_latency(i_fd);*/
|
||||
p_aout->i_latency = 0;
|
||||
|
||||
//msg_Dbg( p_aout, "aout_arts_latency: %d", p_aout->i_latency );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_GetBufInfo: buffer status query
|
||||
*****************************************************************************/
|
||||
static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
|
||||
{
|
||||
/* arbitrary value that should be changed */
|
||||
return( i_buffer_limit );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Play: play a sound samples buffer
|
||||
*****************************************************************************
|
||||
* This function writes a buffer of i_length bytes in the socket
|
||||
*****************************************************************************/
|
||||
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
|
||||
{
|
||||
int i_err = arts_write( p_aout->p_sys->stream, buffer, i_size );
|
||||
|
||||
if( i_err < 0 )
|
||||
{
|
||||
msg_Err( p_aout, "arts_write failed (%s)", arts_error_text(i_err) );
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* aout_Close: close the Esound socket
|
||||
*****************************************************************************/
|
||||
static void aout_Close( aout_thread_t *p_aout )
|
||||
{
|
||||
arts_close_stream( p_aout->p_sys->stream );
|
||||
free( p_aout->p_sys );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* avi.c : AVI file Stream input module for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: avi.c,v 1.20 2002/05/25 16:23:07 fenrir Exp $
|
||||
* $Id: avi.c,v 1.21 2002/06/01 12:31:58 sam Exp $
|
||||
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -28,12 +28,8 @@
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
#include "input_ext-dec.h"
|
||||
#include "input_ext-plugins.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/input.h>
|
||||
|
||||
#include "video.h"
|
||||
|
||||
@ -44,10 +40,10 @@
|
||||
/*****************************************************************************
|
||||
* Local prototypes
|
||||
*****************************************************************************/
|
||||
static void input_getfunctions( function_list_t * p_function_list );
|
||||
static int AVIDemux ( struct input_thread_s * );
|
||||
static int AVIInit ( struct input_thread_s * );
|
||||
static void AVIEnd ( struct input_thread_s * );
|
||||
static void input_getfunctions( function_list_t * );
|
||||
static int AVIDemux ( input_thread_t * );
|
||||
static int AVIInit ( input_thread_t * );
|
||||
static void AVIEnd ( input_thread_t * );
|
||||
|
||||
/*****************************************************************************
|
||||
* Build configuration tree.
|
||||
@ -58,7 +54,6 @@ MODULE_CONFIG_STOP
|
||||
MODULE_INIT_START
|
||||
SET_DESCRIPTION( "RIFF-AVI Stream input" )
|
||||
ADD_CAPABILITY( DEMUX, 150 )
|
||||
ADD_SHORTCUT( "avi" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
MODULE_ACTIVATE_START
|
||||
@ -277,19 +272,19 @@ static void __AVI_GetIndex( input_thread_t *p_input )
|
||||
&p_idx1,
|
||||
FOURCC_idx1)!=0 )
|
||||
{
|
||||
intf_WarnMsg( 1, "input init: cannot find index" );
|
||||
msg_Warn( p_input, "cannot find index" );
|
||||
RIFF_GoToChunk( p_input, p_avi_demux->p_hdrl );
|
||||
return;
|
||||
}
|
||||
p_avi_demux->p_idx1 = p_idx1;
|
||||
intf_WarnMsg( 1, "input init: loading index" );
|
||||
msg_Dbg( p_input, "loading index" );
|
||||
for(;;)
|
||||
{
|
||||
i_read = __MIN( 16*1024, p_idx1->i_size - i_totalentry *16);
|
||||
if( ((i_read = input_Peek( p_input, &p_buff, i_read )) < 16 )
|
||||
||( i_totalentry *16 >= p_idx1->i_size ) )
|
||||
{
|
||||
intf_WarnMsg( 1,"input info: read %d idx entries", i_totalentry );
|
||||
msg_Dbg( p_input, "read %d idx entries", i_totalentry );
|
||||
return;
|
||||
}
|
||||
i_read /= 16 ;
|
||||
@ -325,7 +320,7 @@ static int __AVI_SeekToChunk( input_thread_t *p_input, AVIStreamInfo_t *p_info )
|
||||
return( 0 );
|
||||
}
|
||||
/* no index can't arrive but ...*/
|
||||
intf_WarnMsg( 1, "input error: can't seek");
|
||||
msg_Warn( p_input, "cannot seek");
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -360,8 +355,7 @@ static void __AVI_UpdateIndexOffset( input_thread_t *p_input )
|
||||
{
|
||||
for( i = 0; i < p_info->i_idxnb; i++ )
|
||||
{
|
||||
p_info->p_index[i].i_pos +=
|
||||
p_avi_demux->p_movi->i_pos + 8;
|
||||
p_info->p_index[i].i_pos += p_avi_demux->p_movi->i_pos + 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -452,14 +446,14 @@ static int AVIInit( input_thread_t *p_input )
|
||||
/* we need to seek to be able to readcorrectly */
|
||||
if( !p_input->stream.b_seekable )
|
||||
{
|
||||
intf_WarnMsg( 2,"input: RIFF-AVI plug-in discarded (no seekable)" );
|
||||
msg_Warn( p_input, "RIFF-AVI module discarded (not seekable)" );
|
||||
return( -1 );
|
||||
}
|
||||
p_input->p_demux_data =
|
||||
p_avi_demux = malloc( sizeof(demux_data_avi_file_t) );
|
||||
if( p_avi_demux == NULL )
|
||||
{
|
||||
intf_ErrMsg( "input error: not enough memory" );
|
||||
msg_Err( p_input, "out of memory" );
|
||||
return( -1 );
|
||||
}
|
||||
memset( p_avi_demux, 0, sizeof( demux_data_avi_file_t ) );
|
||||
@ -475,7 +469,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if( RIFF_TestFileHeader( p_input, &p_riff, FOURCC_AVI ) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_WarnMsg( 2,"input: RIFF-AVI plug-in discarded (avi_file)" );
|
||||
msg_Warn( p_input, "RIFF-AVI module discarded" );
|
||||
return( -1 );
|
||||
}
|
||||
p_avi_demux->p_riff = p_riff;
|
||||
@ -483,7 +477,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if ( RIFF_DescendChunk(p_input) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot look for subchunk (avi_file)" );
|
||||
msg_Err( p_input, "cannot look for subchunk" );
|
||||
return ( -1 );
|
||||
}
|
||||
|
||||
@ -491,7 +485,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if( RIFF_FindListChunk(p_input ,&p_hdrl,p_riff, FOURCC_hdrl) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot find \"LIST-hdrl\" (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"LIST-hdrl\"" );
|
||||
return( -1 );
|
||||
}
|
||||
p_avi_demux->p_hdrl = p_hdrl;
|
||||
@ -499,7 +493,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if( RIFF_DescendChunk(p_input) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot look for subchunk (avi_file)" );
|
||||
msg_Err( p_input, "cannot look for subchunk" );
|
||||
return ( -1 );
|
||||
}
|
||||
/* in LIST-hdrl search avih */
|
||||
@ -507,7 +501,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
&p_avih, FOURCC_avih ) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot find \"avih\" chunk (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"avih\" chunk" );
|
||||
return( -1 );
|
||||
}
|
||||
__AVI_Parse_avih( &p_avi_demux->avih, p_avih->p_data->p_payload_start );
|
||||
@ -517,24 +511,24 @@ static int AVIInit( input_thread_t *p_input )
|
||||
/* no stream found, perhaps it would be cool to find it */
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: no defined stream !" );
|
||||
msg_Err( p_input, "no stream defined!" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* create one program */
|
||||
vlc_mutex_lock( &p_input->stream.stream_lock );
|
||||
vlc_mutex_lock( &p_input->stream.stream_lock );
|
||||
if( input_InitStream( p_input, 0 ) == -1)
|
||||
{
|
||||
vlc_mutex_unlock( &p_input->stream.stream_lock );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot init stream" );
|
||||
msg_Err( p_input, "cannot init stream" );
|
||||
return( -1 );
|
||||
}
|
||||
if( input_AddProgram( p_input, 0, 0) == NULL )
|
||||
{
|
||||
vlc_mutex_unlock( &p_input->stream.stream_lock );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot add program" );
|
||||
msg_Err( p_input, "cannot add program" );
|
||||
return( -1 );
|
||||
}
|
||||
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
|
||||
@ -561,7 +555,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
||( RIFF_DescendChunk(p_input) != 0 ))
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot find \"LIST-strl\" (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"LIST-strl\"" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -571,7 +565,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
{
|
||||
RIFF_DeleteChunk( p_input, p_strl );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot find \"strh\" (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"strh\"" );
|
||||
return( -1 );
|
||||
}
|
||||
__AVI_Parse_Header( &p_info->header,
|
||||
@ -584,7 +578,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
{
|
||||
RIFF_DeleteChunk( p_input, p_strl );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot find \"strf\" (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"strf\"" );
|
||||
return( -1 );
|
||||
}
|
||||
/* we don't get strd, it's useless for divx,opendivx,mepgaudio */
|
||||
@ -593,7 +587,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
RIFF_DeleteChunk( p_input, p_strf );
|
||||
RIFF_DeleteChunk( p_input, p_strl );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot go out (\"strl\") (avi_file)" );
|
||||
msg_Err( p_input, "cannot go out (\"strl\")" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -616,9 +610,8 @@ static int AVIInit( input_thread_t *p_input )
|
||||
__AVI_AudioGetType( p_info->audio_format.i_formattag );
|
||||
if( p_es->i_type == 0 )
|
||||
{
|
||||
intf_ErrMsg( "input error: stream(%d,0x%x) not supported",
|
||||
i,
|
||||
p_info->audio_format.i_formattag );
|
||||
msg_Err( p_input, "stream(%d,0x%x) not supported", i,
|
||||
p_info->audio_format.i_formattag );
|
||||
p_es->i_cat = UNKNOWN_ES;
|
||||
}
|
||||
break;
|
||||
@ -632,15 +625,13 @@ static int AVIInit( input_thread_t *p_input )
|
||||
__AVI_VideoGetType( p_info->video_format.i_compression );
|
||||
if( p_es->i_type == 0 )
|
||||
{
|
||||
intf_ErrMsg( "input error: stream(%d,%4.4s) not supported",
|
||||
i,
|
||||
(char*)&p_info->video_format.i_compression);
|
||||
msg_Err( p_input, "stream(%d,%4.4s) not supported", i,
|
||||
(char*)&p_info->video_format.i_compression);
|
||||
p_es->i_cat = UNKNOWN_ES;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
intf_ErrMsg( "input error: unknown stream(%d) type",
|
||||
i );
|
||||
msg_Err( p_input, "unknown stream(%d) type", i );
|
||||
p_es->i_cat = UNKNOWN_ES;
|
||||
break;
|
||||
}
|
||||
@ -661,14 +652,14 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if( RIFF_AscendChunk(p_input, p_hdrl) != 0)
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot go out (\"hdrl\") (avi_file)" );
|
||||
msg_Err( p_input, "cannot go out (\"hdrl\")" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* go to movi chunk to get it*/
|
||||
if( RIFF_FindListChunk(p_input ,&p_movi,p_riff, FOURCC_movi) != 0 )
|
||||
{
|
||||
intf_ErrMsg( "input error: cannot find \"LIST-movi\" (avi_file)" );
|
||||
msg_Err( p_input, "cannot find \"LIST-movi\"" );
|
||||
__AVIFreeDemuxData( p_input );
|
||||
return( -1 );
|
||||
}
|
||||
@ -684,7 +675,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_WarnMsg( 1, "input init: no index !" );
|
||||
msg_Warn( p_input, "no index!" );
|
||||
}
|
||||
|
||||
|
||||
@ -703,7 +694,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
{
|
||||
case( AUDIO_ES ):
|
||||
if( RIFF_FindChunk( p_input,
|
||||
MAKEFOURCC('0'+i/10, '0'+i%10,'w','b' ),
|
||||
VLC_FOURCC('0'+i/10, '0'+i%10,'w','b' ),
|
||||
p_movi ) == 0)
|
||||
{
|
||||
p_chunk = RIFF_ReadChunk( p_input );
|
||||
@ -712,7 +703,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
|
||||
case( VIDEO_ES ):
|
||||
if( (RIFF_FindChunk( p_input,
|
||||
MAKEFOURCC('0'+i/10, '0'+i%10,'d','c' ),
|
||||
VLC_FOURCC('0'+i/10, '0'+i%10,'d','c' ),
|
||||
p_movi ) == 0) )
|
||||
{
|
||||
p_chunk = RIFF_ReadChunk( p_input );
|
||||
@ -722,7 +713,7 @@ static int AVIInit( input_thread_t *p_input )
|
||||
RIFF_GoToChunk( p_input, p_avi_demux->p_movi );
|
||||
if( RIFF_DescendChunk(p_input) != 0 ) { continue; }
|
||||
if( (RIFF_FindChunk( p_input,
|
||||
MAKEFOURCC('0'+i/10, '0'+i%10,'d','b' ),
|
||||
VLC_FOURCC('0'+i/10, '0'+i%10,'d','b' ),
|
||||
p_movi ) == 0) )
|
||||
{
|
||||
p_chunk = RIFF_ReadChunk( p_input );
|
||||
@ -737,9 +728,8 @@ static int AVIInit( input_thread_t *p_input )
|
||||
index.i_pos = p_chunk->i_pos;
|
||||
index.i_length = p_chunk->i_size;
|
||||
__AVI_AddEntryIndex( p_info, &index );
|
||||
intf_WarnMsg( 3, "input init: add index entry (%4.4s) (%d)",
|
||||
(char*)&p_chunk->i_id,
|
||||
i);
|
||||
msg_Dbg( p_input, "add index entry (%4.4s) (%d)",
|
||||
(char*)&p_chunk->i_id, i );
|
||||
|
||||
}
|
||||
}
|
||||
@ -751,19 +741,19 @@ static int AVIInit( input_thread_t *p_input )
|
||||
if( RIFF_DescendChunk( p_input ) != 0 )
|
||||
{
|
||||
__AVIFreeDemuxData( p_input );
|
||||
intf_ErrMsg( "input error: cannot go in (\"movi\") (avi_file)" );
|
||||
msg_Err( p_input, "cannot go in (\"movi\")" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/* print informations on streams */
|
||||
intf_Msg( "input init: AVIH: %d stream, flags %s%s%s%s%s%s ",
|
||||
p_avi_demux->i_streams,
|
||||
p_avi_demux->avih.i_flags&AVIF_HASINDEX?" HAS_INDEX":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_MUSTUSEINDEX?" MUST_USE_INDEX":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_ISINTERLEAVED?" IS_INTERLEAVED":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_TRUSTCKTYPE?" TRUST_CKTYPE":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_WASCAPTUREFILE?" CAPTUREFILE":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_COPYRIGHTED?" COPYRIGHTED":"" );
|
||||
msg_Dbg( p_input, "AVIH: %d stream, flags %s%s%s%s%s%s ",
|
||||
p_avi_demux->i_streams,
|
||||
p_avi_demux->avih.i_flags&AVIF_HASINDEX?" HAS_INDEX":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_MUSTUSEINDEX?" MUST_USE_INDEX":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_ISINTERLEAVED?" IS_INTERLEAVED":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_TRUSTCKTYPE?" TRUST_CKTYPE":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_WASCAPTUREFILE?" CAPTUREFILE":"",
|
||||
p_avi_demux->avih.i_flags&AVIF_COPYRIGHTED?" COPYRIGHTED":"" );
|
||||
|
||||
for( i = 0; i < p_avi_demux->i_streams; i++ )
|
||||
{
|
||||
@ -771,36 +761,36 @@ static int AVIInit( input_thread_t *p_input )
|
||||
switch( p_info->p_es->i_cat )
|
||||
{
|
||||
case( VIDEO_ES ):
|
||||
intf_Msg("input init: video(%4.4s) %dx%d %dbpp %ffps (size %d)",
|
||||
(char*)&p_info->video_format.i_compression,
|
||||
p_info->video_format.i_width,
|
||||
p_info->video_format.i_height,
|
||||
p_info->video_format.i_bitcount,
|
||||
(float)p_info->header.i_rate /
|
||||
(float)p_info->header.i_scale,
|
||||
p_info->header.i_samplesize );
|
||||
msg_Dbg( p_input, "video(%4.4s) %dx%d %dbpp %ffps (size %d)",
|
||||
(char*)&p_info->video_format.i_compression,
|
||||
p_info->video_format.i_width,
|
||||
p_info->video_format.i_height,
|
||||
p_info->video_format.i_bitcount,
|
||||
(float)p_info->header.i_rate /
|
||||
(float)p_info->header.i_scale,
|
||||
p_info->header.i_samplesize );
|
||||
if( (p_avi_demux->p_info_video == NULL) )
|
||||
{
|
||||
p_avi_demux->p_info_video = p_info;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case( AUDIO_ES ):
|
||||
intf_Msg( "input init: audio(0x%x) %d channels %dHz %dbits %ffps (size %d)",
|
||||
p_info->audio_format.i_formattag,
|
||||
p_info->audio_format.i_channels,
|
||||
p_info->audio_format.i_samplespersec,
|
||||
p_info->audio_format.i_bitspersample,
|
||||
(float)p_info->header.i_rate /
|
||||
(float)p_info->header.i_scale,
|
||||
p_info->header.i_samplesize );
|
||||
msg_Dbg( p_input, "audio(0x%x) %d channels %dHz %dbits %ffps (size %d)",
|
||||
p_info->audio_format.i_formattag,
|
||||
p_info->audio_format.i_channels,
|
||||
p_info->audio_format.i_samplespersec,
|
||||
p_info->audio_format.i_bitspersample,
|
||||
(float)p_info->header.i_rate /
|
||||
(float)p_info->header.i_scale,
|
||||
p_info->header.i_samplesize );
|
||||
if( (p_avi_demux->p_info_audio == NULL) )
|
||||
{
|
||||
p_avi_demux->p_info_audio = p_info;
|
||||
}
|
||||
break;
|
||||
case( UNKNOWN_ES ):
|
||||
intf_Msg( "input init: unhanled stream %d", i );
|
||||
msg_Warn( p_input, "unhandled stream %d", i );
|
||||
}
|
||||
#undef p_info
|
||||
}
|
||||
@ -815,15 +805,16 @@ static int AVIInit( input_thread_t *p_input )
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_Msg( "input error: no video stream found !" );
|
||||
msg_Err( p_input, "no video stream found" );
|
||||
}
|
||||
|
||||
if( p_avi_demux->p_info_audio != NULL )
|
||||
{
|
||||
input_SelectES( p_input, p_avi_demux->p_info_audio->p_es );
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_Msg( "input init: no audio stream found !" );
|
||||
msg_Warn( p_input, "no audio stream found!" );
|
||||
}
|
||||
p_input->stream.p_selected_program->b_is_ok = 1;
|
||||
vlc_mutex_unlock( &p_input->stream.stream_lock );
|
||||
@ -984,7 +975,7 @@ static int __AVI_GoToStreamChunk( input_thread_t *p_input,
|
||||
|
||||
if( !p_input->stream.b_seekable )
|
||||
{
|
||||
intf_ErrMsg( "input error: need the ability to seek in stream" );
|
||||
msg_Err( p_input, "need the ability to seek in stream" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -1033,7 +1024,7 @@ static int __AVI_GoToStreamBytes( input_thread_t *p_input,
|
||||
|
||||
if( !p_input->stream.b_seekable )
|
||||
{
|
||||
intf_ErrMsg( "input error: need the ability to seek in stream" );
|
||||
msg_Err( p_input, "need the ability to seek in stream" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
@ -1506,7 +1497,7 @@ static int AVIDemux( input_thread_t *p_input )
|
||||
|
||||
if( !p_info_master )
|
||||
{
|
||||
intf_ErrMsg( "input error: no stream selected" );
|
||||
msg_Err( p_input, "no stream selected" );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* libioRIFF.c : AVI file Stream input module for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2001 VideoLAN
|
||||
* $Id: libioRIFF.c,v 1.6 2002/05/25 16:23:07 fenrir Exp $
|
||||
* $Id: libioRIFF.c,v 1.7 2002/06/01 12:31:58 sam Exp $
|
||||
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -81,7 +81,7 @@ static int __RIFF_SkipBytes(input_thread_t * p_input,int nb)
|
||||
}
|
||||
else
|
||||
{
|
||||
intf_WarnMsg( 1, "input demux: cannot seek, it will take times" );
|
||||
msg_Warn( p_input, "cannot seek, it will take times" );
|
||||
if( nb < 0 ) { return( -1 ); }
|
||||
i_rest = nb;
|
||||
while (i_rest != 0 )
|
||||
@ -128,6 +128,7 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
|
||||
|
||||
if((p_riff = malloc( sizeof(riffchunk_t))) == NULL)
|
||||
{
|
||||
msg_Err( p_input, "out of memory" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -138,6 +139,7 @@ static riffchunk_t * RIFF_ReadChunk(input_thread_t * p_input)
|
||||
count=input_Peek( p_input, &p_peek, 12 );
|
||||
if( count < 8 )
|
||||
{
|
||||
msg_Err( p_input, "cannot peek()" );
|
||||
free(p_riff);
|
||||
return NULL;
|
||||
}
|
||||
@ -169,6 +171,7 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
|
||||
|
||||
if( ( p_riff = RIFF_ReadChunk( p_input ) ) == NULL )
|
||||
{
|
||||
msg_Err( p_input, "cannot read chunk" );
|
||||
return( -1 );
|
||||
}
|
||||
i_len = p_riff->i_size;
|
||||
@ -180,6 +183,7 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
|
||||
if ( i_lenfather%2 !=0 ) {i_lenfather++;}
|
||||
if ( p_rifffather->i_pos + i_lenfather <= p_riff->i_pos + i_len + 8 )
|
||||
{
|
||||
msg_Err( p_input, "next chunk out of bounds" );
|
||||
free( p_riff );
|
||||
return( 1 ); /* pas dans nos frontiere */
|
||||
}
|
||||
@ -187,6 +191,7 @@ static int RIFF_NextChunk( input_thread_t * p_input,riffchunk_t *p_rifffather)
|
||||
if ( __RIFF_SkipBytes( p_input,i_len + 8 ) != 0 )
|
||||
{
|
||||
free( p_riff );
|
||||
msg_Err( p_input, "cannot go to the next chunk" );
|
||||
return( -1 );
|
||||
}
|
||||
free( p_riff );
|
||||
@ -200,6 +205,7 @@ static int RIFF_DescendChunk(input_thread_t * p_input)
|
||||
{
|
||||
if ( __RIFF_SkipBytes(p_input,12) != 0)
|
||||
{
|
||||
msg_Err( p_input, "cannot go into chunk" );
|
||||
return ( -1 );
|
||||
}
|
||||
return( 0 );
|
||||
@ -223,6 +229,7 @@ static int RIFF_AscendChunk(input_thread_t * p_input ,riffchunk_t *p_rifffather)
|
||||
|
||||
if (( __RIFF_SkipBytes(p_input,i_skip)) != 0)
|
||||
{
|
||||
msg_Err( p_input, "cannot exit from subchunk" );
|
||||
return( -1 );
|
||||
}
|
||||
return( 0 );
|
||||
@ -273,6 +280,7 @@ static int RIFF_LoadChunkData(input_thread_t * p_input,riffchunk_t *p_riff )
|
||||
RIFF_GoToChunkData(p_input);
|
||||
if ( input_SplitBuffer( p_input, &p_riff->p_data, p_riff->i_size ) != p_riff->i_size )
|
||||
{
|
||||
msg_Err( p_input, "cannot read enough data " );
|
||||
return ( -1 );
|
||||
}
|
||||
if ( p_riff->i_size%2 != 0)
|
||||
@ -392,6 +400,7 @@ static int RIFF_TestFileHeader( input_thread_t * p_input, riffchunk_t ** pp_ri
|
||||
|
||||
if( *pp_riff == NULL )
|
||||
{
|
||||
msg_Err( p_input, "cannot retrieve header" );
|
||||
return( -1 );
|
||||
}
|
||||
if( (*pp_riff)->i_id != FOURCC_RIFF )
|
||||
|
@ -2,7 +2,7 @@
|
||||
* InterfaceWindow.cpp: beos interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: InterfaceWindow.cpp,v 1.17 2002/06/01 09:21:59 tcastley Exp $
|
||||
* $Id: InterfaceWindow.cpp,v 1.18 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -37,18 +37,9 @@
|
||||
|
||||
|
||||
/* VLC headers */
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "intf_playlist.h"
|
||||
|
||||
#include "audio_output.h"
|
||||
}
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
#include <vlc/intf.h>
|
||||
|
||||
/* BeOS interface headers */
|
||||
#include "MsgVals.h"
|
||||
@ -71,7 +62,7 @@ InterfaceWindow::InterfaceWindow( BRect frame, const char *name,
|
||||
playlist_window = NULL;
|
||||
p_intf = p_interface;
|
||||
BRect controlRect(0,0,0,0);
|
||||
b_empty_playlist = (p_main->p_playlist->i_size < 0);
|
||||
b_empty_playlist = (p_intf->p_vlc->p_playlist->i_size < 0);
|
||||
|
||||
/* set the title bar */
|
||||
SetName( "interface" );
|
||||
@ -163,6 +154,8 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
int playback_status; // remember playback state
|
||||
int i_index;
|
||||
BAlert *alert;
|
||||
aout_bank_t *p_aout_bank = p_intf->p_vlc->p_aout_bank;
|
||||
input_bank_t *p_input_bank = p_intf->p_vlc->p_input_bank;
|
||||
|
||||
Activate();
|
||||
if (p_input_bank->pp_input[0])
|
||||
@ -224,13 +217,13 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
snprintf( psz_source, B_FILE_NAME_LENGTH + 4,
|
||||
"dvd:%s", psz_device );
|
||||
psz_source[ strlen(psz_source) ] = '\0';
|
||||
intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_source );
|
||||
intf_PlaylistAdd( p_intf->p_vlc->p_playlist, PLAYLIST_END, (char*)psz_source );
|
||||
if( p_input_bank->pp_input[0] != NULL )
|
||||
{
|
||||
p_input_bank->pp_input[0]->b_eof = 1;
|
||||
}
|
||||
intf_PlaylistJumpto( p_main->p_playlist,
|
||||
p_main->p_playlist->i_size - 1 );
|
||||
intf_PlaylistJumpto( p_intf->p_vlc->p_playlist,
|
||||
p_intf->p_vlc->p_playlist->i_size - 1 );
|
||||
b_empty_playlist = false;
|
||||
p_mediaControl->SetEnabled( !b_empty_playlist );
|
||||
}
|
||||
@ -254,10 +247,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
p_input_bank->pp_input[0]->b_eof = 1;
|
||||
|
||||
/* update playlist */
|
||||
vlc_mutex_lock( &p_main->p_playlist->change_lock );
|
||||
p_main->p_playlist->i_index--;
|
||||
p_main->p_playlist->b_stopped = 1;
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
p_intf->p_vlc->p_playlist->i_index--;
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 1;
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
}
|
||||
p_mediaControl->SetStatus(NOT_STARTED_S,DEFAULT_RATE);
|
||||
break;
|
||||
@ -285,9 +278,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
|
||||
/* pause the movie */
|
||||
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
|
||||
vlc_mutex_lock( &p_main->p_playlist->change_lock );
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -305,25 +298,25 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
|
||||
/* Start playing */
|
||||
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Play a new file */
|
||||
vlc_mutex_lock( &p_main->p_playlist->change_lock );
|
||||
if( p_main->p_playlist->b_stopped )
|
||||
vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
if( p_intf->p_vlc->p_playlist->b_stopped )
|
||||
{
|
||||
if( p_main->p_playlist->i_size )
|
||||
if( p_intf->p_vlc->p_playlist->i_size )
|
||||
{
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
intf_PlaylistJumpto( p_main->p_playlist,
|
||||
p_main->p_playlist->i_index );
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
intf_PlaylistJumpto( p_intf->p_vlc->p_playlist,
|
||||
p_intf->p_vlc->p_playlist->i_index );
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -346,9 +339,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
|
||||
/* change the fast play mode */
|
||||
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_FASTER );
|
||||
vlc_mutex_lock( &p_main->p_playlist->change_lock );
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -369,9 +362,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
|
||||
/* change the slower play */
|
||||
input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );
|
||||
vlc_mutex_lock( &p_main->p_playlist->change_lock );
|
||||
p_main->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_main->p_playlist->change_lock );
|
||||
vlc_mutex_lock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
p_intf->p_vlc->p_playlist->b_stopped = 0;
|
||||
vlc_mutex_unlock( &p_intf->p_vlc->p_playlist->change_lock );
|
||||
}
|
||||
break;
|
||||
|
||||
@ -512,14 +505,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
if( p_message->FindRef( "refs", &ref ) == B_OK )
|
||||
{
|
||||
BPath path( &ref );
|
||||
intf_PlaylistAdd( p_main->p_playlist,
|
||||
intf_PlaylistAdd( p_intf->p_vlc->p_playlist,
|
||||
PLAYLIST_END, (char*)path.Path() );
|
||||
if( p_input_bank->pp_input[0] != NULL )
|
||||
{
|
||||
p_input_bank->pp_input[0]->b_eof = 1;
|
||||
}
|
||||
intf_PlaylistJumpto( p_main->p_playlist,
|
||||
p_main->p_playlist->i_size - 1 );
|
||||
intf_PlaylistJumpto( p_intf->p_vlc->p_playlist,
|
||||
p_intf->p_vlc->p_playlist->i_size - 1 );
|
||||
|
||||
}
|
||||
}
|
||||
@ -537,13 +530,15 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
|
||||
*****************************************************************************/
|
||||
void InterfaceWindow::updateInterface()
|
||||
{
|
||||
input_bank_t *p_input_bank = p_intf->p_vlc->p_input_bank;
|
||||
|
||||
if ( p_input_bank->pp_input[0] )
|
||||
{
|
||||
if ( acquire_sem(p_mediaControl->fScrubSem) == B_OK )
|
||||
{
|
||||
uint64 seekTo = (p_mediaControl->GetSeekTo() *
|
||||
p_input_bank->pp_input[0]->stream.p_selected_area->i_size) / 100;
|
||||
input_Seek( p_input_bank->pp_input[0], seekTo);
|
||||
input_Seek( p_input_bank->pp_input[0]->p_this, seekTo, INPUT_SEEK_SET );
|
||||
}
|
||||
else if( Lock() )
|
||||
{
|
||||
@ -554,7 +549,7 @@ void InterfaceWindow::updateInterface()
|
||||
Unlock();
|
||||
}
|
||||
}
|
||||
if ( b_empty_playlist != (p_main->p_playlist->i_size < 1) )
|
||||
if ( b_empty_playlist != (p_intf->p_vlc->p_playlist->i_size < 1) )
|
||||
{
|
||||
if (Lock())
|
||||
{
|
||||
@ -570,7 +565,7 @@ void InterfaceWindow::updateInterface()
|
||||
*****************************************************************************/
|
||||
bool InterfaceWindow::QuitRequested()
|
||||
{
|
||||
p_intf->b_die = 1;
|
||||
p_intf->p_vlc->b_die = 1;
|
||||
|
||||
return( true );
|
||||
}
|
||||
@ -697,6 +692,7 @@ int LanguageMenu::GetChannels()
|
||||
BMessage *msg;
|
||||
int i;
|
||||
es_descriptor_t *p_es = NULL;
|
||||
input_bank_t *p_input_bank = p_intf->p_vlc->p_input_bank;
|
||||
|
||||
/* Insert the null */
|
||||
if( kind == AUDIO_ES ) //audio
|
||||
|
@ -2,7 +2,7 @@
|
||||
* MediaControlView.cpp: beos interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: MediaControlView.cpp,v 1.7 2001/12/30 07:09:54 sam Exp $
|
||||
* $Id: MediaControlView.cpp,v 1.8 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Tony Castley <tony@castley.net>
|
||||
*
|
||||
@ -27,16 +27,8 @@
|
||||
#include <string.h>
|
||||
|
||||
/* VLC headers */
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "intf_playlist.h"
|
||||
}
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/intf.h>
|
||||
|
||||
/* BeOS interface headers */
|
||||
#include "MsgVals.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
* PlayListWindow.cpp: beos interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: PlayListWindow.cpp,v 1.6 2002/06/01 08:54:08 tcastley Exp $
|
||||
* $Id: PlayListWindow.cpp,v 1.7 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -30,16 +30,8 @@
|
||||
#include <string.h>
|
||||
|
||||
/* VLC headers */
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
#include "input_ext-intf.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "intf_playlist.h"
|
||||
}
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/intf.h>
|
||||
|
||||
/* BeOS interface headers */
|
||||
#include "InterfaceWindow.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
* VideoWindow.h: BeOS video window class prototype
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: VideoWindow.h,v 1.20 2002/06/01 08:54:08 tcastley Exp $
|
||||
* $Id: VideoWindow.h,v 1.21 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Tony Castley <tcastley@mail.powerup.com.au>
|
||||
@ -91,7 +91,7 @@ public:
|
||||
int colspace_index;
|
||||
|
||||
private:
|
||||
struct vout_thread_s *p_vout;
|
||||
vout_thread_t *p_vout;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* aout_beos.cpp: BeOS audio output
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: aout_beos.cpp,v 1.23 2002/02/24 22:06:50 sam Exp $
|
||||
* $Id: aout_beos.cpp,v 1.24 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -39,9 +39,8 @@
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "audio_output.h"
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/aout.h>
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -50,15 +49,14 @@ extern "C"
|
||||
* This structure is part of the audio output thread descriptor.
|
||||
* It describes some BeOS specific variables.
|
||||
*****************************************************************************/
|
||||
typedef struct aout_sys_s
|
||||
struct aout_sys_s
|
||||
{
|
||||
BPushGameSound * p_sound;
|
||||
gs_audio_format * p_format;
|
||||
void * p_buffer;
|
||||
int i_buffer_size;
|
||||
int i_buffer_pos;
|
||||
|
||||
} aout_sys_t;
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@ -95,7 +93,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
|
||||
if( p_aout->p_sys == NULL )
|
||||
{
|
||||
intf_ErrMsg("error: %s", strerror(ENOMEM) );
|
||||
msg_Err( p_aout, "out of memory" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -104,7 +102,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
if( p_aout->p_sys->p_format == NULL )
|
||||
{
|
||||
free( p_aout->p_sys );
|
||||
intf_ErrMsg("error: cannot allocate memory for gs_audio_format" );
|
||||
msg_Err( p_aout, "out of memory" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -124,7 +122,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
free( p_aout->p_sys->p_format );
|
||||
free( p_aout->p_sys );
|
||||
intf_ErrMsg("error: cannot allocate memory for BPushGameSound" );
|
||||
msg_Err( p_aout, "cannot allocate BPushGameSound" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -132,7 +130,7 @@ static int aout_Open( aout_thread_t *p_aout )
|
||||
{
|
||||
free( p_aout->p_sys->p_format );
|
||||
free( p_aout->p_sys );
|
||||
intf_ErrMsg("error: cannot allocate memory for BPushGameSound" );
|
||||
msg_Err( p_aout, "cannot initialize BPushGameSound" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* beos.cpp : BeOS plugin for vlc
|
||||
*****************************************************************************
|
||||
* Copyright (C) 2000, 2001 VideoLAN
|
||||
* $Id: beos.cpp,v 1.18 2002/04/19 13:56:10 sam Exp $
|
||||
* $Id: beos.cpp,v 1.19 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -28,10 +28,10 @@
|
||||
#include <stdlib.h> /* malloc(), free() */
|
||||
#include <string.h>
|
||||
|
||||
#include <vlc/vlc.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
/*****************************************************************************
|
||||
* Capabilities defined in the other files.
|
||||
*****************************************************************************/
|
||||
@ -50,7 +50,6 @@ MODULE_INIT_START
|
||||
ADD_CAPABILITY( INTF, 100 )
|
||||
ADD_CAPABILITY( VOUT, 100 )
|
||||
ADD_CAPABILITY( AOUT, 100 )
|
||||
ADD_SHORTCUT( "beos" )
|
||||
MODULE_INIT_STOP
|
||||
|
||||
MODULE_ACTIVATE_START
|
||||
|
@ -2,7 +2,7 @@
|
||||
* intf_beos.cpp: beos interface
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1999, 2000, 2001 VideoLAN
|
||||
* $Id: intf_beos.cpp,v 1.38 2002/02/15 13:32:52 sam Exp $
|
||||
* $Id: intf_beos.cpp,v 1.39 2002/06/01 12:31:58 sam Exp $
|
||||
*
|
||||
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
|
||||
* Samuel Hocevar <sam@zoy.org>
|
||||
@ -32,26 +32,19 @@
|
||||
#include <InterfaceKit.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <videolan/vlc.h>
|
||||
|
||||
#include "stream_control.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "input_ext-intf.h"
|
||||
}
|
||||
#include <vlc/vlc.h>
|
||||
#include <vlc/intf.h>
|
||||
|
||||
#include "InterfaceWindow.h"
|
||||
|
||||
/*****************************************************************************
|
||||
* intf_sys_t: description and status of FB interface
|
||||
*****************************************************************************/
|
||||
typedef struct intf_sys_s
|
||||
struct intf_sys_s
|
||||
{
|
||||
InterfaceWindow * p_window;
|
||||
char i_key;
|
||||
} intf_sys_t;
|
||||
};
|
||||
|
||||
|
||||
extern "C"
|
||||
@ -93,7 +86,7 @@ static int intf_Open( intf_thread_t *p_intf )
|
||||
p_intf->p_sys = (intf_sys_t*) malloc( sizeof( intf_sys_t ) );
|
||||
if( p_intf->p_sys == NULL )
|
||||
{
|
||||
intf_ErrMsg("error: %s", strerror(ENOMEM));
|
||||
msg_Err( p_intf, "out of memory" );
|
||||
return( 1 );
|
||||
}
|
||||
p_intf->p_sys->i_key = -1;
|
||||
@ -105,7 +98,7 @@ static int intf_Open( intf_thread_t *p_intf )
|
||||
if( p_intf->p_sys->p_window == 0 )
|
||||
{
|
||||
free( p_intf->p_sys );
|
||||
intf_ErrMsg( "error: cannot allocate memory for InterfaceWindow" );
|
||||
msg_Err( p_intf, "cannot allocate InterfaceWindow" );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
@ -132,13 +125,13 @@ static void intf_Close( intf_thread_t *p_intf )
|
||||
static void intf_Run( intf_thread_t *p_intf )
|
||||
{
|
||||
|
||||
while( !p_intf->b_die )
|
||||
while( !p_intf->p_vlc->b_die )
|
||||
{
|
||||
/* Manage core vlc functions through the callback */
|
||||
p_intf->pf_manage( p_intf );
|
||||
|
||||
/* Manage the slider */
|
||||
if( p_input_bank->pp_input[0] != NULL
|
||||
if( p_intf->p_vlc->p_input_bank->pp_input[0] != NULL
|
||||
&& p_intf->p_sys->p_window != NULL)
|
||||
{
|
||||
p_intf->p_sys->p_window->updateInterface();
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user