[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[58] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2010-01-01 15:53:31
|
Revision: 58 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=58&view=rev Author: nickols_k Date: 2010-01-01 15:53:19 +0000 (Fri, 01 Jan 2010) Log Message: ----------- compile all internal stuff statically Modified Paths: -------------- DOCS/Makefile DOCS/configure Makefile configure etc/Makefile etc/configure functions mplayerxp/Makefile mplayerxp/configure mplayerxp/libmpcodecs/Makefile mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad_a52.c mplayerxp/libmpcodecs/ad_acm.c mplayerxp/libmpcodecs/ad_dca.c mplayerxp/libmpcodecs/ad_dshow.c mplayerxp/libmpcodecs/ad_ffmp3.c mplayerxp/libmpcodecs/ad_hwac3.c mplayerxp/libmpcodecs/ad_mp3.c mplayerxp/libmpcodecs/ad_twin.c mplayerxp/libmpcodecs/ad_vorbis.c mplayerxp/libmpcodecs/codecs_ld.c mplayerxp/libmpcodecs/codecs_ld.h mplayerxp/libmpcodecs/vd.c mplayerxp/libmpcodecs/vd_divx4.c mplayerxp/libmpcodecs/vd_dshow.c mplayerxp/libmpcodecs/vd_ffmpeg.c mplayerxp/libmpcodecs/vd_libmpeg2.c mplayerxp/libmpcodecs/vd_theora.c mplayerxp/libmpcodecs/vd_vfw.c mplayerxp/libmpcodecs/vd_xvid.c mplayerxp/libmpdemux/Makefile mplayerxp/libmpdemux/demux_avi.c mplayerxp/libmpdemux/demux_lavf.c mplayerxp/libmpdemux/demux_ogg.c mplayerxp/libmpdemux/demux_vqf.c mplayerxp/libmpdemux/demuxer.c mplayerxp/libmpdemux/mux_lavf.c mplayerxp/libmpdemux/s_ffmpeg.c mplayerxp/libvo/img_format.c mplayerxp/loader/dmo/DMO_AudioDecoder.c mplayerxp/loader/dmo/DMO_VideoDecoder.c mplayerxp/loader/dmo/dmo.c mplayerxp/loader/dshow/DS_AudioDecoder.c mplayerxp/loader/dshow/DS_Filter.c mplayerxp/loader/dshow/DS_VideoDecoder.c mplayerxp/loader/dshow/Makefile mplayerxp/loader/dshow/allocator.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/postprocess.c mplayerxp/postproc/postprocess.h mplayerxp/postproc/swscale.c Removed Paths: ------------- codecs/ mplayerxp/libmpcodecs/interface/ Property Changed: ---------------- / Property changes on: ___________________________________________________________________ Added: svn:externals + ffmpeg -r 20740 svn://svn.ffmpeg.org/ffmpeg/trunk Modified: DOCS/Makefile =================================================================== --- DOCS/Makefile 2010-01-01 09:48:37 UTC (rev 57) +++ DOCS/Makefile 2010-01-01 15:53:19 UTC (rev 58) @@ -8,7 +8,7 @@ all: clean: distclean: - rm -f config.mak + rm -f config.mak configure.log install: $(INSTALL) -D -c -m 644 mplayerxp.1 $(DESTDIR)$(MANDIR)/man1/$(PROGNAME).1 uninstall: Modified: DOCS/configure =================================================================== --- DOCS/configure 2010-01-01 09:48:37 UTC (rev 57) +++ DOCS/configure 2010-01-01 15:53:19 UTC (rev 58) @@ -1,74 +1,107 @@ #!/bin/sh # The simplest configure for win loader -for parm in "$@" ; do - if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then - cat << EOF +. ../functions +init_functions -Usage: $0 [OPTIONS]... -Configuration: - -h, --help display this help and exit +PATH_LIST=( + "prefix|architecture-independent files|/usr/local", + "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", + "confdir|read-only configuration files|\$prefix/share/mplayerxp" +) -Installation directories: - --prefix=DIR use this prefix for installing mplayer [/usr/local] +PROGNAME_LIST=( + "program_prefix|prepend PREFIX to installed program names", + "program_suffix|append SUFFIX to installed program names", + "program_transform_name|use TRANSFORM_NAME as program name|mplayerxp" +) -Fine tuning of the installation directories: - --datadir=DIR use this prefix for installing machine independent - data files (fonts, skins) [PREFIX/share/mplayer] - --confdir=DIR use this prefix for installing configuration files - [same as datadir] -Program names: - --program-suffix=SUFX append SUFX to installed program names +SYSTYPES_LIST=( + "build|configure for building on BUILD [guessed]", + "host|cross-compile to build program to run on HOST [BUILD]", + "install|use this INSTALL to install PROGRAM|install", + "pkg_config|use this PKG-CONFIG to configure PROGRAM|pkg-config" +) -Environment variables: - DESTDIR specifies base of installation +SYSCONF_LIST=( + "SYSTYPES_LIST", + "PROGNAME_LIST", + "PATH_LIST" +) -EOF - exit 0 - fi -done # for parm in ... +ENVIRONMENT_LIST=( + "MAKE|Make command (example: 'make -j')|make", + "DESTDIR|specifies base of installation" +) +HELP_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "PROGNAME_LIST|Program names|--", + "SYSTYPES_LIST|System types|--", + "ENVIRONMENT_LIST|Environment variables| " +) -# LGB: temporary files -for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$I" && break -done +DEFAULT_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "SYSTYPES_LIST|System types|--", + "PROGNAME_LIST|Program names|--" +) -TMPLOG="configure.log" -rm -f "$TMPLOG" -TMPC="$I/mplayerxp-conf-$RANDOM-$$.c" -TMPCPP="$I/mplayerxp-conf-$RANDOM-$$.cpp" -TMPO="$I/mplayerxp-conf-$RANDOM-$$.o" -TMPS="$I/mplayerxp-conf-$RANDOM-$$.S" +make_defaults "DEFAULT_LIST" +make_environment "ENVIRONMENT_LIST" -prefix="/usr/local" -psuffix= for ac_option do + optval="${ac_option#*=}" case "$ac_option" in - --prefix=*) - prefix=`echo $ac_option | cut -d '=' -f 2` + --help) + print_help "HELP_LIST" + exit 0 ;; - --datadir=*) - datadir=`echo $ac_option | cut -d '=' -f 2` + --enable-*=*|--disable-*=*) + eval $(echo "${ac_option%%=*}" | sed 's/--/action=/;s/-/ thing=/') + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" + if test "$action" = "disable"; then + test "${optval}" = "no" && action=enable + else + test "${optval}" = "no" && action=disable + fi + echo "$action ${thing}" + $action ${thing} ;; - --confdir=*) - confdir=`echo $ac_option | cut -d '=' -f 2` + + --enable-?*|--disable-?*) + eval $(echo "$ac_option" | sed 's/--/action=/;s/-/ thing=/;s/-/_/g') + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" + $action ${thing} ;; - --program-suffix=*) - psuffix=`echo $ac_option | cut -d '=' -f 2` + *) + optname="${ac_option%%=*}" + optname="${optname#--}" + optname=${optname//-/_} + if in_list "SYSCONF_LIST" $optname ; then + eval $optname=$optval + else + bad_options="$ac_option $bad_options" + fi ;; - *) - ;; esac done -prog_alias="mplayerxp$psuffix" +mktmps -# Atmos: moved this here, to be correct, if --prefix is specified -test -z "$_datadir" && datadir="$prefix/share/$prog_alias" -test -z "$_confdir" && confdir="$datadir" +echocheck "Program name" +prog_alias=$program_transform_name +prog_alias="$program_prefix$prog_alias$program_suffix" +echores "$prog_alias" +if cygwin ; then +# Keep everything in .exe folder +test -z "$datadir" && datadir="." +test -z "$confdir" && confdir="." +test -z "$libdir" && libdir="." +fi + ############################################################################# echo "Creating config.mak" cat > config.mak << EOF Modified: Makefile =================================================================== --- Makefile 2010-01-01 09:48:37 UTC (rev 57) +++ Makefile 2010-01-01 15:53:19 UTC (rev 58) @@ -1,4 +1,4 @@ -SUBDIRS = codecs loader mplayerxp etc DOCS +SUBDIRS = ffmpeg mplayerxp etc DOCS DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done Modified: configure =================================================================== --- configure 2010-01-01 09:48:37 UTC (rev 57) +++ configure 2010-01-01 15:53:19 UTC (rev 58) @@ -9,7 +9,7 @@ fi done # for parm in ... -for i in codecs etc DOCS mplayerxp ; do +for i in etc DOCS mplayerxp ; do echo Entering \'"$i"\' directory cd $i ./configure "$@" Modified: etc/Makefile =================================================================== --- etc/Makefile 2010-01-01 09:48:37 UTC (rev 57) +++ etc/Makefile 2010-01-01 15:53:19 UTC (rev 58) @@ -6,7 +6,7 @@ all: clean: distclean: - rm -f config.mak + rm -f config.mak configure.log install: $(INSTALL) -D -b -c -m 644 codecs.conf $(CONFDIR)/codecs.conf $(INSTALL) -D -b -c -m 644 menu.conf $(CONFDIR)/menu.conf Modified: etc/configure =================================================================== --- etc/configure 2010-01-01 09:48:37 UTC (rev 57) +++ etc/configure 2010-01-01 15:53:19 UTC (rev 58) @@ -1,71 +1,107 @@ #!/bin/sh # The simplest configure for win loader -for parm in "$@" ; do - if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then - cat << EOF +. ../functions +init_functions -Usage: $0 [OPTIONS]... -Configuration: - -h, --help display this help and exit +PATH_LIST=( + "prefix|architecture-independent files|/usr/local", + "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", + "confdir|read-only configuration files|\$prefix/share/mplayerxp" +) -Installation directories: - --prefix=DIR use this prefix for installing mplayer [/usr/local] +PROGNAME_LIST=( + "program_prefix|prepend PREFIX to installed program names", + "program_suffix|append SUFFIX to installed program names", + "program_transform_name|use TRANSFORM_NAME as program name|mplayerxp" +) -Fine tuning of the installation directories: - --datadir=DIR use this prefix for installing machine independent - data files (fonts, skins) [PREFIX/share/mplayer] - --confdir=DIR use this prefix for installing configuration files - [same as datadir] +SYSTYPES_LIST=( + "build|configure for building on BUILD [guessed]", + "host|cross-compile to build program to run on HOST [BUILD]", + "install|use this INSTALL to install PROGRAM|install", + "pkg_config|use this PKG-CONFIG to configure PROGRAM|pkg-config" +) -Program names: - --program-suffix=SUFX append SUFX to installed program names +SYSCONF_LIST=( + "SYSTYPES_LIST", + "PROGNAME_LIST", + "PATH_LIST" +) -EOF - exit 0 - fi -done # for parm in ... +ENVIRONMENT_LIST=( + "MAKE|Make command (example: 'make -j')|make", + "DESTDIR|specifies base of installation" +) +HELP_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "PROGNAME_LIST|Program names|--", + "SYSTYPES_LIST|System types|--", + "ENVIRONMENT_LIST|Environment variables| " +) -# LGB: temporary files -for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$I" && break -done +DEFAULT_LIST=( + "PATH_LIST|Fine tuning of the installation directories|--", + "SYSTYPES_LIST|System types|--", + "PROGNAME_LIST|Program names|--" +) -TMPLOG="configure.log" -rm -f "$TMPLOG" -TMPC="$I/mplayerxp-conf-$RANDOM-$$.c" -TMPCPP="$I/mplayerxp-conf-$RANDOM-$$.cpp" -TMPO="$I/mplayerxp-conf-$RANDOM-$$.o" -TMPS="$I/mplayerxp-conf-$RANDOM-$$.S" +make_defaults "DEFAULT_LIST" +make_environment "ENVIRONMENT_LIST" -prefix="/usr/local" -psuffix= for ac_option do + optval="${ac_option#*=}" case "$ac_option" in - --prefix=*) - prefix=`echo $ac_option | cut -d '=' -f 2` + --help) + print_help "HELP_LIST" + exit 0 ;; - --datadir=*) - datadir=`echo $ac_option | cut -d '=' -f 2` + --enable-*=*|--disable-*=*) + eval $(echo "${ac_option%%=*}" | sed 's/--/action=/;s/-/ thing=/') + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" + if test "$action" = "disable"; then + test "${optval}" = "no" && action=enable + else + test "${optval}" = "no" && action=disable + fi + echo "$action ${thing}" + $action ${thing} ;; - --confdir=*) - confdir=`echo $ac_option | cut -d '=' -f 2` + + --enable-?*|--disable-?*) + eval $(echo "$ac_option" | sed 's/--/action=/;s/-/ thing=/;s/-/_/g') + in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" + $action ${thing} ;; - --program-suffix=*) - psuffix=`echo $ac_option | cut -d '=' -f 2` + *) + optname="${ac_option%%=*}" + optname="${optname#--}" + optname=${optname//-/_} + if in_list "SYSCONF_LIST" $optname ; then + eval $optname=$optval + else + bad_options="$ac_option $bad_options" + fi ;; - *) - ;; esac done -prog_alias="mplayerxp$psuffix" -# Atmos: moved this here, to be correct, if --prefix is specified -test -z "$_datadir" && datadir="$prefix/share/$prog_alias" -test -z "$_confdir" && confdir="$datadir" +mktmps +echocheck "Program name" +prog_alias=$program_transform_name +prog_alias="$program_prefix$prog_alias$program_suffix" +echores "$prog_alias" + +if cygwin ; then +# Keep everything in .exe folder +test -z "$datadir" && datadir="." +test -z "$confdir" && confdir="." +test -z "$libdir" && libdir="." +fi + ############################################################################# echo "Creating config.mak" cat > config.mak << EOF @@ -74,6 +110,7 @@ prefix = $prefix DATADIR = $datadir CONFDIR = $confdir +DESTDIR = $DESTDIR EOF Modified: functions =================================================================== --- functions 2010-01-01 09:48:37 UTC (rev 57) +++ functions 2010-01-01 15:53:19 UTC (rev 58) @@ -1374,3 +1374,21 @@ disable_list(){ set_list $1 no } + +check_pkg(){ + name=$1 + package=$2 + answer="no" + echocheck $name + $pkg_config --exists $package + test "$?" -ne 0 && disable $name + if enabled $name ; then + version=`echo $($pkg_config $package --modversion)` + log "found version: $version of $package" + check_cflags $($pkg_config $package --cflags) || disable $name + check_ldflags $($pkg_config $package --libs) || disable $name + answer=`echo "yes ($version)"` + fi + log "pkg-config --exists $package = $answer" + echores $answer +} Modified: mplayerxp/Makefile =================================================================== --- mplayerxp/Makefile 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/Makefile 2010-01-01 15:53:19 UTC (rev 58) @@ -28,6 +28,12 @@ OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o) +FF_LIBS = ../ffmpeg/libavcodec/libavcodec.a \ + ../ffmpeg/libswscale/libswscale.a \ + ../ffmpeg/libpostproc/libpostproc.a \ + ../ffmpeg/libavformat/libavformat.a \ + ../ffmpeg/libavutil/libavutil.a + MP_LIBS = libmpdemux/libmpdemux.a \ libmpcodecs/libmpcodecs.a \ libao2/libao2.a \ @@ -40,7 +46,7 @@ MP_LIBS += loader/libloader.a endif -COMMON_LIBS = $(MP_LIBS) $(EXTRALIBS) -lm +COMMON_LIBS = $(MP_LIBS) $(FF_LIBS) $(EXTRALIBS) -lm CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Ilibvo $(EXTRA_INC) ALL_PRG = $(PRG) Modified: mplayerxp/configure =================================================================== --- mplayerxp/configure 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/configure 2010-01-01 15:53:19 UTC (rev 58) @@ -81,7 +81,10 @@ "libcss|build with libcss support", "libdvdread|build with libdvdread support", "libdvdnav|build with libdvdnav support", - "libvcd|build with libvcd support" + "libvcd|build with libvcd support", + "libvorbis|build with libvorbis support", + "libtheora|build with libtheora support", + "libbz2|build with libbz2 support" ) DISABLED_LIST=( "gcov|compile gnu coverage information into PROGRAM", @@ -101,7 +104,6 @@ "libdir|object code libraries|\$exec_prefix/lib", "datadir|read-only architecture-independent data|\$prefix/share/mplayerxp", "confdir|read-only configuration files|\$prefix/share/mplayerxp", - "codecdir|codec's shared libraries|\$libdir/mplayerxp", "win32libdir|win32 .dll locations [/usr/lib/win32]" ) @@ -198,7 +200,6 @@ --enable-?*|--disable-?*) eval $(echo "$ac_option" | sed 's/--/action=/;s/-/ thing=/;s/-/_/g') in_list "AUTOCONF_LIST" ${thing} || bad_options="$ac_option $bad_options" -# echo "$action ${thing}" $action ${thing} ;; *) @@ -206,11 +207,9 @@ optname="${optname#--}" optname=${optname//-/_} if in_list "SYSCONF_LIST" $optname ; then -# echo "eval $optname=$optval" eval $optname=$optval elif in_list "ADD_LIST" $optname ; then action="add_$optname" -# echo "$action ${optval}" $action ${optval} else bad_options="$ac_option $bad_options" @@ -311,13 +310,9 @@ test -z "$datadir" && datadir="." test -z "$confdir" && confdir="." test -z "$libdir" && libdir="." -test -z "$codecdir" && codecdir="." -else -codecdir="$libdir/$prog_alias" fi srcdir=`pwd` - #checking for pkg-config test $($pkg_config --version 2>/dev/null) || die "no pkg-config found" @@ -354,10 +349,26 @@ disable ffmpeg # Checking for FFMPEG -test -f "../codecs/ffmpeg/libavcodec/avcodec.h" && enable ffmpeg +test -f "../ffmpeg/libavcodec/avcodec.h" && enable ffmpeg disabled ffmpeg && die "**FATAL**: local copy of libavcodec doesn't exist! Please use latest svn to checkout external repository in mplayerxp source tree." -add_cflags "-I$srcdir/../codecs/ffmpeg" +add_cflags "-I$srcdir/../ffmpeg" print_config HAVE_ mp_config.h mp_config.mak ffmpeg +# Configuring external ffmpeg stuff +ffmpeg_args="--enable-static --disable-shared --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-postproc --enable-gpl --enable-pthreads" +if test -n $host ; then +_arch=$host_arch +x86_32 && _arch="x86_32" +x86_64 && _arch="x86_64" +ffmpeg_args="--arch=$arch $ffmpeg_args" +fi +test "$debug" -gt "0" && ffmpeg_args="$ffmpeg_args --enable-debug=$debug" +enabled $profile && ffmpeg_args="$ffmpeg_args --enable-profile" +echocheck "configuring ffmpeg stuff: --cc=\"$cc\" $ffmpeg_args" +cd ../ffmpeg +$(LC_ALL=C ./configure --cc="$cc" $ffmpeg_args) +cd $srcdir +echores "done" +################################### check_header inttypes.h || die "cannot find header inttypes.h (see in DOC/faq.html)" @@ -544,8 +555,7 @@ ######### # VIDEO # ######### -enabled x11 && check_cflags $($pkg_config x11 --cflags) && add_cflags $($pkg_config x11 --cflags) || disable x11 -enabled x11 && check_ldflags $($pkg_config x11 --libs) && add_extralibs $($pkg_config x11 --libs) || disable x11 +check_pkg x11 x11 enabled x11 && require2 x11 "X11/Xlib.h X11/Xutil.h" XCreateWindow -lXext print_config HAVE_ mp_config.h mp_config.mak x11 enabled x11 && vomodules="x11 $vomodules" || novomodules="x11 $novomodules" @@ -619,8 +629,7 @@ # VIDEO + AUDIO # ################# -enabled sdl && check_cflags $($pkg_config sdl --cflags) && add_cflags $($pkg_config sdl --cflags) || disable sdl -enabled sdl && check_ldflags $($pkg_config sdl --libs) && add_extralibs $($pkg_config sdl --libs) || disable sdl +check_pkg sdl sdl enabled sdl && require2 sdl SDL/SDL.h SDL_CreateYUVOverlay print_config HAVE_ mp_config.h mp_config.mak sdl if enabled sdl; then @@ -666,8 +675,7 @@ print_config HAVE_ mp_config.h mp_config.mak arts enabled arts && aomodules="arts $aomodules" || noaomodules="arts $noaomodules" -enabled esd && check_cflags $($pkg_config esound --cflags) && add_cflags $($pkg_config esound --cflags) || disable esd -enabled esd && check_ldflags $($pkg_config esound --libs) && add_extralibs $($pkg_config esound --libs) || disable esd +check_pkg esd esound enabled esd && require2 esd esd.h esd_open_sound print_config HAVE_ mp_config.h mp_config.mak esd enabled esd && aomodules="esd $aomodules" || noaomodules="esd $noaomodules" @@ -680,8 +688,7 @@ print_config HAVE_ mp_config.h mp_config.mak nas enabled nas && aomodules="nas $aomodules" || noaomodules="nas $noaomodules" -enabled jack && check_cflags $($pkg_config jack --cflags) && add_cflags $($pkg_config jack --cflags) || disable jack -enabled jack && check_ldflags $($pkg_config jack --libs) && add_extralibs $($pkg_config jack --libs) || disable jack +check_pkg jack jack enabled jack && require2 jack jack/jack.h jack_client_open print_config HAVE_ mp_config.h mp_config.mak jack enabled jack && aomodules="jack $aomodules" || noaomodules="jack $noaomodules" @@ -716,6 +723,17 @@ print_config HAVE_ mp_config.h mp_config.mak audio_select +enabled libvorbis && check_pkg libvorbis vorbis +print_config HAVE_ mp_config.h mp_config.mak libvorbis +enabled libvorbis && inputmodules="vorbis $inputmodules" || noinputmodules="vorbis $noinputmodules" + +enabled libtheora && check_pkg libtheora theora +print_config HAVE_ mp_config.h mp_config.mak libtheora +enabled libtheora && inputmodules="theora $inputmodules" || noinputmodules="theora $noinputmodules" + +enabled libbz2 && require2 libbz2 bzlib.h BZ2_bzlibVersion -lbz2 || disable libbz2 +print_config HAVE_ mp_config.h mp_config.mak libbz2 + CFLAGS="$CFLAGS -W -Wall" # Thread support if linux ; then @@ -755,7 +773,6 @@ DATADIR = $datadir CONFDIR = $confdir LIBDIR = $libdir -CODECDIR = $codecdir DESTDIR = $DESTDIR PROGNAME = $prog_alias AR = ar @@ -797,7 +814,6 @@ #define DATADIR "$datadir" #define CONFDIR "$confdir" #define LIBDIR "$libdir" -#define CODECDIR "$codecdir" /* Define this to enable avg. byte/sec-based AVI sync method by default: (use -bps or -nobps commandline option for run-time method selection) Modified: mplayerxp/libmpcodecs/Makefile =================================================================== --- mplayerxp/libmpcodecs/Makefile 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/Makefile 2010-01-01 15:53:19 UTC (rev 58) @@ -1,7 +1,7 @@ include ../mp_config.mak LIBNAME = libmpcodecs.a -SUBDIRS = libnuppelvideo +SUBDIRS = libnuppelvideo liba52 libdca DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@ || exit; done DO_ALL = @ for i in $(SUBDIRS); do $(MAKE) -C $$i all || exit; done @@ -24,15 +24,20 @@ ad_null.c \ ad_ffmp3.c \ ad_mp3.c \ - ad_a52.c \ - ad_dca.c \ ad_hwac3.c \ ad_pcm.c \ ad_dvdpcm.c \ - ad_vorbis.c \ ad_real.c \ ad_faad.c \ + ad_a52.c \ + ad_dca.c \ codecs_ld.c +ifeq ($(HAVE_LIBVORBIS),yes) +SRCS+=ad_vorbis.c +endif +ifeq ($(HAVE_LIBTHEORA),yes) +SRCS+=vd_theora.c +endif ifeq ($(HAVE_WIN32LOADER),yes) SRCS+=vd_dshow.c \ @@ -64,7 +69,9 @@ $(LIBNAME): $(SUBDIRS) $(OBJS) $(AR) r $(LIBNAME) $(OBJS) \ - $(wildcard libnuppelvideo/*.o) + $(wildcard libnuppelvideo/*.o) \ + $(wildcard liba52/*.o) \ + $(wildcard libdca/*.o) clean: Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad.c 2010-01-01 15:53:19 UTC (rev 58) @@ -43,7 +43,9 @@ &mpcodecs_ad_pcm, &mpcodecs_ad_dvdpcm, &mpcodecs_ad_faad, +#ifdef HAVE_LIBVORBIS &mpcodecs_ad_vorbis, +#endif &mpcodecs_ad_real, #ifdef HAVE_WIN32LOADER &mpcodecs_ad_dshow, Modified: mplayerxp/libmpcodecs/ad_a52.c =================================================================== --- mplayerxp/libmpcodecs/ad_a52.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_a52.c 2010-01-01 15:53:19 UTC (rev 58) @@ -11,9 +11,9 @@ #include "help_mp.h" #include "cpudetect.h" -#include "interface/a52.h" #include "../mm_accel.h" #include "../mplayer.h" +#include "liba52/a52.h" #include "ad_a52.h" #include "libao2/afmt.h" #include "libao2/audio_out.h" @@ -41,60 +41,6 @@ LIBAD_EXTERN(a52) -static int (*a52_syncinfo_ptr) (uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate); -#define a52_syncinfo(a,b,c,d) (*a52_syncinfo_ptr)(a,b,c,d) -static uint16_t (*crc16_block_ptr)(uint8_t *data,uint32_t num_bytes); -#define crc16_block(a,b) (*crc16_block_ptr)(a,b) -static a52_state_t * (*a52_init_ptr) (uint32_t mm_accel); -#define a52_init(a) (*a52_init_ptr)(a) -static int (*a52_frame_ptr)(a52_state_t * state, uint8_t * buf, int * flags, - sample_t * level, sample_t bias); -#define a52_frame(a,b,c,d,e) (*a52_frame_ptr)(a,b,c,d,e) - -static int (*a52_block_ptr) (a52_state_t * state); -#define a52_block(a) (*a52_block_ptr)(a) - -static void (*a52_dynrng_ptr) (a52_state_t * state, - sample_t (* call) (sample_t, void *), void * data); -#define a52_dynrng(a,b,c) (*a52_dynrng_ptr)(a,b,c) - -static sample_t* (*a52_samples_ptr) (a52_state_t * state); -#define a52_samples(a) (*a52_samples_ptr)(a) - -static void* (*a52_resample_init_ptr)(a52_state_t * state,uint32_t mm_accel,int flags,int chans); -#define a52_resample_init(a,b,c,d) (*a52_resample_init_ptr)(a,b,c,d) - -static int (** a52_resample_ptr) (float * _f, int16_t * s16); -#define a52_resample(a,b) (*a52_resample_ptr)(a,b) - -static void* (*a52_resample_init_float_ptr)(a52_state_t * state,uint32_t mm_accel,int flags,int chans); -#define a52_resample_init_float(a,b,c,d) (*a52_resample_init_float_ptr)(a,b,c,d) - -static int (** a52_resample32_ptr) (float * _f, float * s32); -#define a52_resample32(a,b) (*a52_resample32_ptr)(a,b) - -static void *dll_handle; -static int load_dll(const char *libname) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - a52_syncinfo_ptr = ld_sym(dll_handle,"a52_syncinfo"); - a52_init_ptr = ld_sym(dll_handle,"a52_init"); - a52_frame_ptr = ld_sym(dll_handle,"a52_frame"); - a52_block_ptr = ld_sym(dll_handle,"a52_block"); - a52_resample_init_ptr = ld_sym(dll_handle,"a52_resample_init"); - a52_dynrng_ptr = ld_sym(dll_handle,"a52_dynrng"); - a52_samples_ptr = ld_sym(dll_handle,"a52_samples"); - a52_resample_ptr = ld_sym(dll_handle,"a52_resample"); - a52_resample_init_float_ptr = ld_sym(dll_handle,"a52_resample_init_float"); - a52_resample32_ptr = ld_sym(dll_handle,"a52_resample32"); - crc16_block_ptr = ld_sym(dll_handle,"crc16_block"); - return a52_syncinfo_ptr && crc16_block_ptr && a52_frame_ptr && - a52_init_ptr && a52_block_ptr && a52_resample_init_ptr && - a52_resample_ptr && a52_resample_init_float_ptr && a52_resample32_ptr && - a52_samples_ptr && a52_dynrng_ptr; -} - extern int audio_output_channels; int a52_fillbuff(sh_audio_t *sh_audio,float *pts){ @@ -130,7 +76,6 @@ a52_priv->last_pts=*pts=apts; if(crc16_block(sh_audio->a_in_buffer+2,length-2)!=0) MSG_STATUS("a52: CRC check failed! \n"); - return length; } @@ -184,7 +129,7 @@ sh->audio_out_minsize=audio_output_channels*sh->samplesize*256*6; sh->audio_in_minsize=MAX_AC3_FRAME; sh->context=malloc(sizeof(a52_priv_t)); - return load_dll(codec_name("liba52"SLIBSUFFIX)); + return 1; } int init(sh_audio_t *sh_audio) @@ -246,7 +191,6 @@ void uninit(sh_audio_t *sh) { free(sh->context); - dlclose(dll_handle); } int control(sh_audio_t *sh,int cmd,void* arg, ...) Modified: mplayerxp/libmpcodecs/ad_acm.c =================================================================== --- mplayerxp/libmpcodecs/ad_acm.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_acm.c 2010-01-01 15:53:19 UTC (rev 58) @@ -148,7 +148,7 @@ MSG_ERR(MSGTR_ACMiniterror); return 0; } - MSG_V("INFO: Win32/DShow (%s) audio codec init OK!\n",CODECDIR"/wine/libloader"SLIBSUFFIX); + MSG_V("INFO: Win32/ACM init OK!\n"); return 1; } Modified: mplayerxp/libmpcodecs/ad_dca.c =================================================================== --- mplayerxp/libmpcodecs/ad_dca.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_dca.c 2010-01-01 15:53:19 UTC (rev 58) @@ -11,7 +11,7 @@ #include "help_mp.h" #include "cpudetect.h" -#include "interface/dca.h" +#include "libdca/dca.h" #include "../mm_accel.h" #include "../mplayer.h" #include "../bswap.h" @@ -33,7 +33,7 @@ #include "bswap.h" -static const ad_info_t info = +static const ad_info_t info = { "DTS Coherent Acoustics", "libdca", @@ -47,64 +47,6 @@ LIBAD_EXTERN(dca) -static int (*dca_syncinfo_ptr) (dca_state_t *state, uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate, int *frame_length); -#define dca_syncinfo(a,b,c,d,e,f) (*dca_syncinfo_ptr)(a,b,c,d,e,f) - -static dca_state_t * (*dca_init_ptr) (uint32_t mm_accel); -#define dca_init(a) (*dca_init_ptr)(a) - -static int (*dca_frame_ptr)(dca_state_t * state, uint8_t * buf, int * flags, - level_t * level, sample_t bias); -#define dca_frame(a,b,c,d,e) (*dca_frame_ptr)(a,b,c,d,e) - -static int (*dca_block_ptr) (dca_state_t * state); -#define dca_block(a) (*dca_block_ptr)(a) - -static int (*dca_blocks_num_ptr) (dca_state_t * state); -#define dca_blocks_num(a) (*dca_blocks_num_ptr)(a) - -static void (*dca_dynrng_ptr) (dca_state_t * state, - sample_t (* call) (sample_t, void *), void * data); -#define dca_dynrng(a,b,c) (*dca_dynrng_ptr)(a,b,c) - -static sample_t* (*dca_samples_ptr) (dca_state_t * state); -#define dca_samples(a) (*dca_samples_ptr)(a) - -static void* (*dca_resample_init_ptr)(dca_state_t * state,uint32_t mm_accel,int flags,int chans); -#define dca_resample_init(a,b,c,d) (*dca_resample_init_ptr)(a,b,c,d) - -static int (** dca_resample_ptr) (float * _f, int16_t * s16); -#define dca_resample(a,b) (*dca_resample_ptr)(a,b) - -static void* (*dca_resample_init_float_ptr)(dca_state_t * state,uint32_t mm_accel,int flags,int chans); -#define dca_resample_init_float(a,b,c,d) (*dca_resample_init_float_ptr)(a,b,c,d) - -static int (** dca_resample32_ptr) (float * _f, float * s32); -#define dca_resample32(a,b) (*dca_resample32_ptr)(a,b) - -static void *dll_handle; -static int load_dll(const char *libname) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - dca_syncinfo_ptr = ld_sym(dll_handle,"dca_syncinfo"); - dca_init_ptr = ld_sym(dll_handle,"dca_init"); - dca_frame_ptr = ld_sym(dll_handle,"dca_frame"); - dca_block_ptr = ld_sym(dll_handle,"dca_block"); - dca_blocks_num_ptr = ld_sym(dll_handle,"dca_blocks_num"); - dca_dynrng_ptr = ld_sym(dll_handle,"dca_dynrng"); - dca_samples_ptr = ld_sym(dll_handle,"dca_samples"); - dca_resample_init_ptr = ld_sym(dll_handle,"dca_resample_init"); - dca_resample_ptr = ld_sym(dll_handle,"dca_resample"); - dca_resample_init_float_ptr = ld_sym(dll_handle,"dca_resample_init_float"); - dca_resample32_ptr = ld_sym(dll_handle,"dca_resample32"); - return dca_syncinfo_ptr && dca_frame_ptr && dca_init_ptr && - dca_block_ptr && dca_samples_ptr && dca_dynrng_ptr && - dca_blocks_num_ptr && dca_resample_init_float_ptr && - dca_resample32_ptr && dca_resample_init_ptr && - dca_resample_ptr; -} - extern int audio_output_channels; int dca_fillbuff(sh_audio_t *sh_audio,float *pts){ @@ -135,7 +77,7 @@ sh_audio->i_bps=bit_rate/8; demux_read_data_r(sh_audio->ds,sh_audio->a_in_buffer+16,length-16,apts?&null_pts:&apts); dca_priv->last_pts=*pts=apts; - + return length; } @@ -189,7 +131,7 @@ sh->audio_out_minsize=audio_output_channels*sh->samplesize*256*8; sh->audio_in_minsize=MAX_AC5_FRAME; sh->context=malloc(sizeof(dca_priv_t)); - return load_dll(codec_name("libdca"SLIBSUFFIX)); + return 1; } int init(sh_audio_t *sh_audio) @@ -213,14 +155,14 @@ sh_audio->channels=audio_output_channels; while(sh_audio->channels>0){ switch(sh_audio->channels){ - case 1: mpxp_dca_flags=DCA_MONO; break; - case 2: mpxp_dca_flags=DCA_STEREO; break; -/* case 2: mpxp_dca_flags=DCA_DOLBY; break; */ -/* case 3: mpxp_dca_flags=DCA_3F; break; */ - case 3: mpxp_dca_flags=DCA_2F1R; break; - case 4: mpxp_dca_flags=DCA_2F2R; break; /* 2+2*/ - case 5: mpxp_dca_flags=DCA_3F2R; break; - case 6: mpxp_dca_flags=DCA_3F2R|DCA_LFE; break; /* 5.1*/ + case 1: mpxp_dca_flags=DCA_MONO; break; + case 2: mpxp_dca_flags=DCA_STEREO; break; +/* case 2: mpxp_dca_flags=DCA_DOLBY; break; */ +/* case 3: mpxp_dca_flags=DCA_3F; break; */ + case 3: mpxp_dca_flags=DCA_2F1R; break; + case 4: mpxp_dca_flags=DCA_2F2R; break; /* 2+2*/ + case 5: mpxp_dca_flags=DCA_3F2R; break; + case 6: mpxp_dca_flags=DCA_3F2R|DCA_LFE; break; /* 5.1*/ } /* test:*/ flags=mpxp_dca_flags|DCA_ADJUST_LEVEL; @@ -250,7 +192,6 @@ void uninit(sh_audio_t *sh) { free(sh->context); - dlclose(dll_handle); } int control(sh_audio_t *sh,int cmd,void* arg, ...) Modified: mplayerxp/libmpcodecs/ad_dshow.c =================================================================== --- mplayerxp/libmpcodecs/ad_dshow.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_dshow.c 2010-01-01 15:53:19 UTC (rev 58) @@ -50,7 +50,7 @@ sh_audio->audio_in_minsize=2*sh_audio->wf->nBlockAlign; if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192; sh_audio->audio_out_minsize=16384; - MSG_V("INFO: Win32/DShow (%s) audio codec init OK!\n",CODECDIR"/wine/DS_Filter"SLIBSUFFIX); + MSG_V("INFO: Win32/DShow init OK!\n"); return 1; } Modified: mplayerxp/libmpcodecs/ad_ffmp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_ffmp3.c 2010-01-01 15:53:19 UTC (rev 58) @@ -36,56 +36,10 @@ LIBAD_EXTERN(ffmp3) -unsigned (*avcodec_version_ptr)(void); -void (*avcodec_init_ptr)(void); -void (*avcodec_register_all_ptr)(void); -AVCodec * (*avcodec_find_decoder_by_name_ptr)(const char *name); -int (*avcodec_open_ptr)(AVCodecContext *avctx, AVCodec *codec); -int (*avcodec_close_ptr)(AVCodecContext *avctx); -int (*avcodec_decode_audio_ptr)(AVCodecContext *avctx, INT16 *samples, - int *frame_size_ptr, - uint8_t *buf, int buf_size); -AVCodecContext* (*avcodec_alloc_context_ptr)(void); - -static void *dll_handle; -static int load_dll(const char *libname) -{ - if(!(dll_handle=ld_codec(libname,"http://ffmpeg.sf.net"))) return 0; - avcodec_init_ptr = ld_sym(dll_handle,"avcodec_init"); - avcodec_version_ptr = ld_sym(dll_handle,"avcodec_version"); - avcodec_register_all_ptr = ld_sym(dll_handle,"avcodec_register_all"); - avcodec_find_decoder_by_name_ptr = ld_sym(dll_handle,"avcodec_find_decoder_by_name"); - avcodec_alloc_context_ptr = ld_sym(dll_handle,"avcodec_alloc_context"); - avcodec_open_ptr = ld_sym(dll_handle,"avcodec_open"); - avcodec_close_ptr = ld_sym(dll_handle,"avcodec_close"); - avcodec_decode_audio_ptr = ld_sym(dll_handle,"avcodec_decode_audio2"); - return avcodec_init_ptr && avcodec_register_all_ptr && avcodec_find_decoder_by_name_ptr - && avcodec_open_ptr && avcodec_close_ptr && avcodec_decode_audio_ptr - && avcodec_version_ptr && avcodec_alloc_context_ptr; -} - -#define MIN_LIBAVCODEC_VERSION_INT ((51<<16)+(0<<8)+0) - int preinit(sh_audio_t *sh) { - unsigned avc_version; sh->audio_out_minsize=AVCODEC_MAX_AUDIO_FRAME_SIZE; - if(!load_dll(codec_name("libavcodec"SLIBSUFFIX))) /* try local copy first */ - if(!load_dll("libavcodec-0.4.9"SLIBSUFFIX)) - if(!load_dll("libavcodec"SLIBSUFFIX)) - { - MSG_ERR("Detected error during loading libffmpeg.so! Try to upgrade this codec\n"); - return 0; - } - avc_version = (*avcodec_version_ptr)(); - if(avc_version < MIN_LIBAVCODEC_VERSION_INT) - { - MSG_ERR("You have wrong version of libavcodec %06X < %06X\n", - avc_version,MIN_LIBAVCODEC_VERSION_INT); - return 0; - } - sh->audio_out_minsize=AVCODEC_MAX_AUDIO_FRAME_SIZE; - return 1; + return 1; } int init(sh_audio_t *sh_audio) @@ -94,16 +48,16 @@ float pts; MSG_V("FFmpeg's libavcodec audio codec\n"); if(!acodec_inited){ - (*avcodec_init_ptr)(); - (*avcodec_register_all_ptr)(); - acodec_inited=1; + avcodec_init(); + avcodec_register_all(); + acodec_inited=1; } - lavc_codec = (AVCodec *)(*avcodec_find_decoder_by_name_ptr)(sh_audio->codec->dll_name); + lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_audio->codec->dll_name); if(!lavc_codec){ MSG_ERR(MSGTR_MissingLAVCcodec,sh_audio->codec->dll_name); return 0; } - lavc_context = (*avcodec_alloc_context_ptr)(); + lavc_context = avcodec_alloc_context(); sh_audio->context = lavc_context; if(sh_audio->wf) { @@ -132,7 +86,7 @@ lavc_context->codec_type = lavc_codec->type; lavc_context->codec_id = lavc_codec->id; /* open it */ - if ((*avcodec_open_ptr)(lavc_context, lavc_codec) < 0) { + if (avcodec_open(lavc_context, lavc_codec) < 0) { MSG_ERR( MSGTR_CantOpenCodec); return 0; } @@ -160,8 +114,7 @@ void uninit(sh_audio_t *sh) { - (*avcodec_close_ptr)(lavc_context); - dlclose(dll_handle); + avcodec_close(lavc_context); if (lavc_context->extradata) free(lavc_context->extradata); free(lavc_context); acodec_inited=0; @@ -182,7 +135,7 @@ int x=ds_get_packet_r(sh_audio->ds,&start,apts?&null_pts:&apts); if(x<=0) break; // error if(sh_audio->format==mmioFOURCC('d','n','e','t')) swab(start,start,x&(~1)); - y=(*avcodec_decode_audio_ptr)(sh_audio->context,(INT16*)buf,&len2,start,x); + y=avcodec_decode_audio2(sh_audio->context,(INT16*)buf,&len2,start,x); if(y<0){ MSG_V("lavc_audio: error\n");break; } if(y<x) { Modified: mplayerxp/libmpcodecs/ad_hwac3.c =================================================================== --- mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_hwac3.c 2010-01-01 15:53:19 UTC (rev 58) @@ -12,7 +12,6 @@ #include "codecs_ld.h" #include "cpudetect.h" -#include "interface/a52.h" #include "../libao2/afmt.h" #include "ad_a52.h" @@ -136,10 +135,11 @@ return 0; } +typedef struct a52_state_s a52_state_t; extern a52_state_t *mpxp_a52_state; extern uint32_t mpxp_a52_accel; extern uint32_t mpxp_a52_flags; -extern int a52_fillbuff(sh_audio_t *sh_audio,float *pts); +int a52_fillbuff(sh_audio_t *sh_audio,float *pts); static const ad_info_t info = { @@ -175,7 +175,7 @@ sh->audio_in_minsize=3840; sh->channels=2; sh->sample_format=AFMT_AC3; - return load_dll(codec_name("liba52"SLIBSUFFIX)); + return load_dll("liba52"SLIBSUFFIX); } int init(sh_audio_t *sh_audio) Modified: mplayerxp/libmpcodecs/ad_mp3.c =================================================================== --- mplayerxp/libmpcodecs/ad_mp3.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_mp3.c 2010-01-01 15:53:19 UTC (rev 58) @@ -3,7 +3,6 @@ #include <unistd.h> #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "ad_internal.h" -#include "interface/mp3.h" #include "mp_config.h" #include "../mplayer.h" #include "../cpudetect.h" @@ -27,7 +26,158 @@ LIBAD_EXTERN(mp3) -extern int mplayer_audio_read(char *buf,int size); +/** Opaque structure for the libmpg123 decoder handle. */ +struct mpg123_handle_struct; +typedef struct mpg123_handle_struct mpg123_handle; + +/** Enumeration of the mode types of Variable Bitrate */ +enum mpg123_vbr { + MPG123_CBR=0, /**< Constant Bitrate Mode (default) */ + MPG123_VBR, /**< Variable Bitrate Mode */ + MPG123_ABR /**< Average Bitrate Mode */ +}; + +/** Enumeration of the MPEG Versions */ +enum mpg123_version { + MPG123_1_0=0, /**< MPEG Version 1.0 */ + MPG123_2_0, /**< MPEG Version 2.0 */ + MPG123_2_5 /**< MPEG Version 2.5 */ +}; + + +/** Enumeration of the MPEG Audio mode. + * Only the mono mode has 1 channel, the others have 2 channels. */ +enum mpg123_mode { + MPG123_M_STEREO=0, /**< Standard Stereo. */ + MPG123_M_JOINT, /**< Joint Stereo. */ + MPG123_M_DUAL, /**< Dual Channel. */ + MPG123_M_MONO /**< Single Channel. */ +}; + +/** Enumeration of the MPEG Audio flag bits */ +enum mpg123_flags { + MPG123_CRC=0x1, /**< The bitstream is error protected using 16-bit CRC. */ + MPG123_COPYRIGHT=0x2, /**< The bitstream is copyrighted. */ + MPG123_PRIVATE=0x4, /**< The private bit has been set. */ + MPG123_ORIGINAL=0x8 /**< The bitstream is an original, not a copy. */ +}; + +/** Data structure for storing information about a frame of MPEG Audio */ +struct mpg123_frameinfo +{ + enum mpg123_version version; /**< The MPEG version (1.0/2.0/2.5). */ + int layer; /**< The MPEG Audio Layer (MP1/MP2/MP3). */ + long rate; /**< The sampling rate in Hz. */ + enum mpg123_mode mode; /**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */ + int mode_ext; /**< The mode extension bit flag. */ + int framesize; /**< The size of the frame (in bytes). */ + enum mpg123_flags flags; /**< MPEG Audio flag bits. */ + int emphasis; /**< The emphasis type. */ + int bitrate; /**< Bitrate of the frame (kbps). */ + int abr_rate; /**< The target average bitrate. */ + enum mpg123_vbr vbr; /**< The VBR mode. */ +}; + + +/** Enumeration of the parameters types that it is possible to set/get. */ +enum mpg123_parms +{ + MPG123_VERBOSE, /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */ + MPG123_FLAGS, /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */ + MPG123_ADD_FLAGS, /**< add some flags (integer) */ + MPG123_FORCE_RATE, /**< when value > 0, force output rate to that value (integer) */ + MPG123_DOWN_SAMPLE, /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */ + MPG123_RVA, /**< one of the RVA choices above (integer) */ + MPG123_DOWNSPEED, /**< play a frame N times (integer) */ + MPG123_UPSPEED, /**< play every Nth frame (integer) */ + MPG123_START_FRAME, /**< start with this frame (skip frames before that, integer) */ + MPG123_DECODE_FRAMES, /**< decode only this number of frames (integer) */ + MPG123_ICY_INTERVAL, /**< stream contains ICY metadata with this interval (integer) */ + MPG123_OUTSCALE, /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */ + MPG123_TIMEOUT, /**< timeout for reading from a stream (not supported on win32, integer) */ + MPG123_REMOVE_FLAGS, /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */ + MPG123_RESYNC_LIMIT, /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). */ + MPG123_INDEX_SIZE /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */ + ,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/ +}; + +/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */ +enum mpg123_param_flags +{ + MPG123_FORCE_MONO = 0x7 /**< 0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */ + ,MPG123_MONO_LEFT = 0x1 /**< 0001 Force playback of left channel only. */ + ,MPG123_MONO_RIGHT = 0x2 /**< 0010 Force playback of right channel only. */ + ,MPG123_MONO_MIX = 0x4 /**< 0100 Force playback of mixed mono. */ + ,MPG123_FORCE_STEREO = 0x8 /**< 1000 Force stereo output. */ + ,MPG123_FORCE_8BIT = 0x10 /**< 00010000 Force 8bit formats. */ + ,MPG123_QUIET = 0x20 /**< 00100000 Suppress any printouts (overrules verbose). */ + ,MPG123_GAPLESS = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */ + ,MPG123_NO_RESYNC = 0x80 /**< 10000000 Disable resync stream after error. */ + ,MPG123_SEEKBUFFER = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */ + ,MPG123_FUZZY = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */ + ,MPG123_FORCE_FLOAT = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */ + ,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */ +}; + +/** choices for MPG123_RVA */ +enum mpg123_param_rva +{ + MPG123_RVA_OFF = 0 /**< RVA disabled (default). */ + ,MPG123_RVA_MIX = 1 /**< Use mix/track/radio gain. */ + ,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */ + ,MPG123_RVA_MAX = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */ +}; + +/** Enumeration of the message and error codes and returned by libmpg123 functions. */ +enum mpg123_errors +{ + MPG123_DONE=-12, /**< Message: Track ended. Stop decoding. */ + MPG123_NEW_FORMAT=-11, /**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */ + MPG123_NEED_MORE=-10, /**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */ + MPG123_ERR=-1, /**< Generic Error */ + MPG123_OK=0, /**< Success */ + MPG123_BAD_OUTFORMAT, /**< Unable to set up output format! */ + MPG123_BAD_CHANNEL, /**< Invalid channel number specified. */ + MPG123_BAD_RATE, /**< Invalid sample rate specified. */ + MPG123_ERR_16TO8TABLE, /**< Unable to allocate memory for 16 to 8 converter table! */ + MPG123_BAD_PARAM, /**< Bad parameter id! */ + MPG123_BAD_BUFFER, /**< Bad buffer given -- invalid pointer or too small size. */ + MPG123_OUT_OF_MEM, /**< Out of memory -- some malloc() failed. */ + MPG123_NOT_INITIALIZED, /**< You didn't initialize the library! */ + MPG123_BAD_DECODER, /**< Invalid decoder choice. */ + MPG123_BAD_HANDLE, /**< Invalid mpg123 handle. */ + MPG123_NO_BUFFERS, /**< Unable to initialize frame buffers (out of memory?). */ + MPG123_BAD_RVA, /**< Invalid RVA mode. */ + MPG123_NO_GAPLESS, /**< This build doesn't support gapless decoding. */ + MPG123_NO_SPACE, /**< Not enough buffer space. */ + MPG123_BAD_TYPES, /**< Incompatible numeric data types. */ + MPG123_BAD_BAND, /**< Bad equalizer band. */ + MPG123_ERR_NULL, /**< Null pointer given where valid storage address needed. */ + MPG123_ERR_READER, /**< Error reading the stream. */ + MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */ + MPG123_BAD_WHENCE, /**< Invalid 'whence' for seek function.*/ + MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */ + MPG123_BAD_FILE, /**< File access error. */ + MPG123_NO_SEEK, /**< Seek not supported by stream. */ + MPG123_NO_READER, /**< No stream opened. */ + MPG123_BAD_PARS, /**< Bad parameter handle. */ + MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() */ + MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */ + MPG123_RESYNC_FAIL, /**< Resync failed to find valid MPEG data. */ + MPG123_NO_8BIT, /**< No 8bit encoding possible. */ + MPG123_BAD_ALIGN, /**< Stack aligmnent error */ + MPG123_NULL_BUFFER, /**< NULL input buffer with non-zero size... */ + MPG123_NO_RELSEEK, /**< Relative seek not possible (screwed up file offset) */ + MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */ + MPG123_BAD_KEY, /**< Bad key value given. */ + MPG123_NO_INDEX, /**< No frame index in this build. */ + MPG123_INDEX_FAIL, /**< Something with frame index went wrong. */ + MPG123_BAD_DECODER_SETUP, /**< Something prevents a proper decoder setup */ + MPG123_MISSING_FEATURE /**< This feature has not been built into libmpg123. */ + ,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */ + ,MPG123_LSEEK_FAILED /**< Low-level seek failed. */ +}; + extern int fakemono; static sh_audio_t* dec_audio_sh=NULL; @@ -95,7 +245,6 @@ sh->audio_out_minsize=9216; rval=0; rval = load_dll("libmpg123"SLIBSUFFIX); /* try standard libmpg123 first */ - if(!rval) rval = load_dll(codec_name("libMP3"SLIBSUFFIX)); /* if fail then fallback to internal codec */ return rval; } Modified: mplayerxp/libmpcodecs/ad_twin.c =================================================================== --- mplayerxp/libmpcodecs/ad_twin.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_twin.c 2010-01-01 15:53:19 UTC (rev 58) @@ -5,7 +5,6 @@ #include <dlfcn.h> /* GLIBC specific. Exists under cygwin too! */ #include "ad_internal.h" #include "codecs_ld.h" -#include "interface/vqf.h" #include "loader/ldt_keeper.h" #include "loader/wine/windef.h" #include "../libao2/afmt.h" @@ -27,10 +26,165 @@ LIBAD_EXTERN(twin) -extern void* WINAPI LoadLibraryA(char* name); -extern void* WINAPI GetProcAddress(void* handle, char* func); -extern int WINAPI FreeLibrary(void* handle); +/************************/ +/*** General settings ***/ +/************************/ +/* Initialization error code */ +enum INIT_ERROR_CODE { + TVQ_NO_ERROR = 0, // no error + TVQ_ERROR, // general + TVQ_ERROR_VERSION, // wrong version + TVQ_ERROR_CHANNEL, // channel setting error + TVQ_ERROR_MODE, // wrong coding mode + TVQ_ERROR_PARAM, // inner parameter setting error + TVQ_ERROR_N_CAN, // wrong number of VQ pre-selection candidates, used only in encoder +}; +/* version ID */ +#define TVQ_UNKNOWN_VERSION -1 +#define V2 0 +#define V2PP 1 + +#define N_VERSIONS 2 + +/* window types */ +enum WINDOW_TYPE { + ONLY_LONG_WINDOW = 0, + LONG_SHORT_WINDOW, + ONLY_SHORT_WINDOW, + SHORT_LONG_WINDOW, + SHORT_MEDIUM_WINDOW, + MEDIUM_LONG_WINDOW, + LONG_MEDIUM_WINDOW, + MEDIUM_SHORT_WINDOW, + ONLY_MEDIUM_WINDOW, +}; + +/* block types */ +enum BLOCK_TYPE { + BLK_SHORT = 0, + BLK_MEDIUM, + BLK_LONG, + BLK_PPC, +}; +#define N_BTYPE 3 // number of block types +#define N_INTR_TYPE 4 // number of interleave types, enum BLOCK_TYPE is commonly used for detecting interleave types. + +/* maximum number of channels */ +#define N_CH_MAX 2 + +/* type definition of code information interface */ +typedef struct { + /* block type */ + int w_type; + int btype; + + /* FBC info */ + int *segment_sw[ N_CH_MAX ]; + int *band_sw[ N_CH_MAX ]; + int *fg_intensity[ N_CH_MAX ]; + + /* VQ info */ + int *wvq; + + /* BSE info */ + int *fw; + int *fw_alf; + + /* gain info */ + int *pow; + + /* LSP info */ + int *lsp[ N_CH_MAX ]; + + /* PPC info */ + int pit[ N_CH_MAX ]; + int *pls; + int pgain[ N_CH_MAX ]; + + /* EBC info */ + int *bc[ N_CH_MAX ]; + + void *manager; +} INDEX; + +/***********************************************/ +/*** Definitions about program configuration ***/ +/***********************************************/ +/* type definition of tvqConfInfoSubBlock */ +typedef struct { + int sf_sz; // subframe size + int nsf; // number of subframes + int ndiv; // number of division of weighted interleave vector quantization + int ncrb; // number of Bark-scale subbands + int fw_ndiv; // number of division of BSE VQ + int fw_nbit; // number of bits for BSE VQ + int nsubg; // number of sub-blocks for gain coding + int ppc_enable; // PPC switch + int ebc_enable; // EBC switch + int ebc_crb_base; // EBC base band + int ebc_bits; // EBC bits + int fbc_enable; // FBC switch + int fbc_n_segment; // FBC number of segments + int fbc_nband; // FBC number of subbands + int *fbc_crb_tbl; // FBC subband table +} tvqConfInfoSubBlock; + +/* type definition of tvqConfInfo */ +typedef struct { + /* frame configuration */ + int N_CH; + /* window type coding */ + int BITS_WTYPE; + /* LSP coding */ + int LSP_BIT0; + int LSP_BIT1; + int LSP_BIT2; + int LSP_SPLIT; + /* Bark-scale envelope coding */ + int FW_ARSW_BITS; + /* gain coding */ + int GAIN_BITS; + int SUB_GAIN_BITS; + /* pitch excitation */ + int N_DIV_P; + int BASF_BIT; + int PGAIN_BIT; + + /* block type dependent parameters */ + tvqConfInfoSubBlock cfg[N_BTYPE]; + +} tvqConfInfo; + + +#define KEYWORD_BYTES 4 +#define VERSION_BYTES 8 +#define ELEM_BYTES sizeof(unsigned long) +/* + */ +typedef struct{ + char ID[KEYWORD_BYTES+VERSION_BYTES+1]; + int size; + /* Common Chunk */ + int channelMode; /* channel mode (mono:0/stereo:1) */ + int bitRate; /* bit rate (kbit/s) */ + int samplingRate; /* sampling rate (44.1 kHz -> 44) */ + int securityLevel; /* security level (always 0) */ + /* Text Chunk */ + char Name[BUFSIZ]; + char Comt[BUFSIZ]; + char Auth[BUFSIZ]; + char Cpyr[BUFSIZ]; + char File[BUFSIZ]; + char Extr[BUFSIZ]; // add by OKAMOTO 99.12.21 + /* Data size chunk*/ + int Dsiz; +} headerInfo; + +extern HMODULE WINAPI LoadLibraryA(LPCSTR); +extern FARPROC WINAPI GetProcAddress(HMODULE,LPCSTR); +extern int WINAPI FreeLibrary(HMODULE); + static int (*TvqInitialize_ptr)( headerInfo *setupInfo, INDEX *index, int dispErrorMessageBox ); #define TvqInitialize(a,b,c) (*TvqInitialize_ptr)(a,b,c) static void (*TvqTerminate_ptr)( INDEX *index ); @@ -184,7 +338,7 @@ MSG_ERR("TWinVQ initialization fail\n"); return 0; } - MSG_V("INFO: TWinVQ (%s) audio codec init OK!\n",CODECDIR"/wine/libloader"SLIBSUFFIX); + MSG_V("INFO: TWinVQ audio codec init OK!\n"); return 1; } Modified: mplayerxp/libmpcodecs/ad_vorbis.c =================================================================== --- mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/ad_vorbis.c 2010-01-01 15:53:19 UTC (rev 58) @@ -23,7 +23,7 @@ LIBAD_EXTERN(vorbis) #include <math.h> -#include "interface/vorbis/codec.h" +#include <vorbis/codec.h> // This struct is also defined in demux_ogg.c => common header ? typedef struct ov_struct_st { @@ -34,50 +34,9 @@ vorbis_block vb; /* local working space for packet->PCM decode */ } ov_struct_t; -static void (*vorbis_info_init_ptr)(vorbis_info *vi); -#define vorbis_info_init(a) (*vorbis_info_init_ptr)(a) -static void (*vorbis_comment_init_ptr)(vorbis_comment *vc); -#define vorbis_comment_init(a) (*vorbis_comment_init_ptr)(a) -static int (*vorbis_synthesis_init_ptr)(vorbis_dsp_state *v,vorbis_info *vi); -#define vorbis_synthesis_init(a,b) (*vorbis_synthesis_init_ptr)(a,b) -static int (*vorbis_synthesis_headerin_ptr)(vorbis_info *vi,vorbis_comment *vc, - ogg_packet *op); -#define vorbis_synthesis_headerin(a,b,c) (*vorbis_synthesis_headerin_ptr)(a,b,c) -static int (*vorbis_synthesis_ptr)(vorbis_block *vb,ogg_packet *op); -#define vorbis_synthesis(a,b) (*vorbis_synthesis_ptr)(a,b) -static int (*vorbis_synthesis_blockin_ptr)(vorbis_dsp_state *v,vorbis_block *vb); -#define vorbis_synthesis_blockin(a,b) (*vorbis_synthesis_blockin_ptr)(a,b) -static int (*vorbis_synthesis_pcmout_ptr)(vorbis_dsp_state *v,float ***pcm); -#define vorbis_synthesis_pcmout(a,b) (*vorbis_synthesis_pcmout_ptr)(a,b) -static int (*vorbis_synthesis_read_ptr)(vorbis_dsp_state *v,int samples); -#define vorbis_synthesis_read(a,b) (*vorbis_synthesis_read_ptr)(a,b) -static int (*vorbis_block_init_ptr)(vorbis_dsp_state *v, vorbis_block *vb); -#define vorbis_block_init(a,b) (*vorbis_block_init_ptr)(a,b) - -static void *dll_handle; -static int load_lib( const char *libname ) -{ - if(!(dll_handle=ld_codec(libname,NULL))) return 0; - vorbis_info_init_ptr = ld_sym(dll_handle,"vorbis_info_init"); - vorbis_comment_init_ptr = ld_sym(dll_handle,"vorbis_comment_init"); - vorbis_synthesis_init_ptr = ld_sym(dll_handle,"vorbis_synthesis_init"); - vorbis_synthesis_headerin_ptr = ld_sym(dll_handle,"vorbis_synthesis_headerin"); - vorbis_synthesis_ptr = ld_sym(dll_handle,"vorbis_synthesis"); - vorbis_synthesis_blockin_ptr = ld_sym(dll_handle,"vorbis_synthesis_blockin"); - vorbis_synthesis_pcmout_ptr = ld_sym(dll_handle,"vorbis_synthesis_pcmout"); - vorbis_synthesis_read_ptr = ld_sym(dll_handle,"vorbis_synthesis_read"); - vorbis_block_init_ptr = ld_sym(dll_handle,"vorbis_block_init"); - return vorbis_info_init_ptr && vorbis_comment_init_ptr && - vorbis_synthesis_init_ptr && vorbis_synthesis_headerin_ptr && - vorbis_synthesis_ptr && vorbis_synthesis_blockin_ptr && - vorbis_synthesis_pcmout_ptr && vorbis_synthesis_read_ptr && - vorbis_block_init_ptr; -} - static int preinit(sh_audio_t *sh) { if(!(sh->context=malloc(sizeof(ov_struct_t)))) return 0; - if(!load_lib("libvorbis"SLIBSUFFIX)) return 0; sh->audio_out_minsize=1024*4; // 1024 samples/frame return 1; } @@ -160,18 +119,15 @@ static void uninit(sh_audio_t *sh) { free(sh->context); - dlclose(dll_handle); } static int control(sh_audio_t *sh,int cmd,void* arg, ...) { switch(cmd) { -#if 0 - case ADCTRL_RESYNC_STREAM: - return CONTROL_TRUE; - case ADCTRL_SKIP_FRAME: - return CONTROL_TRUE; +#if 0 + case ADCTRL_RESYNC_STREAM: return CONTROL_TRUE; + case ADCTRL_SKIP_FRAME: return CONTROL_TRUE; #endif } return CONTROL_UNKNOWN; @@ -197,7 +153,7 @@ int clipflag=0; int convsize=(maxlen-len)/(2*ov->vi.channels); // max size! int bout=(samples<convsize?samples:convsize); - + if(bout<=0) break; if(sh->samplesize==4) Modified: mplayerxp/libmpcodecs/codecs_ld.c =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/codecs_ld.c 2010-01-01 15:53:19 UTC (rev 58) @@ -24,6 +24,7 @@ return dll_handle; } +#if 0 /* this code should be called before thread creating */ static char cname[FILENAME_MAX]; char * codec_name( const char *name ) @@ -32,6 +33,7 @@ strcat(cname,name); return cname; } +#endif void * ld_sym(void *handle,const char *sym_name) { Modified: mplayerxp/libmpcodecs/codecs_ld.h =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.h 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/codecs_ld.h 2010-01-01 15:53:19 UTC (rev 58) @@ -6,7 +6,7 @@ #define __CODECS_LD extern void * ld_codec(const char *name,const char *url_hint); -extern char * codec_name( const char *name ); +/*extern char * codec_name( const char *name );*/ extern void * ld_sym(void *handle,const char *sym_name); #if defined(__OpenBSD__) && !defined(__ELF__) Modified: mplayerxp/libmpcodecs/vd.c =================================================================== --- mplayerxp/libmpcodecs/vd.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/vd.c 2010-01-01 15:53:19 UTC (rev 58) @@ -61,7 +61,9 @@ &mpcodecs_vd_huffyuv, &mpcodecs_vd_xanim, &mpcodecs_vd_real, +#ifdef HAVE_LIBTHEORA &mpcodecs_vd_theora, +#endif NULL }; static unsigned int nddrivers=sizeof(mpcodecs_vd_drivers)/sizeof(vd_functions_t*); Modified: mplayerxp/libmpcodecs/vd_divx4.c =================================================================== --- mplayerxp/libmpcodecs/vd_divx4.c 2010-01-01 09:48:37 UTC (rev 57) +++ mplayerxp/libmpcodecs/vd_divx4.c 2010-01-01 15:53:19 UTC (rev 58) @@ -35,12 +35,98 @@ LIBVD_EXTERN(divx4) -#include "interface/divx4linux.h" - #define DIVX4LINUX_BETA 0 #define DIVX4LINUX 1 #define DIVX5LINUX 2 +#define DEC_OPT_INIT 0 ///< Initialize the decoder. See LibQDecoreFunction for example usage. +#define DEC_OPT_RELEASE 1 ///< Release the decoder. See LibQDecoreFunction for example usage. +#define DEC_OPT_INFO 2 ///< Obtain information about the video. See LibQDecoreFunction for example usage. +#define DEC_OPT_FRAME 3 ///< Decode a frame. See LibQDecoreFunction for example usage. +#define DEC_OPT_SET 4 ///< Specify a parameter to adjust/set. +#define DEC_OPT_FLUSH 5 ///< Flush the decoder status. + +// Decoder parameter specifier + +#define DEC_PAR_OUTPUT 0 ///< Specify a different output format. pParam2 will point to a DecInit structure +#define DEC_PAR_POSTPROCESSING 1 ///< pParam2 will specify a postprocessing level. +#define DEC_PAR_POSTPROCDEBLOC 2 ///< pParam2 will specify a deblocking level. +#define DEC_PAR_POSTPROCDERING 3 ///< pParam2 will specify a deringing level. +#define DEC_PAR_WARMTHLEVEL 4 ///< pParam2 will specify a level for the warmth filter (film effect). +#define DEC_PAR_CONTRAST 5 ///< pParam2 will specify the contrast of the output image. +#define DEC_PAR_BRIGHTNESS 6 ///< pParam2 will specify the brightness of the output image. +#define DEC_PAR_SATURATION 7 ///< pParam2 will specify the saturation of the output image. +#define DEC_PAR_LOGO 8 ///< Display the DivX logo on the bottom right... [truncated message content] |