bs1770gain-0.9.8/0000755000175000017500000000000015037175773010332 500000000000000bs1770gain-0.9.8/config.guess0000755000175000017500000014051215036407371012564 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: bs1770gain-0.9.8/lib1770-2/0000755000175000017500000000000015037175773011556 500000000000000bs1770gain-0.9.8/lib1770-2/lib1770_stats.c0000755000175000017500000004476015035710477014155 00000000000000/* * lib1770_stats.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include //#define FF_STATS_EXPERIMENTAL #if ! defined (LIB1770_HIST_NBINS) // [ int lib1770_stats_create(lib1770_stats_t *stats) { double step=1.0/LIB1770_HIST_GRAIN; lib1770_bin_t *wp,*mp; #if 0 // [ stats=LIB1770_CALLOC(1,(sizeof *stats) +LIB1770_HIST_NBINS*(sizeof stats->hist.bin[0])); LIB1770_GOTO(NULL==stats,"allocating bs.1770 statistics",stats); #endif // ] /////////////////////////////////////////////////////////////////////////////// stats->max.wmsq=LIB1770_SILENCE_GATE; /////////////////////////////////////////////////////////////////////////////// stats->hist.pass1.wmsq=0.0; stats->hist.pass1.count=0; wp=stats->hist.bin; mp=wp+LIB1770_HIST_NBINS; while (wphist.bin; double db=step*i+LIB1770_HIST_MIN; double wsmq=pow(10.0,0.1*(0.691+db)); wp->db=db; wp->x=wsmq; wp->y=0.0; wp->count=0; if (0hist.bin[0])); LIB1770_GOTO(NULL==stats,"allocating bs.1770 statistics",stats); #if defined (LIB1770_HIST_NBINS) // [ /////////////////////////////////////////////////////////////////////////////// stats->max.wmsq=LIB1770_SILENCE_GATE; /////////////////////////////////////////////////////////////////////////////// stats->hist.pass1.wmsq=0.0; stats->hist.pass1.count=0; wp=stats->hist.bin; mp=wp+LIB1770_HIST_NBINS; while (wphist.bin; double db=step*i+LIB1770_HIST_MIN; double wsmq=pow(10.0,0.1*(0.691+db)); wp->db=db; wp->x=wsmq; wp->y=0.0; wp->count=0; if (0max.wmsqmax.wmsq) lhs->max.wmsq=rhs->max.wmsq; count=lhs->hist.pass1.count+rhs->hist.pass1.count; if (0ullhist.pass1.count/count; q2=(double)rhs->hist.pass1.count/count; #if defined (LIB1770_STATS_MERGE_FIX) // [ lhs->hist.pass1.count=count; #endif // ] lhs->hist.pass1.wmsq=q1*lhs->hist.pass1.wmsq+q2*rhs->hist.pass1.wmsq; bin1=lhs->hist.bin; bin2=rhs->hist.bin; mp=bin1+LIB1770_HIST_NBINS; while (bin1count+=(bin2++)->count; } } static int lib1770_bin_cmp(const void *key, const void *bin) { if (*(const double *)key<((const lib1770_bin_t *)bin)->x) return -1; else if (0==((const lib1770_bin_t *)bin)->y) return 0; else if (((const lib1770_bin_t *)bin)->y<=*(const double *)key) return 1; else return 0; } void lib1770_stats_add_sqs(lib1770_stats_t *stats, double wmsq) { lib1770_bin_t *bin; /////////////////////////////////////////////////////////////////////////////// if (stats->max.wmsqmax.wmsq=wmsq; /////////////////////////////////////////////////////////////////////////////// bin=bsearch(&wmsq,stats->hist.bin,LIB1770_HIST_NBINS, sizeof stats->hist.bin[0],lib1770_bin_cmp); if (NULL!=bin) { // cumulative moving average. // https://en.wikipedia.org/wiki/Moving_average#Cumulative_moving_average #if 1 // { // x (n) - CMA (n) // CMA (n+1) = CMA (n) + --------------- // n + 1 stats->hist.pass1.wmsq+=(wmsq-stats->hist.pass1.wmsq) /(double)(++stats->hist.pass1.count); #else // } { // x + n * CMA (n) // CMA (n+1) = --------------- // n + 1 // // = x / (n + 1) + CMA (n) * n / (n+1) // double n=stats->hist.pass1.count; double m=n+1; stats->hist.pass1.wmsq*=n/m; stats->hist.pass1.wmsq+=wmsq/m; ++stats->hist.pass1.count; #endif // } ++bin->count; } } /////////////////////////////////////////////////////////////////////////////// double lib1770_stats_get_max(lib1770_stats_t *stats) { return LIB1770_LUFS(stats->max.wmsq); } /////////////////////////////////////////////////////////////////////////////// #if defined (FF_STATS_EXPERIMENTAL) // [ #define FF_CMP_REF #endif // ] #if defined (FF_CMP_REF) // [ typedef struct cmp_ref cmp_ref_t; struct cmp_ref { int (*cmp)(cmp_ref_t *ref, double x); double gate1; // in amplitude, i.e. *not* dB double gate2; // in amplitude, i.e. *not* dB }; static int cmp1(cmp_ref_t *ref, double x) { return ref->gate1gate1gate2hist.bin; mp=rp+LIB1770_HIST_NBINS; #if ! defined (FF_CMP_REF) // [ gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); #endif // ] while (rpcount&&ref->cmp(ref,rp->x)) { #else // ] [ if (0ullcount&&gatex) { #endif // ] wmsq+=(double)rp->count*rp->x; *count+=rp->count; #if ! defined (FF_CMP_REF) // [ } #else // ] [ } #endif // ] ++rp; } return LIB1770_LUFS_HIST(*count,wmsq,LIB1770_SILENCE); } double lib1770_stats_get_mean(lib1770_stats_t *stats, double gate) { #if 0 // [ const lib1770_bin_t *rp,*mp; double wmsq=0.0; lib1770_count_t count=0ull; rp=stats->hist.bin; mp=rp+LIB1770_HIST_NBINS; gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); while (rpcount&&gatex) { wmsq+=(double)rp->count*rp->x; count+=rp->count; } ++rp; } return LIB1770_LUFS_HIST(count,wmsq,LIB1770_SILENCE); #else // ] [ lib1770_count_t count; #if defined (FF_CMP_REF) // [ cmp_ref_t ref ={ .cmp=cmp1, .gate1=stats->hist.pass1.wmsq*pow(10,0.1*gate) }; return lib1770_stats_get_mean_ex(stats,&ref,&count); #else // ] [ return lib1770_stats_get_mean_ex(stats,gate,&count); #endif // ] #endif // ] } #if ! defined (FF_STATS_EXPERIMENTAL) // [ double lib1770_stats_get_range(lib1770_stats_t *stats, double gate, double lower, double upper) { const lib1770_bin_t *rp=stats->hist.bin; const lib1770_bin_t *mp=rp+LIB1770_HIST_NBINS; // count of the hits to the current bin of histogram (n): lib1770_count_t count=0ull; // transform gate from dB to amplitude. gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); // how many hits we have to count? while (rpx&&0ullcount) count+=rp->count; ++rp; } // if necessary, swap boundaries. if (lower>upper) { double tmp=lower; lower=upper; upper=tmp; } if (lower<0.0) lower=0.0; if (1.0hist.bin;rpx/*&&rp->xcount; // if not alrady done, properly initialize min and max. if (isnan(min)||isnan(max)) { min=rp->db; max=rp->db; prev_count=count; continue; } if (prev_countdb; if (prev_countdb; break; } prev_count=count; } } return isnan(max)||isnan(min)?0.0:max-min; } else return 0.0; } #elif 1 // ] [ #define LIB1770_STATS_RANGE_AMPLITUDE #define LIB1770_STATS_RANGE_RECALC double lib1770_stats_get_range(lib1770_stats_t *stats, double gate, double lower, double upper) { // TODO const lib1770_bin_t *rp=stats->hist.bin; const lib1770_bin_t *mp=rp+LIB1770_HIST_NBINS; // count of the hits to the current bin of histogram (n): lib1770_count_t count=0ull; cmp_ref_t ref; ref.gate1=stats->hist.pass1.wmsq*pow(10,0.1*-70); ref.cmp=cmp1; ref.gate2=lib1770_stats_get_mean_ex(stats,&ref,&count); ref.gate2=stats->hist.pass1.wmsq*pow(10,0.1*ref.gate2-20.0); ref.cmp=cmp2; gate=lib1770_stats_get_mean_ex(stats,&ref,&count); // transform gate from dB to amplitude. gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); DVWRITELN("gate:%.02f",gate); // how many hits we have to count? while (rpx&&0ullcount) count+=rp->count; ++rp; } // if necessary, swap boundaries. if (lower>upper) { double tmp=lower; lower=upper; upper=tmp; } if (lower<0.0) lower=0.0; if (1.0hist.bin;rpx)) { count+=rp->count; // if not alrady done, properly initialize min and max. if (isnan(min)||isnan(max)) { min=rp->db; max=rp->db; prev_count=count; continue; } if (prev_countdb; if (prev_countdb; break; } prev_count=count; } } return isnan(max)||isnan(min)?0.0:max-min; } else return 0.0; } #elif 1 // ] [ #define LIB1770_STATS_RANGE_AMPLITUDE #define LIB1770_STATS_RANGE_RECALC double lib1770_stats_get_range(lib1770_stats_t *stats, double gate, double lower, double upper) { const lib1770_bin_t *rp=stats->hist.bin; const lib1770_bin_t *mp=rp+LIB1770_HIST_NBINS; // count of the hits to the current bin of histogram (n): lib1770_count_t count=0ull; #if defined (FF_CMP_REF) // [ #if defined (LIB1770_STATS_RANGE_AMPLITUDE) // ] [ cmp_ref_t ref_static ={ .cmp=cmp1, .gate1=stats->hist.pass1.wmsq*pow(10,0.1*gate) }; #else // ] [ cmp_ref_t ref_static ={ .cmp=cmp1, .gate1=gate }; #endif // ] #endif // ] DVWRITELN("\ngate:%.02f",gate); #if defined (LIB1770_STATS_RANGE_RECALC) // [ gate=lib1770_stats_get_mean_ex(stats,&ref_static,&count); DVWRITELN("gate:%.02f",gate); #endif // ] #if defined (LIB1770_STATS_RANGE_AMPLITUDE) // [ // transform gate from dB to amplitude. gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); DVWRITELN("gate:%.02f",gate); #endif // ] // how many hits we have to count? while (rpx&&0ullcount) count+=rp->count; ++rp; } // if necessary, swap boundaries. if (lower>upper) { double tmp=lower; lower=upper; upper=tmp; } if (lower<0.0) lower=0.0; if (1.0hist.bin;rpx) { #else // ] [ if (gatedb) { #endif // ] count+=rp->count; // if not alrady done, properly initialize min and max. if (isnan(min)||isnan(max)) { min=rp->db; max=rp->db; prev_count=count; continue; } if (prev_countdb; if (prev_countdb; break; } prev_count=count; } #if ! defined (LIB1770_STATS_RANGE_AMPLITUDE) // [ } #else // ] [ } #endif // ] return isnan(max)||isnan(min)?0.0:max-min; } else return 0.0; } #else // ] [ double x(lib1770_stats_t *stats, double gate, lib1770_count_t *count, double *min, double *max) { const lib1770_bin_t *mp=stats->hist.bin+LIB1770_HIST_NBINS; const lib1770_bin_t *rp; *count=0ull; *min=NAN; *max=NAN; for (rp=stats->hist.bin;rpx) { // if not alrady done, properly initialize min and max. if (isnan(*min)||isnan(*max)) { *min=rp->db; *max=rp->db; //prev_count=count; continue; } if (rp->db<*min) *min=rp->db; if (*maxdb) *max=rp->db; //DVWRITELN("??? %f:%f %f",rp->db,*min,*max); } } //DVWRITELN("!!! %f:%f %f",*max-*min,*min,*max); return isnan(*max)||isnan(*min)?0.0:*max-*min; } double lib1770_stats_get_range(lib1770_stats_t *stats, double gate, double lower, double upper) { #if 0 // [ const lib1770_bin_t *rp=stats->hist.bin; const lib1770_bin_t *mp=rp+LIB1770_HIST_NBINS; // count of the hits in current bin of histogram: lib1770_count_t count=0ull; double db=0.0; #endif // ] #if 0 // [ // transform gate from dB to amplitude. gate=stats->hist.pass1.wmsq*pow(10,0.1*gate); // how many hits we have to count? while (rpx&&0ullcount) { db+=rp->db; count+=rp->count; } ++rp; } db=LIB1770_Q2DB(LIB1770_DB2Q(db)/count); // if necessary, swap boundaries. if (lower>upper) { double tmp=lower; lower=upper; upper=tmp; } if (lower<0.0) lower=0.0; if (1.0hist.bin;rpx) { //count+=rp->count; // if not alrady done, properly initialize min and max. if (isnan(min)||isnan(max)) { min=rp->db; max=rp->db; //prev_count=count; continue; } #if 0 // [ if (prev_countdb; if (prev_countdb; break; } prev_count=count; #else // ] [ if (rp->dbdb; if (maxdb) max=rp->db; DVWRITELN("??? %f:%f %f",rp->db,min,max); #endif // ] } } DVWRITELN("!!! %f:%f %f",max-min,min,max); return isnan(max)||isnan(min)?0.0:max-min; } else return 0.0; #else // ] [ const lib1770_bin_t *rp=stats->hist.bin; const lib1770_bin_t *mp=rp+LIB1770_HIST_NBINS; lib1770_count_t count; double abs_gate,rel_gate; //double min,max; (void)lower; (void)upper; //DVWRITELN("\nlower:%.02f",lower); //DVWRITELN("\nupper:%.02f",upper); //DVWRITELN("\ngate:%.02f",gate); //exit(1); gate=-70; abs_gate=lib1770_stats_get_mean_ex(stats,gate,&count); abs_gate=LIB1770_Q2DB(LIB1770_DB2Q(abs_gate)/count)-20.0; rel_gate=lib1770_stats_get_mean_ex(stats,abs_gate,&count); //rel_gate=LIB1770_Q2DB(LIB1770_DB2Q(rel_gate)/count); //DVWRITELN("=== abs_gate:%.02f rel_gate:%.02f",abs_gate,rel_gate); // how many hits we have to count? rp=stats->hist.bin; count=0; while (rpx&&rel_gatex)) count+=rp->count; ++rp; } if (0ullhist.bin;rpdb&&rel_gatedb) { count+=rp->count; // if not alrady done, properly initialize min and max. if (isnan(min)||isnan(max)) { min=rp->db; max=rp->db; prev_count=count; //DVWRITELN("\n??? min:%f:%f:%d max:%f",min,rel_gate,rel_gatedb,max); continue; } #if 1 // [ if (prev_countdb; if (prev_countdb; break; } prev_count=count; #else // ] [ if (rp->dbdb; if (maxdb) max=rp->db; //DVWRITELN("??? %f:%f %f",rp->db,min,max); #endif // ] } } //DVWRITELN("!!! %f:%f (rel_gate:%f) %f",max-min,min,rel_gate,max); return isnan(max)||isnan(min)?0.0:max-min; } else return 0.0; #endif // ] } #endif // ] bs1770gain-0.9.8/lib1770-2/Makefile.in0000664000175000017500000004342015036407371013537 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #AM_CFLAGS= #AM_LDFLAGS= # #AM_CFLAGS+=-Werror #AM_CFLAGS+=-Wall #AM_CFLAGS+=-Wformat #AM_CFLAGS+=-Wpointer-arith #AM_CFLAGS+=-Wcast-align #AM_CFLAGS+=-Wcast-qual #AM_CFLAGS+=-Wreturn-type #AM_CFLAGS+=-Wextra #AM_CFLAGS+=-Wstrict-prototypes VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib1770-2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = lib1770_2_a_AR = $(AR) $(ARFLAGS) lib1770_2_a_LIBADD = am__objects_1 = am_lib1770_2_a_OBJECTS = $(am__objects_1) lib1770_biquad.$(OBJEXT) \ lib1770_block.$(OBJEXT) lib1770_pre.$(OBJEXT) \ lib1770_stats.$(OBJEXT) lib1770_2_a_OBJECTS = $(am_lib1770_2_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/lib1770_biquad.Po \ ./$(DEPDIR)/lib1770_block.Po ./$(DEPDIR)/lib1770_pre.Po \ ./$(DEPDIR)/lib1770_stats.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(lib1770_2_a_SOURCES) DIST_SOURCES = $(lib1770_2_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVCODEC_SO = @AVCODEC_SO@ AVFILTER_SO = @AVFILTER_SO@ AVFORMAT_SO = @AVFORMAT_SO@ AVUTIL_SO = @AVUTIL_SO@ AWK = @AWK@ BS1770GAIN_LDFLAGS = @BS1770GAIN_LDFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFMPEG_PREFIX = @FFMPEG_PREFIX@ FF_AVCODEC_V = @FF_AVCODEC_V@ FF_AVFILTER_V = @FF_AVFILTER_V@ FF_AVFORMAT_V = @FF_AVFORMAT_V@ FF_AVUTIL_V = @FF_AVUTIL_V@ FF_POSTPROC_V = @FF_POSTPROC_V@ FF_SWRESAMPLE_V = @FF_SWRESAMPLE_V@ FF_SWSCALE_V = @FF_SWSCALE_V@ GETOPTW_PREFIX = @GETOPTW_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSTPROC_SO = @POSTPROC_SO@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIR = @SODIR@ STRIP = @STRIP@ SWRESAMPLE_SO = @SWRESAMPLE_SO@ SWSCALE_SO = @SWSCALE_SO@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/libpbutil #AM_CFLAGS+=-g #AM_CFLAGS+=-ggdb #AM_LDFLAGS+=-static-libgcc #AM_LDFLAGS+=-static-libstdc++ #$(libffsox_2_a_OBJECTS): $(CONFIG_HEADER) #$(libffsox_2_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil.h #$(libffsox_2_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil_priv.h noinst_LIBRARIES = lib1770_2.a lib1770_2_a_SOURCES = $(CONFIG_HEADER) \ $(top_srcdir)/libpbutil/pbutil.h \ $(top_srcdir)/libpbutil/pbutil_priv.h lib1770.h \ lib1770_biquad.c lib1770_block.c lib1770_pre.c lib1770_stats.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib1770-2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib1770-2/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) lib1770_2.a: $(lib1770_2_a_OBJECTS) $(lib1770_2_a_DEPENDENCIES) $(EXTRA_lib1770_2_a_DEPENDENCIES) $(AM_V_at)-rm -f lib1770_2.a $(AM_V_AR)$(lib1770_2_a_AR) lib1770_2.a $(lib1770_2_a_OBJECTS) $(lib1770_2_a_LIBADD) $(AM_V_at)$(RANLIB) lib1770_2.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib1770_biquad.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib1770_block.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib1770_pre.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lib1770_stats.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/lib1770_biquad.Po -rm -f ./$(DEPDIR)/lib1770_block.Po -rm -f ./$(DEPDIR)/lib1770_pre.Po -rm -f ./$(DEPDIR)/lib1770_stats.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/lib1770_biquad.Po -rm -f ./$(DEPDIR)/lib1770_block.Po -rm -f ./$(DEPDIR)/lib1770_pre.Po -rm -f ./$(DEPDIR)/lib1770_stats.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bs1770gain-0.9.8/lib1770-2/lib1770_biquad.c0000755000175000017500000000406515035710477014256 00000000000000/* * lib1770_biquad.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include void lib1770_biquad_get_ps(const lib1770_biquad_t *biquad, lib1770_biquad_ps_t *ps) { double x11=biquad->a1-2; double x12=biquad->a1; double x1=-biquad->a1-2; double x21=biquad->a2-1; double x22=biquad->a2+1; double x2=-biquad->a2+1; double dx=x22*x11-x12*x21; double k_sq=(x22*x1-x12*x2)/dx; double k_by_q=(x11*x2-x21*x1)/dx; double a0=1.0+k_by_q+k_sq; ps->k=sqrt(k_sq); ps->q=ps->k/k_by_q; ps->vb=0.5*a0*(biquad->b0-biquad->b2)/k_by_q; ps->vl=0.25*a0*(biquad->b0+biquad->b1+biquad->b2)/k_sq; ps->vh=0.25*a0*(biquad->b0-biquad->b1+biquad->b2); } lib1770_biquad_t *lib1770_biquad_requantize(lib1770_biquad_t *out, const lib1770_biquad_t *in) { if (in->samplerate==out->samplerate) *out=*in; else { lib1770_biquad_ps_t ps; double k, k_sq, k_by_q, a0; double den_tmp; lib1770_biquad_get_ps(in, &ps); k=tan((in->samplerate/out->samplerate)*atan(ps.k)); k_sq=k*k; k_by_q=k/ps.q; a0=1.0+k_by_q+k_sq; out->a1=LIB1770_DEN((2.0*(k_sq-1.0))/a0); out->a2=LIB1770_DEN((1.0-k_by_q+k_sq)/a0); out->b0=LIB1770_DEN((ps.vh+ps.vb*k_by_q+ps.vl*k_sq)/a0); out->b1=LIB1770_DEN((2.0*(ps.vl*k_sq-ps.vh))/a0); out->b2=LIB1770_DEN((ps.vh-ps.vb*k_by_q+ps.vl*k_sq)/a0); } return out; } bs1770gain-0.9.8/lib1770-2/lib1770_block.c0000755000175000017500000000551715035710477014106 00000000000000/* * lib1770_block.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include lib1770_block_t *lib1770_block_new(double samplerate, double ms, int partition) { lib1770_block_t *block; LIB1770_GOTO(0==partition,"missing partition",partition); block=LIB1770_CALLOC(1,(sizeof *block)+LIB1770_AGG_BLOCK_SIZE(partition)); LIB1770_GOTO(NULL==block,"allocating bs.1770 block",block); block->next=NULL; block->stats=NULL; block->gate=LIB1770_SILENCE_GATE; block->partition=partition; block->length=0.001*ms; block->samplerate=samplerate; // 400/partition ms. block->overlap_size=round(block->length*samplerate/partition); // 400 ms. block->block_size=partition*block->overlap_size; block->scale=1.0/(double)block->block_size; block->ring.size=partition; block->ring.offs=0; block->ring.wmsq[block->ring.offs]=0.0; block->ring.count=0; block->ring.used=1; return block; //LIB1770_FREE(block); block: partition: return NULL; } void lib1770_block_close(lib1770_block_t *block) { LIB1770_FREE(block); } void lib1770_block_add_stats(lib1770_block_t *block, lib1770_stats_t *stats) { stats->next=block->stats; block->stats=stats; } void lib1770_block_add_sqs(lib1770_block_t *block, double wssqs) { double *wmsq=block->ring.wmsq; lib1770_stats_t *stats; if (1.0e-15<=wssqs) { double *wp=wmsq; double *mp=wp+block->ring.used; wssqs*=block->scale; while (wpring.count==block->overlap_size) { size_t next_offs=block->ring.offs+1; if (next_offs==block->ring.size) next_offs=0; if (block->ring.used==block->ring.size) { double prev_wmsq=wmsq[next_offs]; if (block->gatestats;NULL!=stats;stats=stats->next) #if defined (LIB1770_STATS_VMT) // { stats->vmt->add_sqs(stats,prev_wmsq); #else // } { lib1770_stats_add_sqs(stats,prev_wmsq); #endif // } } } block->ring.wmsq[next_offs]=0.0; block->ring.count=0; block->ring.offs=next_offs; if (block->ring.usedring.size) ++block->ring.used; } } bs1770gain-0.9.8/lib1770-2/lib1770.h0000755000175000017500000001510115035710477012727 00000000000000/* * lib1770.h * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __LIB1770_H__ // { #define __LIB1770_H__ #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /////////////////////////////////////////////////////////////////////////////// #if defined (_MSC_VER) && ! defined (__func__) // { #define __func__ __FUNCTION__ #endif // } #define LIB1770_CALLOC(n,size) \ calloc(n,size) #define LIB1770_FREE(p) \ free(p) #define LIB1770_MESSAGE(message) \ fprintf(stderr,"Error %s in %s() at \"%s\" (%d).\n",message, \ __func__,__FILE__,__LINE__) #define LIB1770_GOTO(condition,message,label) do { \ if (condition) { \ LIB1770_MESSAGE(message); \ goto label; \ } \ } while (0) /////////////////////////////////////////////////////////////////////////////// #define LIB1770_BUF_SIZE 9 #define LIB1770_MAX_CHANNELS 5 #if defined __GNUC__ // [ #define LIB1770_DEPRECATED __attribute__ ((deprecated)) #else // ] [ #define LIB1770_DEPRECATED #endif // ] #define LIB1770_Q2DB(q) \ (20.0*log10(q)) #define LIB1770_DB2Q(db) \ (pow(10.0,0.05*(db))) #define LIB1770_IS_DEN(x) \ (fabs(den_tmp=(x))<1.0e-15) #define LIB1770_DEN(x) \ (LIB1770_IS_DEN(x)?0.0:den_tmp) #define LIB1770_MIN(x,y) \ ((x)<(y)?(x):(y)) #define LIB1770_SILENCE \ (-70.0) #define LIB1770_SILENCE_GATE \ (pow(10.0,0.1*(0.691+LIB1770_SILENCE))) #define LIB1770_LUFS(x) \ (-0.691+10.0*log10(x)) #define LIB1770_LUFS_HIST(count,sum,reference) \ ((count)?LIB1770_LUFS((sum)/((double)(count))):(double)(reference)) #define LIB1770_AGG_BLOCK_SIZE(size) \ ((size)*sizeof(((lib1770_block_t *)NULL)->ring.wmsq[0])) /////////////////////////////////////////////////////////////////////////////// typedef double lib1770_sample_t[LIB1770_MAX_CHANNELS]; typedef unsigned long long lib1770_count_t; typedef struct lib1770_biquad lib1770_biquad_t; typedef struct lib1770_biquad_ps lib1770_biquad_ps_t; typedef struct lib1770_pre lib1770_pre_t; typedef struct lib1770_block lib1770_block_t; typedef struct lib1770_bin lib1770_bin_t; typedef struct lib1770_stats lib1770_stats_t; /////////////////////////////////////////////////////////////////////////////// struct lib1770_biquad { double samplerate; double a1,a2; double b0,b1,b2; }; struct lib1770_biquad_ps { double k; double q; double vb; double vl; double vh; }; void lib1770_biquad_get_ps(const lib1770_biquad_t *biquad, lib1770_biquad_ps_t *ps); lib1770_biquad_t *lib1770_biquad_requantize(lib1770_biquad_t *in, const lib1770_biquad_t *out); /////////////////////////////////////////////////////////////////////////////// struct lib1770_bin { double db; double x; double y; lib1770_count_t count; }; #define LIB1770_HIST_MIN (-70) #define LIB1770_HIST_MAX (+5) #define LIB1770_HIST_GRAIN (100) #define LIB1770_HIST_NBINS \ (LIB1770_HIST_GRAIN*(LIB1770_HIST_MAX-LIB1770_HIST_MIN)+1) struct lib1770_stats { lib1770_stats_t *next; struct { double wmsq; } max; struct { struct { double wmsq; // cumulative moving average. lib1770_count_t count; // number of blocks processed. } pass1; #if 0 // [ lib1770_bin_t bin[0]; #else // ] [ lib1770_bin_t bin[1]; #endif // ] } hist; }; #if ! defined (LIB1770_HIST_NBINS) // [ int lib1770_stats_create(lib1770_stats_t *stats); void lib1770_stats_destroy(lib1770_stats_t *stats); #endif // ] lib1770_stats_t *lib1770_stats_new(void); void lib1770_stats_close(lib1770_stats_t *stats); #define LIB1770_STATS_MERGE_FIX #if defined (LIB1770_STATS_MERGE_FIX) // [ void lib1770_stats_merge(lib1770_stats_t *lhs, const lib1770_stats_t *rhs); #else // ] [ void lib1770_stats_merge(lib1770_stats_t *lhs, lib1770_stats_t *rhs); #endif // ] void lib1770_stats_add_sqs(lib1770_stats_t *stats, double wmsq); double lib1770_stats_get_mean(lib1770_stats_t *stats, double gate); double lib1770_stats_get_range(lib1770_stats_t *stats, double gate, double lower, double upper); double lib1770_stats_get_max(lib1770_stats_t *stats); /////////////////////////////////////////////////////////////////////////////// // ITU BS.1770 sliding block (aggregator). struct lib1770_block { lib1770_block_t *next; lib1770_stats_t *stats; double gate; // ITU BS.1770 silence gate. double length; // ITU BS.1170 block length in ms int partition; // ITU BS.1770 partition, e.g. 4 (75%) double samplerate; size_t overlap_size; // depends on samplerate size_t block_size; // depends on samplerate double scale; // depends on block size, i.e. on samplerate struct { size_t size; // number of blocks in ring buffer. size_t used; // number of blocks used in ring buffer. size_t count; // number of samples processed in front block. size_t offs; // offset of front block. double wmsq[0]; // allocated blocks. } ring; }; lib1770_block_t *lib1770_block_new(double samplerate, double ms, int partition); void lib1770_block_close(lib1770_block_t *block); void lib1770_block_add_stats(lib1770_block_t *block, lib1770_stats_t *stats); void lib1770_block_add_sqs(lib1770_block_t *block, double wssqs); /////////////////////////////////////////////////////////////////////////////// // ITU BS.1770 pre-filter. struct lib1770_pre { lib1770_block_t *block; double samplerate; int channels; int lfe; lib1770_biquad_t f1; lib1770_biquad_t f2; struct { double buf[LIB1770_MAX_CHANNELS][LIB1770_BUF_SIZE]; int offs; int size; } ring; }; lib1770_pre_t *lib1770_pre_new(double samplerate, int channels); void lib1770_pre_close(lib1770_pre_t *pre); void lib1770_pre_add_block(lib1770_pre_t *pre, lib1770_block_t *block); void lib1770_pre_add_sample(lib1770_pre_t *pre, lib1770_sample_t sample); void lib1770_pre_flush(lib1770_pre_t *pre); #ifdef __cplusplus } #endif #endif // } bs1770gain-0.9.8/lib1770-2/Makefile.am0000755000175000017500000000172615035710477013535 00000000000000#AM_CFLAGS= #AM_LDFLAGS= # #AM_CFLAGS+=-Werror #AM_CFLAGS+=-Wall #AM_CFLAGS+=-Wformat #AM_CFLAGS+=-Wpointer-arith #AM_CFLAGS+=-Wcast-align #AM_CFLAGS+=-Wcast-qual #AM_CFLAGS+=-Wreturn-type #AM_CFLAGS+=-Wextra #AM_CFLAGS+=-Wstrict-prototypes ##AM_CFLAGS+=-Wmissing-declarations ##AM_CFLAGS+=-Wmissing-prototypes AM_CPPFLAGS= AM_CPPFLAGS+=-I$(top_srcdir)/libpbutil #AM_CFLAGS+=-g #AM_CFLAGS+=-ggdb #AM_LDFLAGS+=-static-libgcc #AM_LDFLAGS+=-static-libstdc++ #$(libffsox_2_a_OBJECTS): $(CONFIG_HEADER) #$(libffsox_2_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil.h #$(libffsox_2_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil_priv.h noinst_LIBRARIES=lib1770_2.a lib1770_2_a_SOURCES=$(CONFIG_HEADER) lib1770_2_a_SOURCES+=$(top_srcdir)/libpbutil/pbutil.h lib1770_2_a_SOURCES+=$(top_srcdir)/libpbutil/pbutil_priv.h lib1770_2_a_SOURCES+=lib1770.h lib1770_2_a_SOURCES+=lib1770_biquad.c lib1770_2_a_SOURCES+=lib1770_block.c lib1770_2_a_SOURCES+=lib1770_pre.c lib1770_2_a_SOURCES+=lib1770_stats.c bs1770gain-0.9.8/lib1770-2/lib1770_pre.c0000755000175000017500000001153315035710477013575 00000000000000/* * lib1770_pre.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// //#if defined (_MSC_VER) // { #define lib1770_get(offs,i) \ ((offs)+(i)<0?LIB1770_BUF_SIZE+(offs)+(i):(offs)+(i)) //#else // } { //inline int lib1770_get(int offs, int i) //{ // int j=offs+i; // // return j<0?LIB1770_BUF_SIZE+j:j; //} //#endif // } #define LIB1770_GET(buf,offs,i) \ ((buf)[lib1770_get(offs,i)]) #define LIB1770_GETX(buf,offs,i) \ LIB1770_GET(buf,offs,i) #define LIB1770_GETY(buf,offs,i) \ LIB1770_GET(buf,(offs)-6,i) #define LIB1770_GETZ(buf,offs,i) \ LIB1770_GET(buf,(offs)-3,i) /////////////////////////////////////////////////////////////////////////////// static double lib1770_g[LIB1770_MAX_CHANNELS]={ 1.0, 1.0, 1.0, 1.41, 1.41 }; static const lib1770_biquad_t *lib1770_f1_48000(void) { static lib1770_biquad_t biquad; if (0.0==biquad.samplerate) { biquad.samplerate=48000; biquad.a1=-1.69065929318241; biquad.a2=0.73248077421585; biquad.b0=1.53512485958697; biquad.b1=-2.69169618940638; biquad.b2=1.19839281085285; } return &biquad; } static const lib1770_biquad_t *lib1770_f2_48000(void) { static lib1770_biquad_t biquad; if (0.0==biquad.samplerate) { biquad.samplerate=48000; biquad.a1=-1.99004745483398; biquad.a2=0.99007225036621; biquad.b0=1.0; biquad.b1=-2.0; biquad.b2=1.0; } return &biquad; } /////////////////////////////////////////////////////////////////////////////// lib1770_pre_t *lib1770_pre_new(double samplerate, int channels) { lib1770_pre_t *pre; int i,ch; pre=LIB1770_CALLOC(1,sizeof *pre); LIB1770_GOTO(NULL==pre,"allocation bs.1770 pre-filter",epre); pre->block=NULL; // set the sample frequency. pre->samplerate=samplerate; // set the number of channals. pre->channels=channels; // requantize the f1-filter according to the sample frequency. pre->f1.samplerate=samplerate; lib1770_biquad_requantize(&pre->f1,lib1770_f1_48000()); // requantize the f2-filter according to the sample frequency. pre->f2.samplerate=samplerate; lib1770_biquad_requantize(&pre->f2,lib1770_f2_48000()); // initialize the pre buffer. for (i=0,ch=0;iring.buf[ch],0,0)=0.0; ++ch; } pre->ring.offs=1; pre->ring.size=pre->ring.offs; return pre; //LIB1770_FREE(pre); epre: return NULL; } void lib1770_pre_close(lib1770_pre_t *pre) { LIB1770_FREE(pre); } void lib1770_pre_add_block(lib1770_pre_t *pre, lib1770_block_t *block) { block->next=pre->block; pre->block=block; } void lib1770_pre_add_sample(lib1770_pre_t *pre, lib1770_sample_t sample) { lib1770_biquad_t *f1=&pre->f1; lib1770_biquad_t *f2=&pre->f2; double wssqs=0.0; double *g=lib1770_g; int channels=pre->channels; int offs=pre->ring.offs; int size=pre->ring.size; int i,ch; lib1770_block_t *block; double den_tmp; double *buf; double x; for (i=0,ch=0;iring.buf[ch]; x=LIB1770_GETX(buf,offs,0)=LIB1770_DEN(sample[ch]); if (1b0*x +f1->b1*LIB1770_GETX(buf,offs,-1)+f1->b2*LIB1770_GETX(buf,offs,-2) -f1->a1*LIB1770_GETY(buf,offs,-1)-f1->a2*LIB1770_GETY(buf,offs,-2)) ; double z=LIB1770_GETZ(buf,offs,0)=LIB1770_DEN(f2->b0*y +f2->b1*LIB1770_GETY(buf,offs,-1)+f2->b2*LIB1770_GETY(buf,offs,-2) -f2->a1*LIB1770_GETZ(buf,offs,-1)-f2->a2*LIB1770_GETZ(buf,offs,-2)) ; wssqs+=(*g++)*z*z; ++buf; } ++ch; } for (block=pre->block;NULL!=block;block=block->next) lib1770_block_add_sqs(block,wssqs); if (size<2) ++pre->ring.size; if (++pre->ring.offs==LIB1770_BUF_SIZE) pre->ring.offs=0; } void lib1770_pre_flush(lib1770_pre_t *pre) { int channels=pre->channels; lib1770_sample_t sample; int i,ch; if (1ring.size) { for (i=0,ch=0;i #if defined (PBU_TRACE) // [ #include #include #include static int _pbu_trc_depth=0; void pbu_trc_indent(void) { int i; for (i=0;i<_pbu_trc_depth;++i) fputs(" ",stderr); } const char *pbu_basename(const char *path); void pbu_trc_depth(const char *path, int line) { pbu_trc_indent(); fprintf(stderr,"%s:%d DEPTH %d\n",pbu_basename(path),line,_pbu_trc_depth); fflush(stderr); } void pbu_trc_enter_line(const char *path, int line) { pbu_trc_indent(); fprintf(stderr,"%s:%d {\n",pbu_basename(path),line); fflush(stderr); _pbu_trc_depth++; } void pbu_trc_enter(const char *id) { pbu_trc_indent(); fprintf(stderr,"%s {\n",id); fflush(stderr); _pbu_trc_depth++; } void pbu_trc_leave(void) { _pbu_trc_depth--; pbu_trc_indent(); fputs("}\n",stderr); fflush(stderr); } FILE *pbu_trc_line(const char *path, int line) { pbu_trc_indent(); fprintf(stderr,"%s:%d ",pbu_basename(path), line); fflush(stderr); return stderr; } void pbu_trc_printf(const char *format, ...) { va_list ap; pbu_trc_indent(); va_start (ap,format); vfprintf(stderr,format,ap); va_end (ap); fflush(stderr); } void pbu_trc_puts(const char *path, int line, const char *s) { pbu_trc_indent(); fprintf(stderr,"%s:%d %s\n",pbu_basename(path), line, s); fflush(stderr); } int pbu_trc_return_int(const char *path, int line, int ret) { pbu_trc_indent(); fprintf(stderr,"%s:%d return %d;\n",pbu_basename(path), line, ret); --_pbu_trc_depth; pbu_trc_indent(); fputs("}\n",stderr); fflush(stderr); return ret; } #endif // ] bs1770gain-0.9.8/libpbutil/pbu_vwritelnw.c0000755000175000017500000000302115035710477015304 00000000000000/* * pbu_vwritelnw.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #if defined (_WIN32) // [ void pbu_vwritelnw(FILE *f, const char *path, int line, const char *func, const wchar_t *format, ...) { va_list ap; #if ! defined (PBU_BASENAME_UNICODE) // [ const char *p; #endif // ] if (format) { va_start(ap,format); vfwprintf(f,format,ap); va_end(ap); } if (path) { if (format) fputs(" (",f); path=pbu_basename(path); #if defined (PBU_BASENAME_UNICODE) // [ fprintf(f,"%s:%d:%s",path,line,func); #else // ] [ p=path+strlen(path); while (path * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include void pbu_vwritelna(FILE *f, const char *path, int line, const char *func, const char *format, ...) { va_list ap; #if ! defined (PBU_BASENAME_UNICODE) // [ const char *p; #endif // ] if (format) { #if 0 // [ p=path+strlen(path); while (path * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __PBUTIL_H__ #define __PBUTIL_H__ // { #if defined (HAVE_CONFIG_H) // { #include #endif // } #if defined (_WIN32) // { #include #endif // } #include #include #include #ifdef __cpluplus extern "C" { #endif /////////////////////////////////////////////////////////////////////////////// #if defined (HAVE_PBU_TRACE) // [ //#define PBU_DEBUG #define PBU_TRACE #endif // ] #define PBU_MESSAGE_AV_LOG #define PBU_LIST_RING /////////////////////////////////////////////////////////////////////////////// #if defined (PBU_TRACE) // [ void pbu_trc_depth(const char *path, int line); void pbu_trc_enter(const char *id); FILE *pbu_trc_line(const char *path, int line); void pbu_trc_enter_line(const char *path, int line); void pbu_trc_leave(void); int pbu_trc_return_int(const char *path, int line, int ret); #define ENTER(id) \ pbu_trc_enter(id) #define DEPTH(path,line) \ pbu_trc_depth(path,line) #define ENTER_LINE(path,line) \ pbu_trc_enter_line(path,line) #define PRINTF(path,line,format,__VARGS__) \ fprintf(pbu_trc_line(path,line),format,__VARGS__) #define PUTS(path,line,s) \ fprintf(pbu_trc_line(path,line),"%s",s) #define LEAVE() \ pbu_trc_leave() #define RETURN_INT(path,line,ret) \ pbu_trc_return_int(path,line,ret) #else // ] [ #define ENTER(id) #define DEPTH(path,line) #define ENTER_LINE(path,line) #define LEAVE() #define RETURN_INT(path,line,ret) (ret) #define PRINTF(path,line,format,__VARGS__) #define PUTS(path,line,s) #endif // ] /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // { #define PBU_WIDEN2(x) L ## x #define PBU_WIDEN(x) PBU_WIDEN2(x) #define __func__ __FUNCTION__ #endif // } #define _PBU_STR(s) #s #define PBU_STR(s) _PBU_STR(s) /////////////////////////////////////////////////////////////////////////////// #define PBU_FREE_GUARDED(p) \ ((p)?free(p),(p)=NULL:(p)) /////////////////////////////////////////////////////////////////////////////// #define __DMESSAGE(format) (\ av_log(NULL, AV_LOG_ERROR,"Error: " format " (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__)\ ) #define __DMESSAGEV(format,...) (\ av_log(NULL, AV_LOG_ERROR,"Error: " format " (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__)\ ) #define __DWARNING(format) (\ av_log(NULL, AV_LOG_WARNING,"Warning: " format " (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__)\ ) #define __DWARNINGV(format,...) (\ av_log(NULL, AV_LOG_WARNING,"Warning: " format " (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__)\ ) /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ #define PBU_PRIs "S" #define _FPRINTF(f,format) (\ fwprintf(f,L##format),\ fflush(f)\ ) #define _FPRINTFV(f,format,...) (\ fwprintf(f,L##format,__VA_ARGS__),\ fflush(f)\ ) //#if defined (PBU_MESSAGE_AV_LOG) // [ //#else // ] [ #define _DMESSAGE(format) (\ fwprintf(stderr,L"Error: " L##format L" (%s:%s:%s)\n",\ pbu_basename(__FILE__),PBU_STR(__LINE__),__func__),\ fflush(stderr)\ ) #define _DMESSAGEV(format,...) (\ fwprintf(stderr,L"Error: " L##format L" (%s:%s:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),PBU_STR(__LINE__),__func__),\ fflush(stderr)\ ) #define _DWARNING(format) (\ fwprintf(stderr,L"Warning: " L##format L" (%s:%s:%s)\n", \ pbu_basename(__FILE__),PBU_STR(__LINE__),__func__),\ fflush(stderr)\ ) #define _DWARNINGV(format,...) (\ fwprintf(stderr,L"Warning: " L##format L" (%s:%s:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),PBU_STR(__LINE__),__func__),\ fflush(stderr)\ ) //#endif // ] #define _SNPRINTF(s,size,format,...) snwprintf(s,size,L##format,__VA_ARGS__) #define _MARKLN() {\ fwprintf(stderr,L"%s:%d:%s\n",pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #define _WRITELN(format) {\ fwprintf(stderr,L##format L" (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #define _WRITELNV(format,...) {\ fwprintf(stderr,L##format L" (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #else // ] [ #define PBU_PRIs "s" #define _FPRINTF(f,format) fprintf(f,format) #define _FPRINTFV(f,format,...) fprintf(f,format,__VA_ARGS__) #define _DMESSAGE(format) fprintf(stderr,\ "Error: " format " (%s:%s:%s)\n",\ pbu_basename(__FILE__),PBU_STR(__LINE__),__func__) #define _DMESSAGEV(format,...) fprintf(stderr,\ "Error: " format " (%s:%s:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),PBU_STR(__LINE__),__func__) #define _DWARNING(format) fprintf(stderr,\ "Warning: " format " (%s:%s:%s)\n", \ pbu_basename(__FILE__),PBU_STR(__LINE__),__func__) #define _DWARNINGV(format,...) fprintf(stderr,\ "Warning: " format " (%s:%s:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),PBU_STR(__LINE__),__func__) #define _SNPRINTF(s,size,format,...) snprintf(s,size,format,__VA_ARGS__) #define _MARKLN() fprintf(stderr,"%s:%d:%s\n",\ pbu_basename(__FILE__),__LINE__,__func__) #define _WRITELN(format) fprintf(stderr,\ format " (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__) #define _WRITELNV(format,...) fprintf(stderr,\ format " (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__) #endif // ] #if ! defined (DEBUG) && ! defined (PBU_DEBUG) // [ #define _DMARKLN() #define _DWRITELN(f,format) #define _DWRITELNV(f,format,...) #elif defined (_WIN32) // ] [ #define _DMARKLN() {\ fwprintf(stderr,L"%s:%d:%s\n",pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #define _DWRITELN(format) {\ fwprintf(stderr,L##format L" (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #define _DWRITELNV(format,...) {\ fwprintf(stderr,L##format L" (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__);\ fflush(stderr);\ } #else // ] [ #define _DMARKLN() fprintf(stderr,"%s:%d:%s\n",\ pbu_basename(__FILE__),__LINE__,__func__) #define _DWRITELN(format) fprintf(stderr,\ format " (%s:%d:%s)\n",\ pbu_basename(__FILE__),__LINE__,__func__) #define _DWRITELNV(format,...) fprintf(stderr,\ format " (%s:%d:%s)\n",\ __VA_ARGS__,pbu_basename(__FILE__),__LINE__,__func__) #endif // ] /////////////////////////////////////////////////////////////////////////////// //#define PBU_MALLOC_DEBUG #if defined (PBU_MALLOC_DEBUG) // { #define PBU_TRACE_PUSH() \ pbu_trace_push(__func__) #define PBU_TRACE_POP() \ pbu_trace_pop() #define PBU_HEAP_PRINT() \ pbu_heap_print() #if defined (_WIN32) // { #define _PBU_WCSDUP(str) \ _pbu_wcsdup(__func__,pbu_basename(__FILE__),__LINE__,str) #endif // } #define PBU_STRDUP(str) \ pbu_strdup(__func__,pbu_basename(__FILE__),__LINE__,str) #define PBU_MALLOC(size) \ pbu_malloc(__func__,pbu_basename(__FILE__),__LINE__,size) #define PBU_CALLOC(num,size) \ pbu_calloc(__func__,pbu_basename(__FILE__),__LINE__,num,size) #define PBU_REALLOC(ptr,size) \ pbu_realloc(__func__,pbu_basename(__FILE__),__LINE__,ptr,size) #define PBU_FREE(ptr) \ pbu_free(__func__,pbu_basename(__FILE__),__LINE__,ptr) #define PBU_FREE_PTR pbu_free1 #else // } { #define PBU_TRACE_PUSH() #define PBU_TRACE_POP() #define PBU_HEAP_PRINT() #if defined (_WIN32) // { #define _PBU_WCSDUP(str) _wcsdup(str) #endif // } #define PBU_STRDUP(str) strdup(str) #define PBU_MALLOC(size) malloc(size) #define PBU_CALLOC(num,size) calloc(num,size) #define PBU_REALLOC(ptr,size) realloc(ptr,size) #define PBU_FREE(ptr) free(ptr) #define PBU_FREE_PTR free #endif // } /////////////////////////////////////////////////////////////////////////////// #define PBU_MIN(x,y) ((x)<(y)?(x):(y)) #define PBU_MAXOF(T) \ (~(~0ull<<(((sizeof (T))<<3)-1))) #if defined (_WIN32) // { #define wcstok_r(str,delim,saveptr) pbu_wcstok_r(str,delim,saveptr) #define strtok_r(str,delim,saveptr) pbu_strtok_r(str,delim,saveptr) #endif // } #if defined (_MSC_VER) // { #define strcasecmp(s1,s2) stricmp(s1,s2) //#define round(x) floor((x)+0.5) #define S_ISDIR(st_mode) (_S_IFDIR&(st_mode)) #define S_ISREG(st_mode) (_S_IFREG&(st_mode)) #endif // } /////////////////////////////////////////////////////////////////////////////// #if ! defined (PBU_PRINT_MACROS) // [ #define PBU_ERROR(m) "Error: " m "." #define PBU_WARNING(m) "Warning: " m "." #define PBU_DMESSAGE(m) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,PBU_ERROR(m),NULL) #define PBU_DVMESSAGE(m,...) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,PBU_ERROR(m),__VA_ARGS__) #if defined (_WIN32) // [ #define PBU_ERRORW(m) L"Error: " m L"." #define PBU_DMESSAGEW(m) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,PBU_ERRORW(m),NULL) #define PBU_DVMESSAGEW(m,...) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,PBU_ERRORW(m),__VA_ARGS__) #endif // ] #define PBU_DWARNING(m) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,PBU_WARNING(m),NULL) #define PBU_DVWARNING(m,...) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,PBU_WARNING(m),__VA_ARGS__) #if defined (_WIN32) // [ #define PBU_WARNINGW(m) L"Warning: " m L"." #define PBU_DWARNINGW(m) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,PBU_WARNINGW(m),NULL) #define PBU_DVWARNINGW(m,...) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,PBU_WARNINGW(m),\ __VA_ARGS__) #endif // ] #if defined (PBU_DEBUG) // [ #define PBU_DMARKLN() \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,NULL) #define PBU_DWRITELN(cs) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,cs) #define PBU_DVWRITELN(format, ...) \ pbu_vwritelna(stderr,__FILE__,__LINE__,__func__,format,__VA_ARGS__) #if defined (_WIN32) // [ #define PBU_DWRITELNW(cs) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,cs) #define PBU_DVWRITELNW(format, ...) \ pbu_vwritelnw(stderr,__FILE__,__LINE__,__func__,format,__VA_ARGS__) #endif // ] #define PBU_DPUTS(cs) \ fputs(cs,stderr) #define PBU_DPRINTF(cs,...) \ fprintf(stderr,cs,__VA_ARGS__) #define PBU_DPUTWS(ws) \ fputws(ws,stderr) #define PBU_DWPRINTF(ws,...) \ fwprintf(stderr,ws,__VA_ARGS__) #define PBU_DERROR(x,y) \ ((void)((x)==(y)&&fputs(#x "\n",stderr))) #define PBU_DDPUTS(debug,cs) \ ((debug)&&PBU_DPUTS(cs)) #define PBU_DDPRINTF(debug,cs,...) \ ((debug)&&PBU_DPRINTF(cs,__VA_ARGS__)) #define PBU_DDPUTWS(debug,ws) \ ((debug)&&DPUTWS(ws)) #define PBU_DDWPRINTF(debug,ws,...) \ ((debug)&&PBU_DWPRINTF(ws,__VA_ARGS__)) #define PBU_DDERROR(debug,x,y) \ ((debug)&&PBU_DERROR(x,y)) #define PBU_DDMESSAGE(debug,m) \ ((debug)&&PBU_DMESSAGE(m)) #define PBU_DDVDMESSAGE(debug,m,...) \ ((debug)&&PBU_DVMESSAGE(m,__VA_ARGS__)) #else // ] [ #define PBU_DMARKLN() #define PBU_DWRITELN(cs) #define PBU_DVWRITELN(format, ...) #if defined (_WIN32) // [ #define PBU_DWRITELNW(cs) #define PBU_DVWRITELNW(format, ...) #endif // ] #define PBU_DPUTS(cs) #define PBU_DPRINTF(cs,...) #define PBU_DPUTWS(ws) #define PBU_DWPRINTF(ws,...) #if defined (PBU_MESSAGE) // [ #define PBU_DERROR(debug,x,y) \ ((void)((x)==(y)&&pbu_message(#x ": \"%s\" (%d).", \ pbu_basename(__FILE__),__LINE__))) #else // ] [ #define PBU_DERROR(x,y) #endif // ] //// #define PBU_DDPUTS(debug,cs) #define PBU_DDPRINTF(debug,cs,...) #define PBU_DDPUTWS(debug,ws) #define PBU_DDWPRINTF(debug,ws,...) #if defined (PBU_MESSAGE) // [ #define PBU_DDERROR(debug,x,y) \ ((debug)&&PBU_DERROR(x,y) #else // ] [ #define PBU_DDERROR(debug,x,y) #endif // ] #define PBU_DDMESSAGE(debug,m) #define PBU_DDMESSAGEV(debug,m,...) #endif // ] #endif // ] /////////////////////////////////////////////////////////////////////////////// typedef struct pbu_list pbu_list_t; /////////////////////////////////////////////////////////////////////////////// #if defined (PBU_MALLOC_DEBUG) // { void pbu_trace_indent(void); void pbu_trace_puts(const char *str); void pbu_trace_push(const char *func); void pbu_trace_pop(void); void pbu_heap_print(void); #if defined (_WIN32) // { wchar_t *_pbu_wcsdup(const char *func, const char *file, int line, const wchar_t *str); #endif // } char *pbu_strdup(const char *func, const char *file, int line, const char *str); void *pbu_malloc(const char *func, const char *file, int line, size_t size); void *pbu_calloc(const char *func, const char *file, int line, size_t num, size_t size); void *pbu_realloc(const char *func, const char *file, int line, void *ptr, size_t size); void pbu_free1(void *ptr); void pbu_free(const char *func, const char *file, int line, void *ptr); #endif // } //#define PBU_BASENAME_UNICODE #if defined (_WIN32) // [ HANDLE pbu_msvcrt(void); wchar_t *pbu_wcstok_r(wchar_t *str, const wchar_t *delim, wchar_t **saveptr); char *pbu_strtok_r(char *str, const char *delim, char **saveptr); int pbu_copy_file(const wchar_t *src, const wchar_t *dst); wchar_t *pbu_s2w(const char *s); char *pbu_w2s(const wchar_t *w); const char *pbu_message(const char *format, ...); const wchar_t *pbu_wbasename(const wchar_t *wpath); void pbu_vwritelnw(FILE *f, const char *path, int line, const char *func, const wchar_t *format, ...); #else // ] [ int pbu_copy_file(const char *src, const char *dst); #endif // ] void pbu_vwritelna(FILE *f, const char *path, int line, const char *func, const char *format, ...); int pbu_same_file(const char *path1, const char *path2); char *pbu_extend_path(const char *dirname, const char *basename); const char *pbu_ext(const char *path); // we don't understand why the following prototype isn't visible // in "pbu_trace.c". const char *pbu_basename(const char *path); void pbu_mkdir(char *path); /// list ////////////////////////////////////////////////////////////////////// #define PBU_LIST_APPEND(l,n) \ pbu_list_append(&(l),&(n),sizeof (n)) #define PBU_LIST_NEXT(n,l) \ (*(n)=(*(n)==NULL||(l)==(*(n))->next?NULL:(*(n))->next)) #define PBU_LIST_FOREACH(n,l) \ for (*(n)=(l);NULL!=*(n);PBU_LIST_NEXT(n,l)) struct pbu_list { #define PBU_LIST_MEM(T) \ T *prev; \ T *next; PBU_LIST_MEM(pbu_list_t) }; void *pbu_list_create(void *node); int pbu_list_append(void *head, void *node, size_t size); #if defined (PBU_LIST_RING) // [ void *pbu_list_remove_link(void *head, void *node); #endif // ] void pbu_list_free_full(void *head, void *free_func); void pbu_list_free(void *head); #ifdef __cpluplus } #endif #endif // } bs1770gain-0.9.8/libpbutil/Makefile.in0000664000175000017500000004437515036407371014313 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_PBU_TRACE_TRUE@am__append_1 = pbu_trace.c subdir = libpbutil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libpbutil_a_AR = $(AR) $(ARFLAGS) libpbutil_a_LIBADD = am__libpbutil_a_SOURCES_DIST = $(top_builddir)/config.h pbutil.h \ pbutil_priv.h pbu_trace.c pbu_basename.c pbu_msvcrt.c \ pbu_strtok.c pbu_vwritelna.c pbu_vwritelnw.c am__objects_1 = @HAVE_PBU_TRACE_TRUE@am__objects_2 = pbu_trace.$(OBJEXT) am_libpbutil_a_OBJECTS = $(am__objects_1) $(am__objects_2) \ pbu_basename.$(OBJEXT) pbu_msvcrt.$(OBJEXT) \ pbu_strtok.$(OBJEXT) pbu_vwritelna.$(OBJEXT) \ pbu_vwritelnw.$(OBJEXT) libpbutil_a_OBJECTS = $(am_libpbutil_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pbu_basename.Po \ ./$(DEPDIR)/pbu_msvcrt.Po ./$(DEPDIR)/pbu_strtok.Po \ ./$(DEPDIR)/pbu_trace.Po ./$(DEPDIR)/pbu_vwritelna.Po \ ./$(DEPDIR)/pbu_vwritelnw.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libpbutil_a_SOURCES) DIST_SOURCES = $(am__libpbutil_a_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVCODEC_SO = @AVCODEC_SO@ AVFILTER_SO = @AVFILTER_SO@ AVFORMAT_SO = @AVFORMAT_SO@ AVUTIL_SO = @AVUTIL_SO@ AWK = @AWK@ BS1770GAIN_LDFLAGS = @BS1770GAIN_LDFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFMPEG_PREFIX = @FFMPEG_PREFIX@ FF_AVCODEC_V = @FF_AVCODEC_V@ FF_AVFILTER_V = @FF_AVFILTER_V@ FF_AVFORMAT_V = @FF_AVFORMAT_V@ FF_AVUTIL_V = @FF_AVUTIL_V@ FF_POSTPROC_V = @FF_POSTPROC_V@ FF_SWRESAMPLE_V = @FF_SWRESAMPLE_V@ FF_SWSCALE_V = @FF_SWSCALE_V@ GETOPTW_PREFIX = @GETOPTW_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSTPROC_SO = @POSTPROC_SO@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIR = @SODIR@ STRIP = @STRIP@ SWRESAMPLE_SO = @SWRESAMPLE_SO@ SWSCALE_SO = @SWSCALE_SO@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libpbutil.a #libpbutil_a_SOURCES+=pbu_copy_file.c #libpbutil_a_SOURCES+=pbu_ext.c #libpbutil_a_SOURCES+=pbu_extend_path.c #libpbutil_a_SOURCES+=pbu_list.c #libpbutil_a_SOURCES+=pbu_malloc.c #libpbutil_a_SOURCES+=pbu_mkdir.c #libpbutil_a_SOURCES+=pbu_s2w.c #libpbutil_a_SOURCES+=pbu_w2s.c #libpbutil_a_SOURCES+=pbu_same_file.c #libpbutil_a_SOURCES+=pbu_trace.c #libpbutil_a_SOURCES+=pbu_wcstok.c libpbutil_a_SOURCES = $(CONFIG_HEADER) pbutil.h pbutil_priv.h \ $(am__append_1) pbu_basename.c pbu_msvcrt.c pbu_strtok.c \ pbu_vwritelna.c pbu_vwritelnw.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libpbutil/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libpbutil/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libpbutil.a: $(libpbutil_a_OBJECTS) $(libpbutil_a_DEPENDENCIES) $(EXTRA_libpbutil_a_DEPENDENCIES) $(AM_V_at)-rm -f libpbutil.a $(AM_V_AR)$(libpbutil_a_AR) libpbutil.a $(libpbutil_a_OBJECTS) $(libpbutil_a_LIBADD) $(AM_V_at)$(RANLIB) libpbutil.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_msvcrt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_strtok.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_trace.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_vwritelna.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pbu_vwritelnw.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pbu_basename.Po -rm -f ./$(DEPDIR)/pbu_msvcrt.Po -rm -f ./$(DEPDIR)/pbu_strtok.Po -rm -f ./$(DEPDIR)/pbu_trace.Po -rm -f ./$(DEPDIR)/pbu_vwritelna.Po -rm -f ./$(DEPDIR)/pbu_vwritelnw.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pbu_basename.Po -rm -f ./$(DEPDIR)/pbu_msvcrt.Po -rm -f ./$(DEPDIR)/pbu_strtok.Po -rm -f ./$(DEPDIR)/pbu_trace.Po -rm -f ./$(DEPDIR)/pbu_vwritelna.Po -rm -f ./$(DEPDIR)/pbu_vwritelnw.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bs1770gain-0.9.8/libpbutil/pbutil_priv.h0000755000175000017500000000703515035710477014752 00000000000000/* * pbutil_priv.h * Copyright (C) 2015 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #ifndef __PBUTIL_PRIV_H__ #define __PBUTIL_PRIV_H__ // { #include #ifdef __cpluplus extern "C" { #endif #if ! defined (PBU_PRINT_MACROS) // [ /////////////////////////////////////////////////////////////////////////////// #define DMARKLN() PBU_DMARKLN() #define DWRITELN(cs) PBU_DWRITELN(cs) #define DVWRITELN(format,...) PBU_DVWRITELN(format,__VA_ARGS__) #if defined (_WIN32) // [ #define DWRITELNW(cs) PBU_DWRITELNW(cs) #define DVWRITELNW(format,...) PBU_DVWRITELNW(format,__VA_ARGS__) #endif // ] #define DPUTS(cs) PBU_DPUTS(cs) #define DPRINTF(cs,...) PBU_DPRINTF(cs,__VA_ARGS__) #define DPUTWS(ws) PBU_DPUTWS(ws) #define DWPRINTF(ws,...) PBU_DWPRINTF(ws,__VA_ARGS__) #define DERROR(x,y) PBU_DERROR(x,y) #define DMESSAGE(m) PBU_DMESSAGE(m) #define DVMESSAGE(m,...) PBU_DVMESSAGE(m,__VA_ARGS__) #define DVMESSAGEW(m,...) PBU_DVMESSAGEW(m,__VA_ARGS__) #define DWARNING(m) PBU_DWARNING(m) #define DVWARNING(m,...) PBU_DVWARNING(m,__VA_ARGS__) #define DVWARNINGW(m,...) PBU_DVWARNINGW(m,__VA_ARGS__) #define DDPUTS(debug,cs) PBU_DDPUTS(debug,cs) #define DDPRINTF(debug,cs,...) PBU_DDPRINTF(debug,cs,__VA_ARGS__) #define DDPUTWS(debug,ws) PBU_DDPUTWS(debug,ws) #define DDWPRINTF(debug,ws,...) PBU_DDWPRINTF(debug,ws,__VA_ARGS__) #define DDERROR(debug,x,y) PBU_DDERROR(debug,x,y) #define DDMESSAGE(debug,m) PBU_DDMESSAGE(debug,m) #define DDVMESSAGE(debug,m,...) PBU_DDVMESSAGE(debug,m,__VA_ARGS__) /////////////////////////////////////////////////////////////////////////////// #define TRACE_PUSH() PBU_TRACE_PUSH() #define TRACE_POP() PBU_TRACE_POP() #define HEAP_PRINT() PBU_HEAP_PRINT() #if defined (_WIN32) // { #define _WCSDUP(str) _PBU_WCSDUP(str) #endif // } #define STRDUP(str) PBU_STRDUP(str) #define MALLOC(size) PBU_MALLOC(size) #define CALLOC(num,size) PBU_CALLOC(num,size) #define REALLOC(ptr,size) PBU_REALLOC(ptr,size) #define FREE(ptr) PBU_FREE(ptr) /////////////////////////////////////////////////////////////////////////////// #define MAXOF(T) PBU_MAXOF(T) /////////////////////////////////////////////////////////////////////////////// #define LIST_APPEND(l,n) PBU_LIST_APPEND(l,n) #define LIST_NEXT(n,l) PBU_LIST_NEXT(n,l) #define LIST_FOREACH(n,l) PBU_LIST_FOREACH(n,l) #endif // ] /////////////////////////////////////////////////////////////////////////////// typedef pbu_list_t list_t; #ifdef __cpluplus } #endif #endif // } bs1770gain-0.9.8/libpbutil/pbu_strtok.c0000755000175000017500000000313415035710477014576 00000000000000/* * pbu_strtok.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if defined (_WIN32) // { #include static char *pbu_strtok(char *str, const char *delim, char **saveptr) { (void)saveptr; return strtok(str,delim); } char *pbu_strtok_r(char *str, const char *delim, char **saveptr) { typedef char *(*strtok_s_t)(char *,const char *,char **); static strtok_s_t strtok_s=NULL; HANDLE hLib; if (NULL==strtok_s) { if (NULL==(hLib=pbu_msvcrt())) goto strtok; #if 0 && (! defined (__GNUC__) || ! defined (_WIN64)) // [ if (NULL==(strtok_s=(strtok_s_t)GetProcAddress(hLib,"strtok_s"))) goto strtok; #else // ] [ if (NULL==(strtok_s=(void *)GetProcAddress(hLib,"strtok_s"))) goto strtok; #endif // ] goto strtok_s; strtok: strtok_s=pbu_strtok; goto strtok_s; } strtok_s: return strtok_s(str,delim,saveptr); } #endif // } bs1770gain-0.9.8/libpbutil/pbu_msvcrt.c0000755000175000017500000000173615035710477014574 00000000000000/* * pbu_strtok.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if defined (_WIN32) // { #include HANDLE pbu_msvcrt(void) { static HANDLE hLib=NULL; if (NULL==hLib) hLib=LoadLibraryA("msvcrt.dll"); return hLib; } #endif // } bs1770gain-0.9.8/libpbutil/pbu_basename.c0000755000175000017500000000541315035710477015025 00000000000000/* * pbu_basename.c * Copyright (C) 2014 Peter Belkner * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (PBU_BASENAME_UNICODE) // [ static const char *pathnorm(const char *path) { int len=strlen(path); char *sp=NULL; char *pp[2]={ 0 },*p; const char *ss; char clone[PATH_MAX]; #if defined (_WIN32) // [ if (2. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bs1770gain-0.9.8/Makefile.in0000664000175000017500000006546615036407371012331 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog NEWS README ar-lib compile config.guess \ config.sub depcomp install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVCODEC_SO = @AVCODEC_SO@ AVFILTER_SO = @AVFILTER_SO@ AVFORMAT_SO = @AVFORMAT_SO@ AVUTIL_SO = @AVUTIL_SO@ AWK = @AWK@ BS1770GAIN_LDFLAGS = @BS1770GAIN_LDFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFMPEG_PREFIX = @FFMPEG_PREFIX@ FF_AVCODEC_V = @FF_AVCODEC_V@ FF_AVFILTER_V = @FF_AVFILTER_V@ FF_AVFORMAT_V = @FF_AVFORMAT_V@ FF_AVUTIL_V = @FF_AVUTIL_V@ FF_POSTPROC_V = @FF_POSTPROC_V@ FF_SWRESAMPLE_V = @FF_SWRESAMPLE_V@ FF_SWSCALE_V = @FF_SWSCALE_V@ GETOPTW_PREFIX = @GETOPTW_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSTPROC_SO = @POSTPROC_SO@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIR = @SODIR@ STRIP = @STRIP@ SWRESAMPLE_SO = @SWRESAMPLE_SO@ SWSCALE_SO = @SWSCALE_SO@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # according to the automake manual: # Automake generates Makefiles that work depth-first in postfix order SUBDIRS = \ libpbutil\ lib1770-2\ libff\ libbg all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @FF_DYNLOAD_FALSE@install-exec-hook: @FF_DYNLOAD_FALSE@uninstall-hook: clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) all install-am install-exec-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-exec-hook install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-am uninstall uninstall-am uninstall-hook .PRECIOUS: Makefile #libffsox-2 #bs1770gain #dist-hook: # mkdir -p $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVUTIL_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(SWRESAMPLE_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(SWSCALE_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVCODEC_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVFORMAT_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(POSTPROC_SO) $(distdir)/bs1770gain-tools # cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVFILTER_SO) $(distdir)/bs1770gain-tools @FF_DYNLOAD_TRUE@install-exec-hook: @FF_DYNLOAD_TRUE@ mkdir -p $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVUTIL_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(SWRESAMPLE_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(SWSCALE_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVCODEC_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVFORMAT_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@@HAVE_LIBPOSTPROC_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(POSTPROC_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@ cp -p $(FFMPEG_PREFIX)/$(SODIR)/$(AVFILTER_SO) $(DESTDIR)$(bindir)/bs1770gain-tools @FF_DYNLOAD_TRUE@uninstall-hook: @FF_DYNLOAD_TRUE@ rm -rf $(DESTDIR)$(bindir)/bs1770gain-tools # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bs1770gain-0.9.8/install-sh0000755000175000017500000003577615036407371012267 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bs1770gain-0.9.8/configure0000775000175000017500000071514215036407370012163 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for bs1770gain 0.9.8. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and info@pbelkner.de $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bs1770gain' PACKAGE_TARNAME='bs1770gain' PACKAGE_VERSION='0.9.8' PACKAGE_STRING='bs1770gain 0.9.8' PACKAGE_BUGREPORT='info@pbelkner.de' PACKAGE_URL='http://pbelkner.de/' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS BS1770GAIN_LDFLAGS AVFILTER_SO POSTPROC_SO AVFORMAT_SO AVCODEC_SO SWSCALE_SO SWRESAMPLE_SO AVUTIL_SO SODIR GETOPTW_PREFIX FF_AVFILTER_V FF_POSTPROC_V FF_SWSCALE_V FF_SWRESAMPLE_V FF_AVFORMAT_V FF_AVCODEC_V FF_AVUTIL_V FFMPEG_PREFIX WIN32_FALSE WIN32_TRUE host_os host_vendor host_cpu host build_os build_vendor build_cpu build HAVE_PBU_TRACE_FALSE HAVE_PBU_TRACE_TRUE HAVE_WORKINPROGRESS_FALSE HAVE_WORKINPROGRESS_TRUE FF_DYNLOAD_FALSE FF_DYNLOAD_TRUE HAVE_LIBPOSTPROC_FALSE HAVE_LIBPOSTPROC_TRUE RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_libpostproc enable_dynload with_ffmpeg enable_workinprogress enable_trace enable_xml with_dl with_getoptw ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures bs1770gain 0.9.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/bs1770gain] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of bs1770gain 0.9.8:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --with-libpostproc When compiled with references to libpostproc --enable-dynload load FFmpeg's shared objects ("*.so", "*.dylib", or "*.dll") dynamically (requires option --with-ffmpeg) --workinprogress When compiled with experimental work in progress. --trace When compiled with a rudimentary trace --enable-xml Enable xml output Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ffmpeg=DIR path to FFmpeg installation (i.e. FFmpeg's installation prefix --with-dl=DIR path to libdl installation --with-getoptw=DIR path to getoptW installation Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . bs1770gain home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF bs1770gain configure 0.9.8 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by bs1770gain $as_me 0.9.8, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub compile ar-lib missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='bs1770gain' VERSION='0.9.8' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 printf %s "checking the archiver ($AR) interface... " >&6; } if test ${am_cv_ar_interface+y} then : printf %s "(cached) " >&6 else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO" then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ################################################################################ unset withval # Check whether --enable-libpostproc was given. if test ${enable_libpostproc+y} then : enableval=$enable_libpostproc; libpostproc=yes else $as_nop libpostproc=no fi if test "x$libpostproc" = xyes; then # [ printf "%s\n" "#define HAVE_LIBPOSTPROC 1" >>confdefs.h fi # ] if test x$libpostproc = xyes ; then HAVE_LIBPOSTPROC_TRUE= HAVE_LIBPOSTPROC_FALSE='#' else HAVE_LIBPOSTPROC_TRUE='#' HAVE_LIBPOSTPROC_FALSE= fi ################################################################################ unset withval # Check whether --enable-dynload was given. if test ${enable_dynload+y} then : enableval=$enable_dynload; dynload=yes else $as_nop dynload=no fi if test x$dynload = xyes ; then FF_DYNLOAD_TRUE= FF_DYNLOAD_FALSE='#' else FF_DYNLOAD_TRUE='#' FF_DYNLOAD_FALSE= fi unset withval # Check whether --with-ffmpeg was given. if test ${with_ffmpeg+y} then : withval=$with_ffmpeg; ffmpeg=$withval else $as_nop ffmpeg=no fi if test \( x$dynload = xyes \) -a \( x$ffmpeg = xno \); then as_fn_error $? "\"option --enable-dynload requires option --with-ffmpeg\"" "$LINENO" 5 fi ################################################################################ unset withval # Check whether --enable-workinprogress was given. if test ${enable_workinprogress+y} then : enableval=$enable_workinprogress; workinprogress=yes else $as_nop workinprogress=no fi if test "x$workinprogress" != "xno"; then # [ printf "%s\n" "#define HAVE_WORKINPROGRESS 1" >>confdefs.h fi # ] if test x$workinprogress = xyes ; then HAVE_WORKINPROGRESS_TRUE= HAVE_WORKINPROGRESS_FALSE='#' else HAVE_WORKINPROGRESS_TRUE='#' HAVE_WORKINPROGRESS_FALSE= fi ################################################################################ unset withval # Check whether --enable-trace was given. if test ${enable_trace+y} then : enableval=$enable_trace; trace=yes else $as_nop trace=no fi if test "x$trace" != "xno"; then # [ printf "%s\n" "#define HAVE_PBU_TRACE 1" >>confdefs.h fi # ] if test x$trace = xyes ; then HAVE_PBU_TRACE_TRUE= HAVE_PBU_TRACE_FALSE='#' else HAVE_PBU_TRACE_TRUE='#' HAVE_PBU_TRACE_FALSE= fi ################################################################################ unset withval # Check whether --enable-xml was given. if test ${enable_xml+y} then : enableval=$enable_xml; xml=yes else $as_nop xml=no fi if test "x$xml" != "xno"; then # [ printf "%s\n" "#define HAVE_BG_XML 1" >>confdefs.h fi # ] ################################################################################ # AC_CANONICAL_HOST is needed to access the 'host_os' variable # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac build_linux=no build_windows=no build_mac=no # Detect the target system [ case "${host_os}" in # [ linux*|gnu*) build_linux=yes win32='no' ;; cygwin*|mingw*) build_windows=yes win32='yes' ;; darwin*) build_mac=yes win32='no' ;; *) as_fn_error $? "\"OS $host_os is not supported\"" "$LINENO" 5 ;; esac # ] if test x$win32 = xyes; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $win32" >&5 printf "%s\n" "$win32" >&6; } # Detect the target system ] LIBS_INITIAL=${LIBS} # test for FFmpeg [ if test "x$ffmpeg" != "xno"; then # [ # LDFLAGS="${LDFLAGS} -L$ffmpeg/lib" # CPPFLAGS="${CPPFLAGS} -I$ffmpeg/include" LDFLAGS="-L$ffmpeg/lib ${LDFLAGS}" CPPFLAGS="-I$ffmpeg/include ${CPPFLAGS}" if test "x$win32" = "xno"; then # [ export LD_LIBRARY_PATH="$ffmpeg/lib:${LD_LIBRARY_PATH}" else # ] [ export PATH="$ffmpeg/bin:${PATH}" fi # ] FFMPEG_PREFIX="$ffmpeg" fi # ] #if test "x$ffmpeg" != "xno"; then # [ # AC_CHECK_HEADER(libswscale/swscale.h, # AC_CHECK_LIB(swscale, swscale_version, [ffmpeg=yes LIBS="${LIBS} -lswscale"], ffmpeg=no), # ffmpeg=no) #fi # ] #if test "x$ffmpeg" != "xno"; then # [ # AC_CHECK_HEADER(libavcodec/avcodec.h, # AC_CHECK_LIB(avcodec, avcodec_version, [ffmpeg=yes LIBS="${LIBS} -lavcodec"], ffmpeg=no), # ffmpeg=no) #fi # ] #if test "x$ffmpeg" != "xno"; then # [ # AC_CHECK_HEADER(libpostproc/postprocess.h, # AC_CHECK_LIB(postproc, postproc_version, [ffmpeg=yes LIBS="${LIBS} -lpostproc"], ffmpeg=no), # ffmpeg=no) #fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libavutil/avutil.h" "ac_cv_header_libavutil_avutil_h" "$ac_includes_default" if test "x$ac_cv_header_libavutil_avutil_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avutil_version in -lavutil" >&5 printf %s "checking for avutil_version in -lavutil... " >&6; } if test ${ac_cv_lib_avutil_avutil_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavutil $LIBS" # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char avutil_version (); int main (void) { return avutil_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_avutil_avutil_version=yes else $as_nop ac_cv_lib_avutil_avutil_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_avutil_version" >&5 printf "%s\n" "$ac_cv_lib_avutil_avutil_version" >&6; } if test "x$ac_cv_lib_avutil_avutil_version" = xyes then : ffmpeg=yes LIBS="-lavutil ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "libswscale/swscale.h" "ac_cv_header_libswscale_swscale_h" "$ac_includes_default" if test "x$ac_cv_header_libswscale_swscale_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for swscale_version in -lswscale" >&5 printf %s "checking for swscale_version in -lswscale... " >&6; } if test ${ac_cv_lib_swscale_swscale_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lswscale $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char swscale_version (); int main (void) { return swscale_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_swscale_swscale_version=yes else $as_nop ac_cv_lib_swscale_swscale_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_swscale_version" >&5 printf "%s\n" "$ac_cv_lib_swscale_swscale_version" >&6; } if test "x$ac_cv_lib_swscale_swscale_version" = xyes then : ffmpeg=yes LIBS="-lswscale ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "libavcodec/avcodec.h" "ac_cv_header_libavcodec_avcodec_h" "$ac_includes_default" if test "x$ac_cv_header_libavcodec_avcodec_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avcodec_version in -lavcodec" >&5 printf %s "checking for avcodec_version in -lavcodec... " >&6; } if test ${ac_cv_lib_avcodec_avcodec_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavcodec $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char avcodec_version (); int main (void) { return avcodec_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_avcodec_avcodec_version=yes else $as_nop ac_cv_lib_avcodec_avcodec_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_version" >&5 printf "%s\n" "$ac_cv_lib_avcodec_avcodec_version" >&6; } if test "x$ac_cv_lib_avcodec_avcodec_version" = xyes then : ffmpeg=yes LIBS="-lavcodec ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "libavfilter/avfilter.h" "ac_cv_header_libavfilter_avfilter_h" "$ac_includes_default" if test "x$ac_cv_header_libavfilter_avfilter_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avfilter_version in -lavfilter" >&5 printf %s "checking for avfilter_version in -lavfilter... " >&6; } if test ${ac_cv_lib_avfilter_avfilter_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavfilter $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char avfilter_version (); int main (void) { return avfilter_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_avfilter_avfilter_version=yes else $as_nop ac_cv_lib_avfilter_avfilter_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avfilter_avfilter_version" >&5 printf "%s\n" "$ac_cv_lib_avfilter_avfilter_version" >&6; } if test "x$ac_cv_lib_avfilter_avfilter_version" = xyes then : ffmpeg=yes LIBS="-lavfilter ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "libswresample/swresample.h" "ac_cv_header_libswresample_swresample_h" "$ac_includes_default" if test "x$ac_cv_header_libswresample_swresample_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for swresample_version in -lswresample" >&5 printf %s "checking for swresample_version in -lswresample... " >&6; } if test ${ac_cv_lib_swresample_swresample_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lswresample $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char swresample_version (); int main (void) { return swresample_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_swresample_swresample_version=yes else $as_nop ac_cv_lib_swresample_swresample_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swresample_swresample_version" >&5 printf "%s\n" "$ac_cv_lib_swresample_swresample_version" >&6; } if test "x$ac_cv_lib_swresample_swresample_version" = xyes then : ffmpeg=yes LIBS="-lswresample ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "libavformat/avformat.h" "ac_cv_header_libavformat_avformat_h" "$ac_includes_default" if test "x$ac_cv_header_libavformat_avformat_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for avformat_version in -lavformat" >&5 printf %s "checking for avformat_version in -lavformat... " >&6; } if test ${ac_cv_lib_avformat_avformat_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lavformat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char avformat_version (); int main (void) { return avformat_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_avformat_avformat_version=yes else $as_nop ac_cv_lib_avformat_avformat_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_avformat_version" >&5 printf "%s\n" "$ac_cv_lib_avformat_avformat_version" >&6; } if test "x$ac_cv_lib_avformat_avformat_version" = xyes then : ffmpeg=yes LIBS="-lavformat ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] if test "x$ffmpeg" != "xno"; then # [ if test "x$libpostproc" = xyes; then # [ ac_fn_c_check_header_compile "$LINENO" "libpostproc/postprocess.h" "ac_cv_header_libpostproc_postprocess_h" "$ac_includes_default" if test "x$ac_cv_header_libpostproc_postprocess_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for postproc_version in -lpostproc" >&5 printf %s "checking for postproc_version in -lpostproc... " >&6; } if test ${ac_cv_lib_postproc_postproc_version+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpostproc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char postproc_version (); int main (void) { return postproc_version (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_postproc_postproc_version=yes else $as_nop ac_cv_lib_postproc_postproc_version=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_postproc_postproc_version" >&5 printf "%s\n" "$ac_cv_lib_postproc_postproc_version" >&6; } if test "x$ac_cv_lib_postproc_postproc_version" = xyes then : ffmpeg=yes LIBS="-lpostproc ${LIBS}" else $as_nop ffmpeg=no fi else $as_nop ffmpeg=no fi fi # ] fi # ] if test "x$ffmpeg" != "xno"; then # [ if test "xyes" = "x$win32"; then # [ # LIBS="${LIBS} -lswscale" LIBS="${LIBS} -lbcrypt" LIBS="${LIBS} -lole32" LIBS="${LIBS} -lws2_32" LIBS="${LIBS} -lsecur32" # LIBS="${LIBS} -lcrypt32" LIBS="${LIBS} -lstrmiids" LIBS="${LIBS} -llzma" LIBS="${LIBS} -liconv" LIBS="${LIBS} -lbz2" # LIBS="${LIBS} -ldshow" fi # ] fi # ] if test "x$ffmpeg" != "xno"; then # [ LIBS="${LIBS} -lz" fi # ] #if test "x$ffmpeg" = "xno" ; then # [ # AC_MSG_ERROR([FFmpeg not found]) #fi # ] # test for FFmpeg ] # define avutil major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",avutil_version()>>16); return 0; } _ACEOF FF_AVUTIL_V="`$tmp`" printf "%s\n" "#define FF_AVUTIL_V \"$FF_AVUTIL_V\"" >>confdefs.h rm -f "$tmp" # define avutil major version ] # define avcodec major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",avcodec_version()>>16); return 0; } _ACEOF FF_AVCODEC_V="`$tmp`" printf "%s\n" "#define FF_AVCODEC_V \"$FF_AVCODEC_V\"" >>confdefs.h rm -f "$tmp" # define avcodec major version ] # define avformat major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",avformat_version()>>16); return 0; } _ACEOF FF_AVFORMAT_V="`$tmp`" printf "%s\n" "#define FF_AVFORMAT_V \"$FF_AVFORMAT_V\"" >>confdefs.h rm -f "$tmp" # define avformat major version ] # define swresample major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",swresample_version()>>16); return 0; } _ACEOF FF_SWRESAMPLE_V="`$tmp`" printf "%s\n" "#define FF_SWRESAMPLE_V \"$FF_SWRESAMPLE_V\"" >>confdefs.h rm -f "$tmp" # define swresample major version ] # define swscale major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",swscale_version()>>16); return 0; } _ACEOF FF_SWSCALE_V="`$tmp`" printf "%s\n" "#define FF_SWSCALE_V \"$FF_SWSCALE_V\"" >>confdefs.h rm -f "$tmp" # define swscale major version ] if test "x$libpostproc" = xyes; then # [ # define postproc major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",postproc_version()>>16); return 0; } _ACEOF FF_POSTPROC_V="`$tmp`" printf "%s\n" "#define FF_POSTPROC_V \"$FF_POSTPROC_V\"" >>confdefs.h rm -f "$tmp" # define postproc major version ] fi # ] # define avfilter major version [ tmp=`mktemp` cat << _ACEOF | gcc -xc ${CPPFLAGS} -o "$tmp" - ${LDFLAGS} ${LIBS} #include #include int main() { printf("%u",avfilter_version()>>16); return 0; } _ACEOF FF_AVFILTER_V="`$tmp`" printf "%s\n" "#define FF_AVFILTER_V \"$FF_AVFILTER_V\"" >>confdefs.h rm -f "$tmp" # define avfilter major version ] case "${host_os}" in # [ linux*|gnu*) ######## AVUTIL_SO=libavutil.so.$FF_AVUTIL_V SWSCALE_SO=libswscale.so.$FF_SWSCALE_V AVCODEC_SO=libavcodec.so.$FF_AVCODEC_V AVFORMAT_SO=libavformat.so.$FF_AVFORMAT_V SWRESAMPLE_SO=libswresample.so.$FF_SWRESAMPLE_V SWSCALE_SO=libswscale.so.$FF_SWSCALE_V if test "x$libpostproc" = xyes; then # [ POSTPROC_SO=libpostproc.so.$FF_POSTPROC_V fi # ] AVFILTER_SO=libavfilter.so.$FF_AVFILTER_V ;; cygwin*|mingw*) ######## AVUTIL_SO=avutil-$FF_AVUTIL_V.dll SWSCALE_SO=swscale-$FF_SWSCALE_V.dll AVCODEC_SO=avcodec-$FF_AVCODEC_V.dll AVFORMAT_SO=avformat-$FF_AVFORMAT_V.dll SWRESAMPLE_SO=swresample-$FF_SWRESAMPLE_V.dll SWSCALE_SO=swscale-$FF_SWSCALE_V.dll if test "x$libpostproc" = xyes; then # [ POSTPROC_SO=postproc-$FF_POSTPROC_V.dll fi # ] AVFILTER_SO=avfilter-$FF_AVFILTER_V.dll ;; darwin*) ######## AVUTIL_SO=libavutil.$FF_AVUTIL_V.dylib SWSCALE_SO=libswscale.$FF_SWSCALE_V.dylib AVCODEC_SO=libavcodec.$FF_AVCODEC_V.dylib AVFORMAT_SO=libavformat.$FF_AVFORMAT_V.dylib SWRESAMPLE_SO=libswresample.$FF_SWRESAMPLE_V.dylib SWSCALE_SO=libswscale.$FF_SWSCALE_V.dylib if test "x$libpostproc" = xyes; then # [ POSTPROC_SO=libpostproc.$FF_POSTPROC_V.dylib fi # ] AVFILTER_SO=libavfilter.$FF_AVFILTER_V.dylib ;; *) as_fn_error $? "\"OS $host_os is not supported\"" "$LINENO" 5 ;; esac # ] # test for dynload [ if test "x$dynload" = "xyes"; then # [ # revert LIBS to it's initial state # why??? because when loading ffmpeg libs dynamically we don't want to link # them! instead we have a special module doing the necessary forwarding. LIBS=${LIBS_INITIAL} printf "%s\n" "#define HAVE_FF_DYNLOAD 1" >>confdefs.h # test for dl [ if test "xyes" != "x$win32"; then # [ unset withval # Check whether --with-dl was given. if test ${with_dl+y} then : withval=$with_dl; dl=$withval else $as_nop dl=yes fi if test "x$dl" != "xno"; then # [ if test "x$dl" != "xyes"; then # [ LDFLAGS="${LDFLAGS} -L$dl/lib" CPPFLAGS="${CPPFLAGS} -I$dl/include" fi # ] fi # ] if test "x$dl" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : dl=yes LIBS="${LIBS} -ldl" else $as_nop dl=no fi else $as_nop dl=no fi fi # ] if test "x$dl" = "xno" ; then # [ as_fn_error $? "libdl not found" "$LINENO" 5 fi # ] fi # ] # test for dl ] { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading FFmpeg dynamically" >&5 printf "%s\n" "$as_me: loading FFmpeg dynamically" >&6;} else # ] [ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking FFmpeg" >&5 printf "%s\n" "$as_me: linking FFmpeg" >&6;} LIBS="${LIBS} -lmp3lame" fi # ] # test for dynload ] if test "x$win32" = "xyes"; then # [ unset withval # Check whether --with-getoptw was given. if test ${with_getoptw+y} then : withval=$with_getoptw; getoptw=$withval else $as_nop getoptw=yes fi if test "x$getoptw" != "xno"; then # [ if test "x$getoptw" != "xyes"; then # [ LDFLAGS="${LDFLAGS} -L$getoptw/lib" CPPFLAGS="${CPPFLAGS} -I$getoptw/include" # if test "$win32" = "xno"; then # [ # export LD_LIBRARY_PATH="$getoptw/lib:${LD_LIBRARY_PATH}" # else # ] [ # export PATH="$getoptw/bin:${PATH}" # fi # ] GETOPTW_PREFIX="$getoptw" fi # ] fi # ] if test "x$getoptw" != "xno"; then # [ ac_fn_c_check_header_compile "$LINENO" "getoptW.h" "ac_cv_header_getoptW_h" "#ifdef HAVE_GETOPTW_H # include #endif " if test "x$ac_cv_header_getoptW_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getoptW_long in -lgetoptW" >&5 printf %s "checking for getoptW_long in -lgetoptW... " >&6; } if test ${ac_cv_lib_getoptW_getoptW_long+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lgetoptW $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char getoptW_long (); int main (void) { return getoptW_long (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_getoptW_getoptW_long=yes else $as_nop ac_cv_lib_getoptW_getoptW_long=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_getoptW_getoptW_long" >&5 printf "%s\n" "$ac_cv_lib_getoptW_getoptW_long" >&6; } if test "x$ac_cv_lib_getoptW_getoptW_long" = xyes then : getoptw=yes LIBS="${LIBS} -lgetoptW" else $as_nop getoptw=no fi else $as_nop getoptw=no fi else # ] [ as_fn_error $? "getoptW not found" "$LINENO" 5 fi # ] fi # ] # dealing with shared objects [ if test "x$win32" = "xyes"; then # [ SODIR='bin' # not needed: #LDFLAGS=" ${LDFLAGS} -static-libgcc -static-libstdc++" # -mwindows for linking a windows application, i.e. WinMain(). # -municode for linking wmain() instead of main,() i.e. an unicode # application. Just -municode is needed: #LDFLAGS=" ${LDFLAGS} -mwindows -municode" LDFLAGS=" ${LDFLAGS} -municode" else # ] [ SODIR='lib' if test "x$build_mac" = "xyes"; then # [ ac_fn_c_check_header_compile "$LINENO" "libproc.h" "ac_cv_header_libproc_h" "$ac_includes_default" if test "x$ac_cv_header_libproc_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for proc_pidpath in -lproc" >&5 printf %s "checking for proc_pidpath in -lproc... " >&6; } if test ${ac_cv_lib_proc_proc_pidpath+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lproc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char proc_pidpath (); int main (void) { return proc_pidpath (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_proc_proc_pidpath=yes else $as_nop ac_cv_lib_proc_proc_pidpath=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_proc_proc_pidpath" >&5 printf "%s\n" "$ac_cv_lib_proc_proc_pidpath" >&6; } if test "x$ac_cv_lib_proc_proc_pidpath" = xyes then : proc=yes LIBS="${LIBS} -lproc" else $as_nop proc=no fi else $as_nop proc=no fi fi # ] if test "x$dynload" = "xyes"; then # [ LIBS="${LIBS} -ldl" fi # ] LIBS="${LIBS} -lm" ############################################################################# # LIBS=" ${LIBS} -pthread" ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 printf %s "checking for pthread_create in -lpthread... " >&6; } if test ${ac_cv_lib_pthread_pthread_create+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char pthread_create (); int main (void) { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_pthread_pthread_create=yes else $as_nop ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes then : pthread=yes LIBS="${LIBS} -pthread" else $as_nop pthread=no fi else $as_nop pthread=no fi if test "x$pthread" = "xno" ; then # [ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *******************************************************************" >&5 printf "%s\n" "$as_me: *******************************************************************" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: * pthread not found. *" >&5 printf "%s\n" "$as_me: * pthread not found. *" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: * bs10gain will be build without support for parallel processing. *" >&5 printf "%s\n" "$as_me: * bs10gain will be build without support for parallel processing. *" >&6;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *******************************************************************" >&5 printf "%s\n" "$as_me: *******************************************************************" >&6;} printf "%s\n" "#define HAVE_PTHREAD 0" >>confdefs.h else # ] [ printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h fi # ] fi # ] #XX AC_MSG_NOTICE([$dynload]) #XX if test "x$dynload" = "xyes"; then # [ #XX mkdir -p ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$AVUTIL_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$SWRESAMPLE_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$SWSCALE_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$AVCODEC_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$AVFORMAT_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$POSTPROC_SO ./libbg/bs1770gain-tools #XX cp -p $FFMPEG_PREFIX/$SODIR/$AVFILTER_SO ./libbg/bs1770gain-tools #XX fi # ] #CPPFLAGS="-DDEBUG ${CPPFLAGS}" #CFLAGS="-g ${CFLAGS}" CFLAGS="-Werror ${CFLAGS}" CFLAGS="-Wall ${CFLAGS}" CFLAGS="-Wformat ${CFLAGS}" CFLAGS="-Wpointer-arith ${CFLAGS}" CFLAGS="-Wcast-align ${CFLAGS}" CFLAGS="-Wcast-qual ${CFLAGS}" CFLAGS="-Wreturn-type ${CFLAGS}" CFLAGS="-Wextra ${CFLAGS}" CFLAGS="-Wstrict-prototypes ${CFLAGS}" ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile libpbutil/Makefile lib1770-2/Makefile libff/Makefile libbg/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBPOSTPROC_TRUE}" && test -z "${HAVE_LIBPOSTPROC_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBPOSTPROC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FF_DYNLOAD_TRUE}" && test -z "${FF_DYNLOAD_FALSE}"; then as_fn_error $? "conditional \"FF_DYNLOAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_WORKINPROGRESS_TRUE}" && test -z "${HAVE_WORKINPROGRESS_FALSE}"; then as_fn_error $? "conditional \"HAVE_WORKINPROGRESS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PBU_TRACE_TRUE}" && test -z "${HAVE_PBU_TRACE_FALSE}"; then as_fn_error $? "conditional \"HAVE_PBU_TRACE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then as_fn_error $? "conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by bs1770gain $as_me 0.9.8, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . bs1770gain home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ bs1770gain config.status 0.9.8 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libpbutil/Makefile") CONFIG_FILES="$CONFIG_FILES libpbutil/Makefile" ;; "lib1770-2/Makefile") CONFIG_FILES="$CONFIG_FILES lib1770-2/Makefile" ;; "libff/Makefile") CONFIG_FILES="$CONFIG_FILES libff/Makefile" ;; "libbg/Makefile") CONFIG_FILES="$CONFIG_FILES libbg/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi bs1770gain-0.9.8/AUTHORS0000755000175000017500000000017215035710477011317 00000000000000Peter Belkner Petter Reinholdtsen (quality assurance and Debian package maintenance) bs1770gain-0.9.8/NEWS0000755000175000017500000000000015035710477010734 00000000000000bs1770gain-0.9.8/missing0000755000175000017500000001533615036407371011650 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bs1770gain-0.9.8/ar-lib0000755000175000017500000001336315036407371011343 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2019-07-04.01; # UTC # Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # 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, 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: bs1770gain-0.9.8/libff/0000755000175000017500000000000015037175773011414 500000000000000bs1770gain-0.9.8/libff/ff_muxer.c0000755000175000017500000003745515035710477013326 00000000000000/* * ff_muxer.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// //#define FF_DEBUG_LOCAL #if defined (FF_DEBUG_LOCAL) // [ #define DDMARKLN() _DMARKLN() #define DDWRITELN(line) _DWRITELN(line) #define DDVWRITELN(format,...) _DWRITELNV(format,__VA_ARGS__) #else // ] [ #define DDMARKLN() #define DDWRITELN(line) #define DDVWRITELN(format,...) #endif // ] #if 0 // [ /** * Initialize a FIFO buffer for the audio samples to be encoded. * @param[out] fifo Sample buffer * @param output_codec_context Codec context of the output file * @return Error code (0 if successful) */ //static int init_fifo(ff_muxer_t *m, AVCodecContext *output_codec_context) { /* Create the FIFO buffer based on the specified output sample format. */ m->audio.fifo = av_audio_fifo_alloc(output_codec_context->sample_fmt, output_codec_context->ch_layout.nb_channels, 1); if (!m->audio.fifo) { fprintf(stderr, "Could not allocate FIFO\n"); return AVERROR(ENOMEM); } return 0; } /** * Write the header of the output file container. * @param output_format_context Format context of the output file * @return Error code (0 if successful) */ //static int write_output_file_header(AVFormatContext *output_format_context) { int error; if ((error = avformat_write_header(output_format_context, NULL)) < 0) { fprintf(stderr, "Could not write output file header (error '%s')\n", av_err2str(error)); return error; } return 0; } //static int fifo_loop(void) { int err FFUNUSED=-1; return err; } #elif defined (FF_MUXEER_FIFO) // ] [ #endif // ] /////////////////////////////////////////////////////////////////////////////// int ff_muxer_create(ff_muxer_t *m, ff_inout_t *in, ff_inout_t *out, const char *filter) { AVStream *istream=in->fmt.ctx->streams[in->ai]; AVStream *ostream=out->fmt.ctx->streams[out->ai]; #if defined (FF_MUXEER_FIFO) // [ ff_fifo_t *fifo=&m->audio.fifo; #endif // ] ///////////////////////////////////////////////////////////////////////////// m->state=FF_MUXER_DECODER_SEND_PACKET; m->in=in; m->out=out; // if (!fifo->fifo) { // AVCodecParameters *par FFUNUSED=avcodec_parameters_alloc(); // avcodec_parameters_from_context (par,out->fmt.ctx); // ff_fifo_create(&m->audio.fifo,NULL); // } ///////////////////////////////////////////////////////////////////////////// m->pkt=av_packet_alloc(); if (!m->pkt) { _DMESSAGE("allocating packet"); goto e_packet; } if (in->audio.ctx) { /////////////////////////////////////////////////////////////////////////// m->frame=av_frame_alloc(); if (!m->frame) { _DMESSAGE("allocating frame"); goto e_frame; } } else m->frame=NULL; #if defined (FF_MUXEER_FIFO) // [ //m->audio.fifo=NULL; //avcodec_parameters_from_context (par,out->fmt.ctx); //ff_fifo_create(&m->audio.fifo,NULL); memset(fifo,0,sizeof *fifo); #endif // ] if (filter) { /////////////////////////////////////////////////////////////////////////// if (ff_filter_create(&m->filter,ostream->codecpar,istream->codecpar, istream->time_base,filter)<0) { _DMESSAGE("creating filter"); goto e_filter; } } else { /////////////////////////////////////////////////////////////////////////// m->filter.graph=NULL; } ///////////////////////////////////////////////////////////////////////////// m->audio.ts=0ll; ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: if (m->filter.graph) ff_filter_destroy(&m->filter); e_filter: if (m->frame) av_frame_free(&m->frame); e_frame: av_packet_free(&m->pkt); e_packet: return -1; } void ff_muxer_destroy(ff_muxer_t *m) { #if defined (FF_INPUT_LIST) // [ if (m->out->list) { ff_inout_list(m->out,1); m->out->list=0; } #endif // ] if (m->filter.graph) ff_filter_destroy(&m->filter); if (m->frame) av_frame_free(&m->frame); av_packet_free(&m->pkt); } /////////////////////////////////////////////////////////////////////////////// static int ff_muxer_mux_audio_frame(ff_muxer_t *m, AVPacket *pkt) { // cf. "/doc/examples/muxing.c". ff_audio_t *audio=&m->out->audio; AVStream *ostream=m->out->fmt.ctx->streams[m->out->ai]; #if defined (FF_MUXEER_FIFO) // [ ff_fifo_t *fifo FFUNUSED=&m->audio.fifo; #endif // ] ///////////////////////////////////////////////////////////////////////////// pkt->dts=m->audio.ts; pkt->pts=m->audio.ts; m->audio.ts+=pkt->duration; ///////////////////////////////////////////////////////////////////////////// // rescale output packet timestamp values from codec to stream timebase. av_packet_rescale_ts(pkt,audio->ctx->time_base,ostream->time_base); pkt->stream_index=m->out->ai; ///////////////////////////////////////////////////////////////////////////// // Write the compressed frame to the media file. return av_interleaved_write_frame(m->out->fmt.ctx,pkt); } //#define FF_SIDE_DATA #if defined (FF_SIDE_DATA) // [ static int ff_muxer_remux_frame(ff_muxer_t *m, AVPacket *pkt, int stream_index) { int err=-1; AVPacket opkt={ 0 }; AVStream *istream,*ostream; #if 0 // [ av_init_packet(&opkt); #endif // ] istream=m->in->fmt.ctx->streams[pkt->stream_index]; opkt.stream_index=stream_index; ostream=m->out->fmt.ctx->streams[opkt.stream_index]; opkt.pts=av_rescale_q_rnd(pkt->pts,istream->time_base, ostream->time_base,AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); opkt.dts=av_rescale_q_rnd(pkt->dts,istream->time_base, ostream->time_base,AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); opkt.duration=av_rescale_q(pkt->duration,istream->time_base, ostream->time_base); opkt.flags=pkt->flags; if (pkt->buf) { opkt.buf=av_buffer_ref(pkt->buf); if (!opkt.buf) { _DMESSAGE("referencing buffer"); goto e_ref; } } opkt.data=pkt->data; opkt.size=pkt->size; #if 0 // [ av_copy_packet_side_data(&opkt,pkt); #else // ] [ if (av_packet_copy_props(&opkt,pkt)<0) { _DMESSAGE("copying properties"); goto e_props; } #endif // ] //opkt.pos=-1; if (av_interleaved_write_frame(m->out->fmt.ctx,&opkt)<0) { _DMESSAGE("writing"); goto e_write; } err=0; //cleanup: e_write: e_props: e_ref: return err; } #else // ] [ static int ff_muxer_remux_frame(ff_muxer_t *m, AVPacket *pkt, int stream_index) { // cf. "/doc/examples/remuxing.c". AVStream *istream,*ostream; istream=m->in->fmt.ctx->streams[pkt->stream_index]; pkt->stream_index=stream_index; ostream=m->out->fmt.ctx->streams[pkt->stream_index]; pkt->pts=av_rescale_q_rnd(pkt->pts,istream->time_base, ostream->time_base,AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); pkt->dts=av_rescale_q_rnd(pkt->dts,istream->time_base, ostream->time_base,AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); pkt->duration=av_rescale_q(pkt->duration,istream->time_base, ostream->time_base); pkt->pos=-1; return av_interleaved_write_frame(m->out->fmt.ctx,pkt); } #endif // ] static int ff_muxer_send_packet(ff_muxer_t *m, AVPacket *pkt) { AVFrame *frame=NULL; int err; for (;;) { switch (m->state) { case FF_MUXER_DECODER_SEND_PACKET: err=avcodec_send_packet(m->in->audio.ctx,pkt); #if defined (FF_PACKET_UNREF) // [ if (pkt) av_packet_unref(pkt); #endif // ] switch (err) { case AVERROR_INVALIDDATA: // Invalid data found when processing input. // No respective documentation found. May occur at the end of MP3. #if defined (FF_MUXEER_CONTINUE_ON_INVALIDDATA) // [ // try again. _DWARNINGV("sending packet: %s (%d:\"%s\")",av_err2str(err),err, m->in->cb.in->path(m->in->cb.data)); m->state=FF_MUXER_DECODER_SEND_PACKET; continue; #else // ] [ // Intentional fall-through. _DMESSAGEV("sending packet: %s (%d)",av_err2str(err),err); #endif // ] case 0: // 0 on success m->state=FF_MUXER_DECODER_RECEIVE_FRAME; continue; default: _DMESSAGEV("sending packet: %s (%d)",av_err2str(err),err); return err; } case FF_MUXER_DECODER_RECEIVE_FRAME: err=avcodec_receive_frame(m->in->audio.ctx,m->frame); switch (err) { case 0: // 0: success, a frame was returned frame=m->frame; if (m->filter.graph) m->state=FF_MUXER_FILTER_SEND_FRAME; else m->state=FF_MUXER_ENCODER_SEND_FRAME; continue; case AVERROR_EOF: // we need to flush the encoder. frame=NULL; if (m->filter.graph) m->state=FF_MUXER_FILTER_SEND_FRAME; else m->state=FF_MUXER_ENCODER_SEND_FRAME; continue; case AVERROR(EAGAIN): // AVERROR(EAGAIN): output is not available in this state - user must // try to send new input // read the next packet. m->state=FF_MUXER_DECODER_SEND_PACKET; return err; default: _DMESSAGEV("receiving frame: %s (%d)",av_err2str(err),err); return err; } case FF_MUXER_FILTER_SEND_FRAME: err=ff_filter_send_frame(&m->filter,frame); #if defined (FF_FRAME_UNREF) // [ if (frame==m->frame) av_frame_unref(frame); #endif // ] if (err<0) { _DMESSAGEV("sending frame to filter: %s (%d)",av_err2str(err),err); return err; } m->state=FF_MUXER_FILTER_RECEIVE_FRAME; continue; case FF_MUXER_FILTER_RECEIVE_FRAME: DDWRITELN("FF_MUXER_FILTER_RECEIVE_FRAME"); err=ff_filter_receive_frame(&m->filter,m->frame); DDVWRITELN("FF_MUXER_FILTER_RECEIVE_FRAME: %d (%d)", m->frame->nb_samples,err); switch (err) { case 0: frame=m->frame; m->state=FF_MUXER_ENCODER_SEND_FRAME; continue; case AVERROR(EAGAIN): m->state=FF_MUXER_DECODER_RECEIVE_FRAME; continue; case AVERROR_EOF: // we should flush the encoder. frame=NULL; m->state=FF_MUXER_ENCODER_SEND_FRAME; continue; default: _DMESSAGEV("filter receiving frame: %s (%d)",av_err2str(err),err); return err; } case FF_MUXER_ENCODER_SEND_FRAME: #if defined (FF_FRAME_SIZE_TEST) // [ if (frame&&m->out->audio.ctx->frame_sizenb_samples) { _DWARNINGV("frame too large: frame_size:%dout->audio.ctx->frame_size,frame->nb_samples); return AVERROR(EAGAIN); } #endif // ] err=avcodec_send_frame(m->out->audio.ctx,frame); if (err<0) { _DMESSAGEV("encoder sending frame: %s (%d)",av_err2str(err),err); return err; } else { m->state=FF_MUXER_ENCODER_RECEIVE_PACKET; continue; } #if defined (FF_FRAME_UNREF) // [ if (frame==m->frame) av_frame_unref(frame); #endif // ] switch (err) { case 0: m->state=FF_MUXER_ENCODER_RECEIVE_PACKET; continue; default: _DMESSAGEV("sending frame: %s (%d)",av_err2str(err),err); return err; } case FF_MUXER_ENCODER_RECEIVE_PACKET: err=avcodec_receive_packet(m->out->audio.ctx,m->pkt); switch (err) { case 0: err=ff_muxer_mux_audio_frame(m,m->pkt); fflush(stderr); #if defined (FF_PACKET_UNREF) // [ av_packet_unref(m->pkt); #endif // ] if (err<0) { _DMESSAGE("writing packet"); return err; } continue; case AVERROR_EOF: #if 0 // [ // not an error just THE END. // everything (decoder and encoder) is flushed. _DMESSAGEV("sending frame: %s (%d)",av_err2str(err),err); #else // ] [ m->state=FF_MUXER_DECODER_SEND_PACKET; #endif // ] return err; case AVERROR(EAGAIN): m->state=FF_MUXER_DECODER_RECEIVE_FRAME; continue; default: _DMESSAGEV("receiving packet: %s (%d)",av_err2str(err),err); return err; } default: _DMESSAGE("unexpected state"); return -1; } } } int ff_muxer_loop(ff_muxer_t *m) { int err; read: err=av_read_frame(m->in->fmt.ctx,m->pkt); if (err<0) goto eof; else if ((int)m->in->fmt.ctx->nb_streams<=m->pkt->stream_index) { #if defined (FF_PACKET_UNREF) // [ av_packet_unref(m->pkt); #endif // ] goto read; } if (ff_input_progress(m->in,m->pkt)<0) goto eof; if (m->in->vi==m->pkt->stream_index) { // a video packet has just to be remuxed. err=ff_muxer_remux_frame(m,m->pkt,m->out->vi); #if defined (FF_PACKET_UNREF) // [ av_packet_unref(m->pkt); #endif // ] switch (err) { case 0: break; case AVERROR(EINVAL): #if defined (FF_PROGRESS_STDERR) // [ ff_printer_flush(m->in->printer,stderr); #else // ] [ ff_printer_flush(m->in->printer); #endif // ] _DWARNINGV("remuxing video frame: %s (%d)",av_err2str(err),err); break; default: if (err<0) { _DMESSAGEV("remuxing video frame: %s (%d)",av_err2str(err),err); goto e_loop; } break; } goto read; } else if (m->in->ai==m->pkt->stream_index&&!m->in->audio.ctx) { // an audio packet has just to be remuxed. err=ff_muxer_remux_frame(m,m->pkt,m->out->ai); #if defined (FF_PACKET_UNREF) // [ av_packet_unref(m->pkt); #endif // ] switch (err) { case 0: break; case AVERROR(EINVAL): #if defined (FF_PROGRESS_STDERR) // [ ff_printer_flush(m->in->printer,stderr); #else // ] [ ff_printer_flush(m->in->printer); #endif // ] _DWARNINGV("remuxing video frame: %s (%d)",av_err2str(err),err); break; default: if (err<0) { _DMESSAGEV("remuxing video frame: %s (%d)",av_err2str(err),err); goto e_loop; } break; } goto read; } else if (m->in->ai!=m->pkt->stream_index) { // a packet from a stream we're not interested in has to be skipped. #if defined (FF_PACKET_UNREF) // [ av_packet_unref(m->pkt); #endif // ] goto read; } // an audio packet has been read which has to be decoded, re-encoded, // and muxed. the packet is unrefed by muxer_send_packet(). err=ff_muxer_send_packet(m,m->pkt); if (FF_MUXER_DECODER_SEND_PACKET==m->state) { switch (err) { case AVERROR(EAGAIN): goto read; case AVERROR_EOF: goto eof; default: _DMESSAGEV("re-encoding frame: %s (%d)",av_err2str(err),err); goto e_loop; } } eof: ///////////////////////////////////////////////////////////////////////////// if (m->in->audio.ctx) { // we need to flush the decoder/filter/encoder. err=ff_muxer_send_packet(m,NULL); if (err<0&&FF_MUXER_DECODER_SEND_PACKETstate) { _DMESSAGEV("re-encoding frame: %s (%d:%d)",av_err2str(err),err,m->state); goto e_loop; } } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_PROGRESS_STDERR) // [ ff_printer_flush(m->in->printer,stderr); #else // ] [ ff_printer_flush(m->in->printer); #endif // ] ///////////////////////////////////////////////////////////////////////////// return 0; e_loop: return err; } bs1770gain-0.9.8/libff/ff_wcs2str.c0000755000175000017500000000274015035710477013562 00000000000000/* * ff.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if defined (_WIN32) // [ #include char *ff_wcs2str(const wchar_t *wcs, char *buf, int codepage, size_t size) { if (wcs) { WideCharToMultiByte( codepage, // _In_ UINT CodePage, 0, // _In_ DWORD dwFlags, wcs, // _In_ LPCWSTR lpWideCharStr, -1, // _In_ int cchWideChar, buf, // _Out_opt_ LPSTR lpMultiByteStr, size, // _In_ int cbMultiByte, NULL, // _In_opt_ LPCSTR lpDefaultChar, NULL // _Out_opt_ LPBOOL lpUsedDefaultChar ); } else *buf='\0'; return buf; } #endif // ] bs1770gain-0.9.8/libff/ff_rm.c0000755000175000017500000000272715035710477012576 00000000000000/* * bg_rm.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include int ff_rm(const ffchar_t *path) { #if defined (_WIN32) // [ DWORD dwError; if (!DeleteFileW(path)) { dwError=GetLastError(); switch (dwError) { default: #if defined (_WIN32) // [ _DMESSAGEV("removing \"%S\" (%lu)",path,dwError); #else // ] [ _DMESSAGEV("removing \"%s\" (%lu)",path,dwError); #endif // ] break; } goto e_remove; } #else // ] [ if (remove(path)<0) { #if defined (_WIN32) // [ _DMESSAGEV("removing \"%S\"",path); #else // ] [ _DMESSAGEV("removing \"%s\"",path); #endif // ] goto e_remove; } #endif // ] return 0; //cleanup: e_remove: return -1; } bs1770gain-0.9.8/libff/Makefile.in0000664000175000017500000004742115036407371013402 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libff ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libff_a_AR = $(AR) $(ARFLAGS) libff_a_LIBADD = am_libff_a_OBJECTS = ff_muxer.$(OBJEXT) ff_fifo.$(OBJEXT) \ ff_filter.$(OBJEXT) ff_analyzer.$(OBJEXT) \ ff_resampler.$(OBJEXT) ff_inout.$(OBJEXT) ff_printer.$(OBJEXT) \ ff_audio.$(OBJEXT) ff_iter.$(OBJEXT) ff_wcs2str.$(OBJEXT) \ ff_csv2avdict.$(OBJEXT) ff_mv.$(OBJEXT) ff_fcmp.$(OBJEXT) \ ff_fexists.$(OBJEXT) ff_mkdir.$(OBJEXT) ff_rm.$(OBJEXT) libff_a_OBJECTS = $(am_libff_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/ff_analyzer.Po \ ./$(DEPDIR)/ff_audio.Po ./$(DEPDIR)/ff_csv2avdict.Po \ ./$(DEPDIR)/ff_fcmp.Po ./$(DEPDIR)/ff_fexists.Po \ ./$(DEPDIR)/ff_fifo.Po ./$(DEPDIR)/ff_filter.Po \ ./$(DEPDIR)/ff_inout.Po ./$(DEPDIR)/ff_iter.Po \ ./$(DEPDIR)/ff_mkdir.Po ./$(DEPDIR)/ff_muxer.Po \ ./$(DEPDIR)/ff_mv.Po ./$(DEPDIR)/ff_printer.Po \ ./$(DEPDIR)/ff_resampler.Po ./$(DEPDIR)/ff_rm.Po \ ./$(DEPDIR)/ff_wcs2str.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libff_a_SOURCES) DIST_SOURCES = $(libff_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVCODEC_SO = @AVCODEC_SO@ AVFILTER_SO = @AVFILTER_SO@ AVFORMAT_SO = @AVFORMAT_SO@ AVUTIL_SO = @AVUTIL_SO@ AWK = @AWK@ BS1770GAIN_LDFLAGS = @BS1770GAIN_LDFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFMPEG_PREFIX = @FFMPEG_PREFIX@ FF_AVCODEC_V = @FF_AVCODEC_V@ FF_AVFILTER_V = @FF_AVFILTER_V@ FF_AVFORMAT_V = @FF_AVFORMAT_V@ FF_AVUTIL_V = @FF_AVUTIL_V@ FF_POSTPROC_V = @FF_POSTPROC_V@ FF_SWRESAMPLE_V = @FF_SWRESAMPLE_V@ FF_SWSCALE_V = @FF_SWSCALE_V@ GETOPTW_PREFIX = @GETOPTW_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSTPROC_SO = @POSTPROC_SO@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIR = @SODIR@ STRIP = @STRIP@ SWRESAMPLE_SO = @SWRESAMPLE_SO@ SWSCALE_SO = @SWSCALE_SO@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(top_srcdir)/libpbutil -I$(top_srcdir)/lib1770-2 noinst_LIBRARIES = libff.a libff_a_SOURCES = ff.h ff_muxer.c ff_fifo.c ff_filter.c ff_analyzer.c \ ff_resampler.c ff_inout.c ff_printer.c ff_audio.c ff_iter.c \ ff_wcs2str.c ff_csv2avdict.c ff_mv.c ff_fcmp.c ff_fexists.c \ ff_mkdir.c ff_rm.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libff/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libff/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libff.a: $(libff_a_OBJECTS) $(libff_a_DEPENDENCIES) $(EXTRA_libff_a_DEPENDENCIES) $(AM_V_at)-rm -f libff.a $(AM_V_AR)$(libff_a_AR) libff.a $(libff_a_OBJECTS) $(libff_a_LIBADD) $(AM_V_at)$(RANLIB) libff.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_analyzer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_audio.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_csv2avdict.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_fcmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_fexists.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_fifo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_filter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_inout.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_iter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_mkdir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_muxer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_mv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_printer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_resampler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_rm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ff_wcs2str.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/ff_analyzer.Po -rm -f ./$(DEPDIR)/ff_audio.Po -rm -f ./$(DEPDIR)/ff_csv2avdict.Po -rm -f ./$(DEPDIR)/ff_fcmp.Po -rm -f ./$(DEPDIR)/ff_fexists.Po -rm -f ./$(DEPDIR)/ff_fifo.Po -rm -f ./$(DEPDIR)/ff_filter.Po -rm -f ./$(DEPDIR)/ff_inout.Po -rm -f ./$(DEPDIR)/ff_iter.Po -rm -f ./$(DEPDIR)/ff_mkdir.Po -rm -f ./$(DEPDIR)/ff_muxer.Po -rm -f ./$(DEPDIR)/ff_mv.Po -rm -f ./$(DEPDIR)/ff_printer.Po -rm -f ./$(DEPDIR)/ff_resampler.Po -rm -f ./$(DEPDIR)/ff_rm.Po -rm -f ./$(DEPDIR)/ff_wcs2str.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/ff_analyzer.Po -rm -f ./$(DEPDIR)/ff_audio.Po -rm -f ./$(DEPDIR)/ff_csv2avdict.Po -rm -f ./$(DEPDIR)/ff_fcmp.Po -rm -f ./$(DEPDIR)/ff_fexists.Po -rm -f ./$(DEPDIR)/ff_fifo.Po -rm -f ./$(DEPDIR)/ff_filter.Po -rm -f ./$(DEPDIR)/ff_inout.Po -rm -f ./$(DEPDIR)/ff_iter.Po -rm -f ./$(DEPDIR)/ff_mkdir.Po -rm -f ./$(DEPDIR)/ff_muxer.Po -rm -f ./$(DEPDIR)/ff_mv.Po -rm -f ./$(DEPDIR)/ff_printer.Po -rm -f ./$(DEPDIR)/ff_resampler.Po -rm -f ./$(DEPDIR)/ff_rm.Po -rm -f ./$(DEPDIR)/ff_wcs2str.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile $(libff_a_OBJECTS): $(CONFIG_HEADER) $(libff_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil.h $(libff_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil_priv.h $(libff_a_OBJECTS): $(top_srcdir)/lib1770-2/lib1770.h #libff_a_SOURCES+=ff_dynload.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bs1770gain-0.9.8/libff/ff_resampler.c0000755000175000017500000002165215035710477014150 00000000000000/* * ff_resampler.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 1 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // { FF_DISABLE_DEPRECATION_WARNINGS // [ #endif // } #if defined (FF_TOBIAS_BUG_FIX) // [ #define FF_RESAMLPER_CONFIG_FRAME #endif // ] /////////////////////////////////////////////////////////////////////////////// int ff_resampler_create(ff_resampler_t *res, const AVCodecParameters *ocodecpar, const AVCodecParameters *icodecpar) { int err=-1; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ int64_t ochannel_layout=ocodecpar->channel_layout; #else // ] [ AVChannelLayout och_layout FFUNUSED=ocodecpar->ch_layout; #endif // ] ENTER(__func__); #if defined (FF_RESAMPLER_RATE) // [ ///////////////////////////////////////////////////////////////////////////// res->irate=icodecpar->sample_rate; res->orate=ocodecpar->sample_rate; #endif // ] #if defined (FF_RESAMPLER_NB_SAMPLES) // [ res->nb_samples=0; #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (!och_layout||!icodecpar->ch_layout) { #if defined (_WIN32) // [ fwprintf(stderr,L"invalid channel layout: output=%I64d input=%I64d", ochannel_layout,icodecpar->channel_layout); #else // ] [ fprintf(stderr,"invalid channel layout: output=%" PRId64 " input=%" PRId64, ochannel_layout,icodecpar->channel_layout); #endif // ] goto e_channel_layout; } #else // ] [ if (!av_channel_layout_check(&och_layout)||!av_channel_layout_check(&icodecpar->ch_layout)) { DMESSAGE("missing channellayout for input or output"); goto e_channel_layout; } #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ res->ctx=swr_alloc_set_opts( NULL, // struct SwrContext *s, // [ ochannel_layout, // int64_t out_ch_layout, ocodecpar->format, // enum AVSampleFormat out_sample_fmt, ocodecpar->sample_rate, // int out_sample_rate, // ] [ icodecpar->channel_layout, // int64_t in_ch_layout, icodecpar->format, // enum AVSampleFormat in_sample_fmt, icodecpar->sample_rate, // int in_sample_rate, // ] 0, // int log_obgset, NULL); // void *log_ctx if (!res->ctx) { _DMESSAGE("allocating context"); goto e_context; } #else // ] [ PUTS(__FILE__,__LINE__,"\n"); res->ctx=swr_alloc(); PRINTF(__FILE__,__LINE__,"res->ctx:%p\n",res->ctx); if (!res->ctx) { _DMESSAGE("allocating context"); goto e_context; } #if 0 // [ av_opt_set_chlayout(res->ctx, "in_chlayout", &icodecpar->ch_layout, 0); av_opt_set_int(res->ctx, "in_sample_rate", icodecpar->sample_rate, 0); av_opt_set_sample_fmt(res->ctx, "in_sample_fmt", icodecpar->format, 0); av_opt_set_chlayout(res->ctx, "out_chlayout", &ocodecpar->ch_layout, 0); av_opt_set_int(res->ctx, "out_sample_rate", ocodecpar->sample_rate, 0); av_opt_set_sample_fmt(res->ctx, "out_sample_fmt", ocodecpar->format, 0); #else // ] [ err=av_opt_set_chlayout(res->ctx, "in_chlayout",&icodecpar->ch_layout, 0); if (err<0) { _DMESSAGEV("setting option 'in_chlayout': %s (%d)",av_err2str(err),err); goto e_opt_set; } err=av_opt_set_int(res->ctx, "in_sample_rate",icodecpar->sample_rate, 0); if (err<0) { _DMESSAGEV("setting option 'in_sample_rate': %s (%d)",av_err2str(err),err); goto e_opt_set; } err=av_opt_set_sample_fmt(res->ctx, "in_sample_fmt",icodecpar->format, 0); if (err<0) { _DMESSAGEV("setting option 'in_sample_fmt': %s (%d)",av_err2str(err),err); goto e_opt_set; } #endif // ] #endif // ] ///////////////////////////////////////////////////////////////////////////// res->frame=av_frame_alloc(); if (!res->frame) { _DMESSAGE("allocating frame"); goto e_frame; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ res->frame->channel_layout=ochannel_layout; res->frame->channels=av_get_channel_layout_nb_channels(ochannel_layout); #else // ] [ res->frame->ch_layout=ocodecpar->ch_layout; #endif // ] res->frame->format=ocodecpar->format; res->frame->sample_rate=ocodecpar->sample_rate; ///////////////////////////////////////////////////////////////////////////// //err=0; return RETURN_INT(__FILE__,__LINE__,0); //cleanup: e_opt_set: av_frame_free(&res->frame); e_frame: swr_close(res->ctx); swr_free(&res->ctx); e_context: e_channel_layout: //return err; return RETURN_INT(__FILE__,__LINE__,err); } void resampler_destroy(ff_resampler_t *res) { av_frame_free(&res->frame); swr_close(res->ctx); swr_free(&res->ctx); } //#define FF_RESAMPLER_GET_BUFFER int resampler_apply(ff_resampler_t *res, AVFrame *frame) { int err; #if defined (FF_RESAMPLER_RATE) // [ ///////////////////////////////////////////////////////////////////////////// if (frame) { int nb_samples=(uint64_t)res->orate/res->irate*frame->nb_samples; if (!res->frame->nb_samples) { #if defined (FF_RESAMPLER_NB_SAMPLES) // [ res->frame->nb_samples=res->nb_samples=nb_samples; #else // ] [ res->frame->nb_samples=nb_samples; #endif // ] #if defined (FF_RESAMPLER_GET_BUFFER) // [ err=av_frame_get_buffer(res->frame,0); if (err<0) { _DMESSAGE("getting frame buffer"); goto e_buffer; } #endif // ] } else if (res->frame->nb_samplesnb_samplesframe->channel_layout; int channels=res->frame->channels; #else // ] [ AVChannelLayout ch_layout=res->frame->ch_layout; int nb_channels=res->frame->ch_layout.nb_channels; #endif // ] int format=res->frame->format; int sample_rate=res->frame->sample_rate; av_frame_free(&res->frame); res->frame=av_frame_alloc(); if (!res->frame) { _DMESSAGE("allocating frame"); goto e_frame; } #if defined (FF_RESAMPLER_NB_SAMPLES) // [ res->frame->nb_samples=res->nb_samples=nb_samples; #else // ] [ //res->frame->nb_samples=res->nb_samples=nb_samples; res->frame->nb_samples=nb_samples; #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ res->frame->channel_layout=channel_layout; #else // ] [ res->frame->ch_layout=ch_layout; #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ res->frame->channels=channels; #else // ] [ res->frame->ch_layout.nb_channels=nb_channels; #endif // ] res->frame->format=format; res->frame->sample_rate=sample_rate; #if defined (FF_RESAMPLER_GET_BUFFER) // [ err=av_frame_get_buffer(res->frame,0); if (err<0) { _DMESSAGE("getting frame buffer"); goto e_buffer; } #endif // ] #if defined (FF_RESAMPLER_NB_SAMPLES) // [ } else res->frame->nb_samples=nb_samples; #endif // ] } } #endif // ] #if defined (FF_RESAMLPER_CONFIG_FRAME) // [ ///////////////////////////////////////////////////////////////////////////// err=swr_config_frame(res->ctx,res->frame,frame); if (err<0) { _DMESSAGEV("configuring frame: %s (%d)",av_err2str(err),err); goto econfig; } #endif // ] ///////////////////////////////////////////////////////////////////////////// err=swr_convert_frame(res->ctx,res->frame,frame); if (err<0) { _DMESSAGEV("converting frame: %s (%d)",av_err2str(err),err); goto econvert; } ///////////////////////////////////////////////////////////////////////////// return 0; econvert: #if defined (FF_RESAMLPER_CONFIG_FRAME) // [ econfig: #endif // ] #if defined (FF_RESAMPLER_RATE) // [ #if defined (FF_RESAMPLER_GET_BUFFER) // [ e_buffer: #endif // ] e_frame: #endif // ] return -1; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) FF_ENABLE_DEPRECATION_WARNINGS // ] #endif bs1770gain-0.9.8/libff/ff_fcmp.c0000755000175000017500000000630615035710477013102 00000000000000/* * ff_fcmp.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if ! defined (_WIN32) // [ #include #endif // ] #if defined (_WIN32) // [ int ff_get_info(const wchar_t *path, BY_HANDLE_FILE_INFORMATION *info) { int err=-1; HANDLE h; int ok; ///////////////////////////////////////////////////////////////////////////// h=CreateFileW( path, // LPCWSTR lpFileName, GENERIC_READ, // DWORD dwDesiredAccess, FILE_SHARE_READ, // DWORD dwShareMode, NULL, // LPSECURITY_ATTRIBUTES lpSecurityAttributes, OPEN_EXISTING, // DWORD dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, // DWORD dwFlagsAndAttributes, NULL // HANDLE hTemplateFile ); if (INVALID_HANDLE_VALUE==h) goto e_open; ///////////////////////////////////////////////////////////////////////////// ok=GetFileInformationByHandle( h, // HANDLE hFile, info // LPBY_HANDLE_FILE_INFORMATION lpFileInformation ); if (!ok) goto e_info; ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_info: CloseHandle(h); e_open: return err; } #endif // ] int ff_fcmp(const ffchar_t *lhs, const ffchar_t *rhs) { int cmp; #if defined (_WIN32) // [ // How to determine that two Win32 API handles represent the same object? // https://stackoverflow.com/questions/29436696/how-to-determine-that-two-win32-api-handles-represent-the-same-object struct { BY_HANDLE_FILE_INFORMATION lhs,rhs; } info={ 0 }; //FFVWRITELN(FFL("\"%s\" \"%s\""),lhs,rhs); if (ff_get_info(lhs,&info.lhs)<0) return -1; else if (ff_get_info(rhs,&info.rhs)<0) return 1; else if ((cmp=info.lhs.dwVolumeSerialNumber-info.rhs.dwVolumeSerialNumber)) return cmp; else if ((cmp=info.lhs.nFileIndexHigh-info.rhs.nFileIndexHigh)) return cmp; else if ((cmp=info.lhs.nFileIndexLow-info.rhs.nFileIndexLow)) return cmp; else return 0; #else // ] [ struct { struct stat lhs,rhs; } buf={ 0 }; if (stat(lhs,&buf.lhs)<0) return -1; else if (stat(rhs,&buf.rhs)<0) return 1; else if ((cmp=buf.lhs.st_dev-buf.rhs.st_dev)) return cmp; else if ((cmp=buf.lhs.st_ino-buf.rhs.st_ino)) return cmp; else return 0; #endif // ] } bs1770gain-0.9.8/libff/ff_mv.c0000755000175000017500000000361115035710477012573 00000000000000/* * ff_mv.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include int ff_mv(const ffchar_t *source, const ffchar_t *target) { #if defined (_WIN32) // [ DWORD dwError; DeleteFileW(target); if (!MoveFileW(source,target)) { dwError=GetLastError(); switch (dwError) { case ERROR_ALREADY_EXISTS: #if defined (_WIN32) // [ _DMESSAGEV("moving \"%S\" to \"%S\" (ERROR_ALREADY_EXISTS)", source,target); #else // ] [ _DMESSAGEV("moving \"%s\" to \"%s\" (ERROR_ALREADY_EXISTS)", source,target); #endif // ] break; default: #if defined (_WIN32) // [ _DMESSAGEV("moving \"%S\" to \"%S\" (%lu)",source,target,dwError); #else // ] [ _DMESSAGEV("moving \"%s\" to \"%s\" (%lu)",source,target,dwError); #endif // ] break; } goto e_rename; } #else // ] [ remove(target); if (rename(source,target)<0) { #if defined (_WIN32) // [ _DMESSAGEV("moving \"%S\" to \"%S\"",source,target); #else // ] [ _DMESSAGEV("moving \"%s\" to \"%s\"",source,target); #endif // ] goto e_rename; } #endif // ] return 0; //cleanup: e_rename: return -1; } bs1770gain-0.9.8/libff/ff_fexists.c0000755000175000017500000000206415035710477013637 00000000000000/* * ff_fexists.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #include int ff_fexists(const ffchar_t *path) { struct stat buf; #if (_WIN32) // [ return !wstat(path,&buf); #else // ] [ return !stat(path,&buf); #endif // ] } bs1770gain-0.9.8/libff/ff_inout.c0000755000175000017500000007303415035710477013315 00000000000000/* * ff_inout.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 0 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // { FF_DISABLE_DEPRECATION_WARNINGS // [ #endif // } /////////////////////////////////////////////////////////////////////////////// // https://0xdeafc0de.wordpress.com/2014/07/21/seeking-with-ffmpeg/ //#define FF_SEEK_DEFAULT //#define FF_SEEK_FLAGS AVFMT_SEEK_TO_PTS //#define FF_SEEK_FLAGS AVSEEK_FLAG_FRAME #define FF_SEEK_FLAGS AVSEEK_FLAG_ANY //#define FF_SEEK_FLAGS 0 static int ff_input_seek(ff_inout_t *in, int64_t seek) { int err; if (0llfmt.ctx->duration<=seek) { _DMESSAGE("attempt to seek out of range"); goto e_seek; } #if defined (FF_SEEK_DEFAULT) // [ err=av_seek_frame(in->fmt.ctx,-1,seek,FF_SEEK_FLAGS); #else // ] [ if (0vi) { seek/=AV_TIME_BASE; seek*=in->fmt.ctx->streams[in->vi]->time_base.den; seek/=in->fmt.ctx->streams[in->vi]->time_base.num; err=av_seek_frame(in->fmt.ctx,in->vi,seek,FF_SEEK_FLAGS); } else { seek/=AV_TIME_BASE; seek*=in->fmt.ctx->streams[in->ai]->time_base.den; seek/=in->fmt.ctx->streams[in->ai]->time_base.num; err=av_seek_frame(in->fmt.ctx,in->ai,seek,FF_SEEK_FLAGS); } #endif // ] if (err<0) { _DMESSAGEV("seeking: %s (%d)",av_err2str(err),err); goto e_seek; } } return 0; e_seek: return -1; } #if defined (FF_SERGEY_INDEX_BUGFIX) // [ #if defined (FF_INPUT_LIST) // [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int list, int ai, int vi) #else // ] [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int ai, int vi) #endif // ] #else // ] [ #if defined (FF_INPUT_LIST) // [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int list) #else // ] [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p) #endif // ] #endif // ] { const char *path=cb&&cb->path?cb->path(data):""; #if defined (_WIN32) // [ const wchar_t *pathw=cb&&cb->pathw?cb->pathw(data):L""; #endif // ] int csv=cb&&cb->csv?cb->csv(data):0; const ff_param_decode_t *decode=cb&&cb->decode?cb->decode(data):NULL; int64_t seek=cb&&cb->interval.begin?cb->interval.begin(data):-1ll; int i; const AVStream *istream; int err; ENTER(__func__); ///////////////////////////////////////////////////////////////////////////// in->cb.in=cb; in->cb.data=data; in->printer=p; #if defined (FF_INPUT_LIST) // [ in->list=list; in->path=path; #endif // ] ///////////////////////////////////////////////////////////////////////////// in->fmt.ctx=NULL; err=avformat_open_input(&in->fmt.ctx,path,NULL,NULL); if (err<0) { if (warn) _DWARNINGV("opening input \"%s\": %s (%d)",path,av_err2str(err),err); goto e_context; } if (!strcmp("image2",in->fmt.ctx->iformat->name)) goto e_image; ///////////////////////////////////////////////////////////////////////////// // should be set before calling avformat_find_stream_info(). // cf. e.g. https://code.videolan.org/libav/libav/commit/9dc0bc3dadbc01b350b84c0079de391cb6015094 in->fmt.ctx->flags|=AVFMT_FLAG_GENPTS; err=avformat_find_stream_info(in->fmt.ctx,NULL); if (err<0) { if (warn) { _DMESSAGEV("finding stream info \"%s\": %s (%d)",path, av_err2str(err),err); } goto e_find; } ///////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ if (csv&&ff_csv2avdict(path,pathw,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #else // ] [ if (csv&&ff_csv2avdict(path,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_SERGEY_INDEX_BUGFIX) // [ in->ai=ai<(int)in->fmt.ctx->nb_streams?ai:-1; in->vi=vi<(int)in->fmt.ctx->nb_streams?ai:-1; #else // ] [ in->ai=-1; in->vi=-1; #endif // ] ///////////////////////////////////////////////////////////////////////////// if (!in->fmt.ctx->nb_streams) goto e_invalid_format; else if (1u==in->fmt.ctx->nb_streams &&in->fmt.ctx->streams[0]->codecpar->codec_type!=AVMEDIA_TYPE_AUDIO) goto e_invalid_format; ///////////////////////////////////////////////////////////////////////////// for (i=0;i<(int)in->fmt.ctx->nb_streams;++i) { istream=in->fmt.ctx->streams[i]; if (istream->codecpar->codec_id<=AV_CODEC_ID_NONE) continue; else if (AV_CODEC_ID_FIRST_SUBTITLE<=istream->codecpar->codec_id) continue; switch (istream->codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: #if defined (FF_CHANNEL_LAYOUT_DEPRECATED) // [ if (istream->codecpar->ch_layout.nb_channels<=0) { _DWARNINGV("channel underflow: %d", istream->codecpar->ch_layout.nb_channels); continue; } else if (AV_NUM_DATA_POINTERScodecpar->ch_layout.nb_channels) { _DWARNINGV("channel overflow: %d", istream->codecpar->ch_layout.nb_channels); continue; } #else // ] [ #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (istream->codecpar->channels<=0) { _DWARNINGV("channel underflow: %d",istream->codecpar->channels); continue; } else if (AV_NUM_DATA_POINTERScodecpar->channels) { _DWARNINGV("channel overflow: %d",istream->codecpar->channels); continue; } #else // ] [ if (istream->codecpar->ch_layout.nb_channels<=0) { _DWARNINGV("channel underflow: %d",istream->codecpar->ch_layout.nb_channels); continue; } else if (AV_NUM_DATA_POINTERScodecpar->ch_layout.nb_channels) { _DWARNINGV("channel overflow: %d",istream->codecpar->ch_layout.nb_channels); continue; } #endif // ] #endif // ] #if defined (FF_SERGEY_INDEX_BUGFIX) // [ else if (iai) continue; #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ else if (in->ai<0&&istream->codecpar->channels) { // if no audio stream found yet, pick this one (regardless whether // stereo or not). in->ai=i; } else if (2==istream->codecpar->channels) { // if an audio stream alreay was found (and is non-stereo), // replace it by this stereo one. in->ai=i; } #else // ] [ else if (in->ai<0&&istream->codecpar->ch_layout.nb_channels) { // if no audio stream found yet, pick this one (regardless whether // stereo or not). in->ai=i; } else if (2==istream->codecpar->ch_layout.nb_channels) { // if an audio stream alreay was found (and is non-stereo), // replace it by this stereo one. in->ai=i; } #endif // ] break; case AVMEDIA_TYPE_VIDEO: //DVWRITELN("\"%s\"",avcodec_find_decoder(istream->codecpar->codec_id)->name); //DVWRITELN("%d",istream->codecpar->codec_id); #if defined (FF_SERGEY_INDEX_BUGFIX) // [ if (ivi) continue; else #endif // ] if (in->vi<0) { // if no video stream found yet, pick this one. in->vi=i; } break; default: break; } } if (in->ai<0) { _DWARNINGV("missing valid audio stream in \"%s\"",path); goto e_no_audio; } ///////////////////////////////////////////////////////////////////////////// if (!decode) in->audio.ctx=NULL; else if (ff_audio_create(&in->audio,in,decode,NULL)<0) { _DMESSAGE("creating audio decoder"); goto e_audio; } ///////////////////////////////////////////////////////////////////////////// if (ff_input_seek(in,seek)<0) { _DMESSAGE("seeking"); goto e_seek; } ///////////////////////////////////////////////////////////////////////////// //return 0; //PUTS(__FILE__,__LINE__,"NO CALLBACK\n"); return RETURN_INT(__FILE__,__LINE__,0); //cleanup: e_seek: if (in->audio.ctx) ff_audio_destroy(&in->audio); e_audio: e_no_audio: e_find: e_invalid_format: e_csv: e_image: avformat_close_input(&in->fmt.ctx); e_context: //return -1; return RETURN_INT(__FILE__,__LINE__,-1); } void ff_input_destroy(ff_inout_t *in) { if (in->audio.ctx) ff_audio_destroy(&in->audio); avformat_close_input(&in->fmt.ctx); } int ff_input_open_analyzer(ff_inout_t *in) { ff_input_callback_t *cb=in->cb.in; void *data=in->cb.data; const char *path=cb&&cb->path?cb->path(data):""; #if defined (_WIN32) // [ const wchar_t *pathw=cb&&cb->pathw?cb->pathw(data):L""; #endif // ] int csv=cb&&cb->csv?cb->csv(data):0; const ff_param_decode_t *decode=cb&&cb->decode?cb->decode(data):NULL; int64_t seek=cb&&cb->interval.begin?cb->interval.begin(data):-1ll; int err; ENTER(__func__); ///////////////////////////////////////////////////////////////////////////// in->cb.in=cb; in->cb.data=data; ff_printer_clear(in->printer); ///////////////////////////////////////////////////////////////////////////// in->fmt.ctx=NULL; err=avformat_open_input(&in->fmt.ctx,path,NULL,NULL); if (err<0) { _DWARNINGV("opening input \"%s\": %s (%d)",path,av_err2str(err),err); goto e_context; } ///////////////////////////////////////////////////////////////////////////// // should be set before calling avformat_find_stream_info(). // cf. e.g. https://code.videolan.org/libav/libav/commit/9dc0bc3dadbc01b350b84c0079de391cb6015094 in->fmt.ctx->flags|=AVFMT_FLAG_GENPTS; err=avformat_find_stream_info(in->fmt.ctx,NULL); if (err<0) { _DMESSAGEV("finding stream info: %s (%d)",av_err2str(err),err); goto e_find; } ///////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ if (csv&&ff_csv2avdict(path,pathw,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #else // ] [ if (csv&&ff_csv2avdict(path,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #endif // ] #if 0 // [ err=av_log_get_level(); if (AV_LOG_INFO<=err) { #endif // ] /////////////////////////////////////////////////////////////////////////// fflush(stderr); fflush(stdout); av_dump_format(in->fmt.ctx,0,path,0); fflush(stderr); #if 0 // [ } av_log_set_level(err); err=-1; #endif // ] ///////////////////////////////////////////////////////////////////////////// if (!decode) in->audio.ctx=NULL; else if (ff_audio_create(&in->audio,in,decode,NULL)<0) { _DMESSAGE("creating audio decoder"); goto e_audio; } ///////////////////////////////////////////////////////////////////////////// if (ff_input_seek(in,seek)<0) { _DMESSAGE("seeking"); goto e_seek; } ///////////////////////////////////////////////////////////////////////////// //return 0; return RETURN_INT(__FILE__,__LINE__,0); //cleanup: e_seek: if (in->audio.ctx) ff_audio_destroy(&in->audio); e_audio: e_find: e_csv: avformat_close_input(&in->fmt.ctx); e_context: //return -1; return RETURN_INT(__FILE__,__LINE__,-1); } #if defined (FF_FLAC_HACK) // [ // as it seems it is impossible to pass through a partial flac stream. // our hack consists in reading/decoding and re-encoding/writing. static int ff_input_flac_hack(ff_inout_t *in, int transcode, int64_t begin, int64_t duration, ff_param_decode_t *d) { AVCodecParameters *codecpar=in->fmt.ctx->streams[in->ai]->codecpar; #if 1 // [ int hack=AV_CODEC_ID_FLAC==codecpar->codec_id // FLAC stream &&!transcode // not transcoding anyway &&(0llcodec_id; // FLAC stream fprintf(stderr,"(%s,%d,%s) codec_id=%d,AV_CODEC_ID_FLAC=%d\n",pbu_basename(__FILE__),__LINE__,__func__,codecpar->codec_id,AV_CODEC_ID_FLAC);fflush(stderr); fprintf(stderr,"(%s,%d,%s) hack=%d\n",pbu_basename(__FILE__),__LINE__,__func__,hack);fflush(stderr); hack=hack&&!transcode; // not transcoding anyway fprintf(stderr,"(%s,%d,%s) hack=%d\n",pbu_basename(__FILE__),__LINE__,__func__,hack);fflush(stderr); hack=hack&&(0llrequest.sample_fmt=codecpar->format; #else // ] [ if (hack&&d) d->request.ch_layout=codecpar->ch_layout; #endif // ] return hack; } int ff_input_open_muxer(ff_inout_t *in, int *hack) #else // ] [ int ff_input_open_muxer(ff_inout_t *in) #endif // ] { // called from the muxer, i.e. we have to decide wether to transcode. // this might be forced by a respective parameter from the muxer // or by a changed format. ff_input_callback_t *cb=in->cb.in; void *data=in->cb.data; const char *path=cb&&cb->path?cb->path(data):""; #if defined (_WIN32) // [ const wchar_t *pathw=cb&&cb->pathw?cb->pathw(data):L""; #endif // ] int csv=cb&&cb->csv?cb->csv(data):0; const ff_param_decode_t *decode=cb&&cb->decode?cb->decode(data):NULL; int transcode=cb&&cb->transcode?cb->transcode(data):0; int64_t begin=cb&&cb->interval.begin?cb->interval.begin(data):-1ll; #if defined (FF_FLAC_HACK) // [ int64_t duration=cb&&cb->interval.duration?cb->interval.duration(data):-1ll; ff_param_decode_t d; #endif // ] int err; ///////////////////////////////////////////////////////////////////////////// ff_printer_clear(in->printer); ///////////////////////////////////////////////////////////////////////////// if (in->ai<0) { _DMESSAGE("audio index out of range"); goto e_range; } ///////////////////////////////////////////////////////////////////////////// in->fmt.ctx=NULL; err=avformat_open_input(&in->fmt.ctx,path,NULL,NULL); if (err<0) { _DMESSAGEV("opening input: %s (%d) \"%s\"",av_err2str(err),err,path); goto e_context; } ///////////////////////////////////////////////////////////////////////////// // should be set before calling avformat_find_stream_info(). // cf. e.g. https://code.videolan.org/libav/libav/commit/9dc0bc3dadbc01b350b84c0079de391cb6015094 in->fmt.ctx->flags|=AVFMT_FLAG_GENPTS; err=avformat_find_stream_info(in->fmt.ctx,NULL); if (err<0) { _DMESSAGEV("finding stream info: %s (%d)",av_err2str(err),err); goto e_find; } ///////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ if (csv&&ff_csv2avdict(path,pathw,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #else // ] [ if (csv&&ff_csv2avdict(path,'\t',&in->fmt.ctx->metadata,0)<0) { _DMESSAGE("reading csv file"); goto e_csv; } #endif // ] #if 0 // [ err=av_log_get_level(); if (AV_LOG_INFO<=err) { #endif // ] /////////////////////////////////////////////////////////////////////////// fflush(stderr); fflush(stdout); av_dump_format(in->fmt.ctx,0,path,0); fflush(stderr); #if 0 // [ } av_log_set_level(err); err=-1; #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ if (decode) { d=*decode; if (hack) *hack=ff_input_flac_hack(in,transcode,begin,duration,&d); } else if (hack) *hack=0; if (!decode||!(transcode||(hack&&*hack))) in->audio.ctx=NULL; else if (ff_audio_create(&in->audio,in,&d,NULL)<0) { _DMESSAGE("creating audio decoder"); goto e_audio; } #else // ] [ if (!decode||!transcode) in->audio.ctx=NULL; else if (ff_audio_create(&in->audio,in,decode,NULL)<0) { _DMESSAGE("creating audio decoder"); goto e_audio; } #endif // ] ///////////////////////////////////////////////////////////////////////////// if (ff_input_seek(in,begin)<0) { _DMESSAGE("seeking"); goto e_seek; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_seek: if (in->audio.ctx) ff_audio_destroy(&in->audio); e_audio: e_csv: e_find: avformat_close_input(&in->fmt.ctx); e_context: e_range: return -1; } void ff_input_close(ff_inout_t *in) { if (in->audio.ctx) { ff_audio_destroy(&in->audio); in->audio.ctx=NULL; } if (in->fmt.ctx) { avformat_close_input(&in->fmt.ctx); in->fmt.ctx=NULL; } } void ff_inout_interval(ff_inout_t *inout, int64_t *begin, int64_t *duration, AVStream *stream) { int64_t (*fn)(const void *data); if (begin) { fn=inout->cb.in?inout->cb.in->interval.begin:NULL; *begin=fn?fn(inout->cb.data):-1ll; //DVWRITELN("%p: begin=%I64d",fn,*begin); } if (duration) { fn=inout->cb.in?inout->cb.in->interval.duration:NULL; *duration=fn?fn(inout->cb.data):-1ll; //DVWRITELN("%p: duration=%I64d",fn,*duration); if (*duration<0ll) { *duration=inout->fmt.ctx->duration; //DVWRITELN("%p: duration=%I64d",fn,*duration); if (begin&&0ll<*begin) *duration-=*begin; //DVWRITELN("%p: duration=%I64d",fn,*duration); } } //DVWRITELN("begin=%I64d",*begin); if (stream) { if (begin&&0ll<*begin) *begin=av_rescale_q(*begin,AV_TIME_BASE_Q,stream->time_base); if (duration&&0ll<*duration) *duration=av_rescale_q(*duration,AV_TIME_BASE_Q,stream->time_base); } //DVWRITELN("begin=%I64d",*begin); } int ff_input_progress(ff_inout_t *in, AVPacket *pkt) { enum { BUF_SIZE=64 }; int supress_progress=in->cb.in&&in->cb.in->suppress_progress ?in->cb.in->suppress_progress(in->cb.data):0; AVStream *stream=in->fmt.ctx->streams[pkt->stream_index]; int64_t duration,begin; double percent; ff_inout_interval(in,&begin,&duration,stream); #if defined (FF_PROGRESS_STDERR) // [ ff_printer_reset(in->printer,stderr); #else // ] [ ff_printer_reset(in->printer); #endif // ] if (duration<0) { if (!supress_progress) { #if defined (_WIN32) // [ ff_printer_printf(in->printer,L"%I64d sec", pkt->pts*stream->time_base.num/stream->time_base.den); #else // ] [ ff_printer_printf(in->printer,"%" PRId64 " sec", pkt->pts*stream->time_base.num/stream->time_base.den); #endif // ] } return 0; } if (0<=begin) { pkt->pts-=begin; pkt->dts-=begin; } percent=0llpts&&0llpts/duration:0.0; if (!supress_progress) _FF_PRINTER_PRINTF(in->printer,"%.0f%%",percent); return duration<=pkt->pts?-1:0; } /////////////////////////////////////////////////////////////////////////////// #define FF_QUERY_CODEC static int ff_output_add_vstream(ff_inout_t *out) { ff_output_callback_t *ocb=out->cb.out; void *odata=out->cb.data; const ff_analyzer_t *a=ocb&&ocb->analyzer?ocb->analyzer(odata):NULL; ff_inout_t *in=a->in; AVStream *istream=in->fmt.ctx->streams[in->vi]; AVStream *ostream; int err=-1; #if defined (FF_QUERY_CODEC) // [ // err is interpreted as a boolean. err=avformat_query_codec(out->fmt.ctx->oformat, istream->codecpar->codec_id,1); if (err) { err=-1; #endif // ] istream=in->fmt.ctx->streams[in->vi]; out->vi=out->fmt.ctx->nb_streams; // if succeeding the stream will be added to out->fmt.ctx and hence // will be destroyed by calling avformat_free_context(). ostream=avformat_new_stream(out->fmt.ctx,NULL); if (!ostream) { _DMESSAGEV("creating video output stream: %s (%d)",av_err2str(err),err); goto e_video; } // we're going to remux. err=avcodec_parameters_copy(ostream->codecpar,istream->codecpar); if (err<0) { _DMESSAGE("copying codec parametrs"); goto e_video; } ostream->id=out->vi; ostream->time_base=istream->time_base; ostream->codecpar->codec_tag=0; // needed to copy embedded album art: ostream->disposition=istream->disposition; #if defined (FF_QUERY_CODEC) // [ } else { // the video is lost. _DWARNING("unable to remux video stream"); in->vi=-1; } #endif // ] return 0; e_video: return -1; } #define FF_CODECPAR_ALLOC #if defined (FF_FLAC_HACK) // [ static int ff_output_add_astream(ff_inout_t *out, enum AVSampleFormat sample_fmt) #else // ] [ static int ff_output_add_astream(ff_inout_t *out) #endif // ] { ff_output_callback_t *ocb=out->cb.out; void *odata=out->cb.data; const ff_analyzer_t *a=ocb&&ocb->analyzer?ocb->analyzer(odata):NULL; ff_inout_t *in=a->in; ff_input_callback_t *icb=in->cb.in; void *idata=in->cb.data; const ff_param_decode_t *decode=icb&&icb->decode?icb->decode(idata):NULL; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ int64_t channel_layout=decode?decode->request.channel_layout:-1ll; #else // ] [ AVChannelLayout ch_layout=decode->request.ch_layout; #endif // ] AVStream *istream=in->fmt.ctx->streams[in->ai]; AVStream *ostream; #if defined (FF_CODECPAR_ALLOC) // [ // from "avcodec.h": // sizeof(AVCodecParameters) is not a part of the public ABI, this // struct must be allocated with avcodec_parameters_alloc() and // freed with avcodec_parameters_free(). AVCodecParameters *codecpar; #else // ] [ AVCodecParameters codecpar; #endif // ] int err=-1; out->ai=out->fmt.ctx->nb_streams; // if succeeding the stream will be added to out->fmt.ctx and hence // will be destroyed by calling avformat_free_context(). ostream=avformat_new_stream(out->fmt.ctx,NULL); if (!ostream) { _DMESSAGEV("creating audio output stream: %s (%d)",av_err2str(err),err); goto e_audio; } ostream->id=out->ai; if (!in->audio.ctx) { out->audio.ctx=NULL; err=avcodec_parameters_copy(ostream->codecpar,istream->codecpar); if (err<0) { _DMESSAGE("copying codec parametrs"); goto e_audio; } ostream->time_base=istream->time_base; ostream->codecpar->codec_tag=0; // "avformat.h" states w.r.t. field "duration" of "struct AVStream": // Encoding: May be set by the caller before avformat_write_header() to // provide a hint to the muxer about the estimated duration. // // Unfortunately this doesn't seem to work with FLAC streams when // picking some interval. // Cf. "https://trac.ffmpeg.org/ticket/7864". ff_inout_interval(in,NULL,&ostream->duration,ostream); } else { #if defined (FF_FLAC_HACK) // [ if (AV_SAMPLE_FMT_NONE==sample_fmt) { sample_fmt=ocb&&ocb->sample_fmt ?ocb->sample_fmt(odata):AV_SAMPLE_FMT_NONE; } #endif // ] #if defined (FF_CODECPAR_ALLOC) // [ codecpar=avcodec_parameters_alloc(); if (!codecpar) { _DMESSAGE("allocating codecpar"); goto e_audio; } #if 0 // [ codecpar=*istream->codecpar; #else // ] [ if (avcodec_parameters_copy(codecpar,istream->codecpar)<0) { _DMESSAGE("copying codecpar"); goto e_audio; } #endif // ] codecpar->codec_id=ocb&&ocb->codec_id ?ocb->codec_id(odata,out->fmt.ctx->oformat):AV_CODEC_ID_FLAC; #if defined (FF_FLAC_HACK) // [ codecpar->format=sample_fmt; #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (0ll<=channel_layout) codecpar->channel_layout=channel_layout; #else // ] [ if (av_channel_layout_check(&ch_layout)) codecpar->ch_layout=ch_layout; #endif // ] err=ff_audio_create(&out->audio,out,NULL,codecpar); avcodec_parameters_free(&codecpar); #else // ] [ codecpar=*istream->codecpar; codecpar.codec_id=ocb&&ocb->codec_id ?ocb->codec_id(odata,out->fmt.ctx->oformat):AV_CODEC_ID_FLAC; codecpar.format=sample_fmt; if (0ll<=channel_layout) codecpar.channel_layout=channel_layout; err=ff_audio_create(&out->audio,out,NULL,&codecpar); #endif // ] fflush(stderr); if (err<0) { _DMESSAGEV("creating audio encoder: %s (%d)",av_err2str(err),err); goto e_audio; } } return 0; e_audio: return -1; } #if defined (FF_INPUT_LIST) // [ #if defined (FF_FLAC_HACK) // [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata, enum AVSampleFormat sample_fmt, int list) #else // ] [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata, int list) #endif // ] #else // ] [ #if defined (FF_FLAC_HACK) // [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata, enum AVSampleFormat sample_fmt) #else // ] [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata) #endif // ] #endif // ] { const char *path=ocb&&ocb->path?ocb->path(odata):""; const ff_analyzer_t *a=ocb&&ocb->analyzer?ocb->analyzer(odata):NULL; #if ! defined (FF_FLAC_HACK) // [ // enum AVSampleFormat sample_fmt // =ocb&&ocb->sample_fmt?ocb->sample_fmt(odata):AV_SAMPLE_FMT_NONE; #endif // ] ff_inout_t *in=a->in; #if defined (FF_STREAM_METADATA) // [ void (*metadata)(void *,AVDictionary **,const AVDictionary *, ff_metadata_type_t)=ocb?ocb->metadata:NULL; #else // ] [ void (*metadata)(void *,AVDictionary **,const AVDictionary *)= ocb?ocb->metadata:NULL; #endif // ] int err; ///////////////////////////////////////////////////////////////////////////// out->cb.out=ocb; out->cb.data=odata; out->printer=NULL; out->ai=-1; out->vi=-1; #if defined (FF_INPUT_LIST) // [ out->list=list; out->path=path; #endif // ] ///////////////////////////////////////////////////////////////////////////// out->fmt.ctx=NULL; //_DWRITELNV("\"%s\"",path); err=avformat_alloc_output_context2(&out->fmt.ctx,NULL,NULL,path); if (err<0) { _DMESSAGEV("allocating output context \"%s\": %s (%d)",path, av_err2str(err),err); goto e_format; } ///////////////////////////////////////////////////////////////////////////// if (0<=in->vi&&in->viai) { err=ff_output_add_vstream(out); if (err<0) { _DMESSAGE("creating video output stream"); goto e_video1; } } ///////////////////////////////////////////////////////////////////////////// if (0<=in->ai) { #if defined (FF_FLAC_HACK) // [ err=ff_output_add_astream(out,sample_fmt); #else // ] [ err=ff_output_add_astream(out); #endif // ] if (err<0) { _DMESSAGE("creating audio output stream"); goto e_audio; } } if (0<=in->ai&&in->aivi) { err=ff_output_add_vstream(out); if (err<0) { _DMESSAGE("creating video output stream"); goto e_video2; } } ///////////////////////////////////////////////////////////////////////////// if (!(out->fmt.ctx->oformat->flags&AVFMT_NOFILE)) { err=avio_open(&out->fmt.ctx->pb,path,AVIO_FLAG_WRITE); if (err<0) { _DMESSAGEV("open output file \"%s\": %s (%d)",path,av_err2str(err),err); goto e_open; } } ///////////////////////////////////////////////////////////////////////////// if (metadata) { #if defined (FF_STREAM_METADATA) // [ if (0<=out->vi&&0<=in->vi) { metadata(odata,&out->fmt.ctx->streams[out->vi]->metadata, in->fmt.ctx->streams[in->vi]->metadata,FF_METADATA_TYPE_VIDEO); } if (0<=out->ai&&0<=in->ai) { metadata(odata,&out->fmt.ctx->streams[out->ai]->metadata, in->fmt.ctx->streams[in->ai]->metadata,FF_METADATA_TYPE_AUDIO); } metadata(odata,&out->fmt.ctx->metadata,in->fmt.ctx->metadata, FF_METADATA_TYPE_FORMAT); #else // ] [ metadata(odata,&out->fmt.ctx->metadata,in->fmt.ctx->metadata); #endif // ] } ///////////////////////////////////////////////////////////////////////////// err=avformat_write_header(out->fmt.ctx,NULL); if (err<0) { _DMESSAGEV("writing header \"%s\": %s (%d)",path,av_err2str(err),err); goto e_header; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: av_write_trailer(out->fmt.ctx); e_header: if (!(out->fmt.ctx->oformat->flags&AVFMT_NOFILE)) avio_closep(&out->fmt.ctx->pb); e_open: if (out->audio.ctx) ff_audio_destroy(&out->audio); e_video2: e_audio: e_video1: avformat_free_context(out->fmt.ctx); e_format: return -1; } #if defined (FF_INPUT_LIST) // [ void ff_inout_list(ff_inout_t *inout, int out) { int err=av_log_get_level(); ///////////////////////////////////////////////////////////////////////////// #if defined (FF_INPUT_LIST) // [ if (inout->list||AV_LOG_INFO<=err) { #else // ] [ if (AV_LOG_INFO<=err) { #endif // ] fflush(stdout); fflush(stderr); if (errfmt.ctx,0,inout->path,out); fflush(stderr); if (errfmt.ctx); if (!(out->fmt.ctx->oformat->flags&AVFMT_NOFILE)) avio_closep(&out->fmt.ctx->pb); if (out->audio.ctx) ff_audio_destroy(&out->audio); avformat_free_context(out->fmt.ctx); } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // { FF_ENABLE_DEPRECATION_WARNINGS // ] #endif // } bs1770gain-0.9.8/libff/ff_fifo.c0000755000175000017500000001077415035710477013104 00000000000000/* * ff.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (FF_FIFO) // [ //#error 55 /////////////////////////////////////////////////////////////////////////////// // fifo not used. just for reference. int ff_fifo_create(ff_fifo_t *fifo, const AVCodecParameters *ocodecpar) { int err=-1; ///////////////////////////////////////////////////////////////////////////// fifo->ocodecpar=*ocodecpar; fifo->flush=0; ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ fifo->fifo=av_audio_fifo_alloc(ocodecpar->format,ocodecpar->channels,1); #else // ] [ fifo->fifo=av_audio_fifo_alloc(ocodecpar->format, ocodecpar->ch_layout.nb_channels,1); #endif // ] if (!fifo->fifo) { _DMESSAGE("allocating audio fifo"); err=AVERROR(ENOMEM); goto e_fifo; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: av_audio_fifo_free(fifo->fifo); e_fifo: return err; } void ff_fifo_destroy(ff_fifo_t *fifo) { av_audio_fifo_free(fifo->fifo); } /////////////////////////////////////////////////////////////////////////////// int ff_fifo_size(ff_fifo_t *fifo) { return av_audio_fifo_size(fifo->fifo); } int ff_fifo_send_frame(ff_fifo_t *fifo, AVFrame *frame) { int err=-1; int frame_size=frame->nb_samples; int fifo_size=av_audio_fifo_size(fifo->fifo); if (!frame) { fifo->flush=1; return 0; } // make the fifo as large as it needs to be to hold both, // the old and the new samples. err=av_audio_fifo_realloc(fifo->fifo,fifo_size+frame_size); if (err<0) { _DMESSAGE("reallocating"); goto e_realloc; } // store the new samples in the fifo buffer. err=av_audio_fifo_write(fifo->fifo,(void **)frame->data,frame->nb_samples); if (errnb_samples) { _DMESSAGE("writing"); err=AVERROR_EXIT; goto e_write; } ///////////////////////////////////////////////////////////////////////////// _DWRITELNV("%d",frame->nb_samples); return 0; e_write: e_realloc: return err; } int ff_fifo_receive_frame(ff_fifo_t *fifo, AVFrame *frame) { int err=-1; int fifo_size=av_audio_fifo_size(fifo->fifo); int frame_size=fifo->ocodecpar.frame_sizeocodecpar.frame_size:fifo_size;; ///////////////////////////////////////////////////////////////////////////// if (fifo->flush&&!fifo_size) return AVERROR_EOF; else if (!fifo->flush&&fifo_sizeocodecpar.frame_size) return AVERROR(EAGAIN); ///////////////////////////////////////////////////////////////////////////// // set the frame's parameters, especially its size and format. // av_frame_get_buffer needs this to allocate memory for the // audio samples of the frame. // default channel layouts based on the number of channels // are assumed for simplicity. frame->nb_samples=frame_size; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ frame->channel_layout=fifo->ocodecpar.channel_layout; #else // ] [ frame->ch_layout=fifo->ocodecpar.ch_layout; #endif // ] frame->format=fifo->ocodecpar.format; frame->sample_rate=fifo->ocodecpar.sample_rate; ///////////////////////////////////////////////////////////////////////////// err=av_frame_get_buffer(frame,0); if (err<0) { _DMESSAGE("getting frame buffer"); goto e_buffer; } ///////////////////////////////////////////////////////////////////////////// err=av_audio_fifo_read(fifo->fifo,(void **)frame->data,frame->nb_samples); if (errnb_samples) { _DMESSAGE("reading from fifo"); err=AVERROR_EXIT; goto e_read; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_read: e_buffer: return err; } #endif // ] bs1770gain-0.9.8/libff/ff_filter.c0000755000175000017500000004055515035710477013446 00000000000000/* * ff_filter.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #include #include #if 1 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #endif // } #if defined (FF_FILTER_REDESIGNED) // [ #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_HOLZHAMMER) // { FF_DISABLE_DEPRECATION_WARNINGS // [ #endif // ] /////////////////////////////////////////////////////////////////////////////// int ff_filter_create(ff_filter_t *f FFUNUSED, const AVCodecParameters *ocodecpar FFUNUSED, const AVCodecParameters *icodecpar FFUNUSED, AVRational time_base FFUNUSED, const char *descr) { // cf. "/doc/examples/filtering_audio.c". int err=0; #if defined (FF_FILTER_REDESIGNED) // [ AVFilterGraph *filter_graph; AVFilterContext *abuffer_ctx; const AVFilter *abuffer; AVFilterContext *volume_ctx; const AVFilter *volume; AVFilterContext *aformat_ctx; const AVFilter *aformat; AVFilterContext *abuffersink_ctx FFUNUSED; const AVFilter *abuffersink FFUNUSED; //AVDictionary *options_dict; char options_str[1024]; char ch_layout[64]; ENTER(__func__); /* Create a new filtergraph, which will contain all the filters. */ filter_graph = avfilter_graph_alloc(); if (!filter_graph) { _DMESSAGE("Unable to create filter graph.\n"); err= AVERROR(ENOMEM); goto e_filter_graph; } /* Create the abuffer filter; * it will be used for feeding the data into the graph. */ abuffer = avfilter_get_by_name("abuffer"); if (!abuffer) { _DMESSAGE("Could not find the abuffer filter.\n"); err=AVERROR_FILTER_NOT_FOUND; goto e_abuffer; } abuffer_ctx = avfilter_graph_alloc_filter(filter_graph, abuffer, "src"); if (!abuffer_ctx) { _DMESSAGE("Could not allocate the abuffer instance.\n"); err= AVERROR(ENOMEM); goto e_abuffer_ctx; } av_channel_layout_describe(&icodecpar->ch_layout, ch_layout,sizeof(ch_layout)); #if 1 // [ /* Set the filter options through the AVOptions API. */ err=av_opt_set (abuffer_ctx, "channel_layout", ch_layout, AV_OPT_SEARCH_CHILDREN); if (err<0) { _DMESSAGE("Could not set option 'channel_layout' to abuffer_ctx"); goto e_abuffer_ctx_opt_set; } err=av_opt_set (abuffer_ctx, "sample_fmt", av_get_sample_fmt_name(icodecpar->format), AV_OPT_SEARCH_CHILDREN); if (err<0) { _DMESSAGE("Could not set option 'sample_fmt' to abuffer_ctx"); goto e_abuffer_ctx_opt_set; } #if 0 // [ av_opt_set_q (abuffer_ctx, "time_base", (AVRational){ 1, icodecpar->sample_rate }, AV_OPT_SEARCH_CHILDREN); #else // ] [ err=av_opt_set_q (abuffer_ctx, "time_base", time_base, AV_OPT_SEARCH_CHILDREN); if (err<0) { _DMESSAGE("Could not set option 'time_base' to abuffer_ctx"); goto e_abuffer_ctx_opt_set; } #endif // ] err=av_opt_set_int(abuffer_ctx, "sample_rate", icodecpar->sample_rate, AV_OPT_SEARCH_CHILDREN); if (err<0) { _DMESSAGE("Could not set option 'sample_rate' to abuffer_ctx"); goto e_abuffer_ctx_opt_set; } /* Now initialize the filter; we pass NULL options, since we have already * set all the options above. */ err = avfilter_init_str(abuffer_ctx, NULL); if (err < 0) { _DMESSAGEV("Could not initialize the abuffer filter: %s.\n", av_err2str(err)); goto e_abuffer_ctx_init; } #else // ] [ /* A third way of passing the options is in a string of the form * key1=value1:key2=value2.... */ snprintf(options_str, sizeof(options_str), "sample_fmts=%s:sample_rates=%d:channel_layouts=%s", av_get_sample_fmt_name(icodecpar->format), icodecpar->sample_rate, ch_layout); err=avfilter_init_str(abuffer_ctx, options_str); if (err < 0) { _DMESSAGE("Could not initialize the abuffer filter.\n"); fprintf(stderr,"%s\n",options_str); goto e_abuffer_ctx_init; } #endif // ] /* Create volume filter. */ volume=avfilter_get_by_name("volume"); if (!volume) { _DMESSAGE("Could not find the volume filter.\n"); err=AVERROR_FILTER_NOT_FOUND; goto e_volume; } volume_ctx=avfilter_graph_alloc_filter(filter_graph, volume, "volume"); if (!volume_ctx) { _DMESSAGE("Could not allocate the volume instance.\n"); err=AVERROR(ENOMEM); goto e_volume_ctx; } #if 0 // [ /* A different way of passing the options is as key/value pairs in a * dictionary. */ PUTS(__FILE__,__LINE__,"\n"); err=av_dict_set(&options_dict, "volume", descr, 0); PUTS(__FILE__,__LINE__,"\n"); if (err<0) { _DMESSAGE("Could not set dictionary.\n"); goto e_dict_set; } err = avfilter_init_dict(volume_ctx, &options_dict); av_dict_free(&options_dict); if (err < 0) { _DMESSAGE("Could not initialize the volume filter.\n"); goto e_volume_ctx_init; } #else // ] [ err = avfilter_init_str(volume_ctx, descr); if (err < 0) { _DMESSAGE("Could not initialize the aformat filter.\n"); goto e_volume_ctx_init; } #endif // ] /* Create the aformat filter; * it ensures that the output is of the format we want. */ aformat = avfilter_get_by_name("aformat"); if (!aformat) { _DMESSAGE("Could not find the aformat filter.\n"); err= AVERROR_FILTER_NOT_FOUND; goto e_aformat; } aformat_ctx = avfilter_graph_alloc_filter(filter_graph, aformat, "aformat"); if (!aformat_ctx) { _DMESSAGE("Could not allocate the aformat instance.\n"); err= AVERROR(ENOMEM); goto e_aformat_ctx; } /* A third way of passing the options is in a string of the form * key1=value1:key2=value2.... */ snprintf(options_str, sizeof(options_str), "sample_fmts=%s:sample_rates=%d:channel_layouts=stereo", av_get_sample_fmt_name(AV_SAMPLE_FMT_S16), 44100); err = avfilter_init_str(aformat_ctx, options_str); if (err < 0) { _DMESSAGE("Could not initialize the aformat filter.\n"); goto e_aformat_ctx_init; } /* Finally create the abuffersink filter; * it will be used to get the filtered data out of the graph. */ abuffersink = avfilter_get_by_name("abuffersink"); if (!abuffersink) { _DMESSAGE("Could not find the abuffersink filter.\n"); err= AVERROR_FILTER_NOT_FOUND; goto e_abuffersink; } abuffersink_ctx = avfilter_graph_alloc_filter(filter_graph, abuffersink, "sink"); if (!abuffersink_ctx) { _DMESSAGE("Could not allocate the abuffersink instance.\n"); err= AVERROR(ENOMEM); goto e_abuffersink_ctx; } /* This filter takes no options. */ err = avfilter_init_str(abuffersink_ctx, NULL); if (err < 0) { _DMESSAGEV("Could not initialize the abuffersink instance: %s.\n", av_err2str(err)); goto e_abuffersink_ctx_init; } /* Connect the filters; * in this simple case the filters just form a linear chain. */ err = avfilter_link(abuffer_ctx, 0, volume_ctx, 0); if (err >= 0) err = avfilter_link(volume_ctx, 0, aformat_ctx, 0); if (err >= 0) err = avfilter_link(aformat_ctx, 0, abuffersink_ctx, 0); if (err < 0) { _DMESSAGEV("Error connecting filters: %s\n",av_err2str(err)); goto e_connect; } /* Configure the graph. */ err = avfilter_graph_config(filter_graph,NULL); if (err < 0) { _DMESSAGEV("Error configuring the filter graph: %s\n", av_err2str(err)); goto e_avfilter_graph_config; } f->graph=filter_graph; f->ctx.src=abuffer_ctx; f->ctx.sink=abuffersink_ctx; //return 0; return RETURN_INT(__FILE__,__LINE__,0); e_avfilter_graph_config: e_connect: e_abuffersink_ctx_init: avfilter_free(abuffersink_ctx); e_abuffersink_ctx: e_abuffersink: e_aformat_ctx_init: avfilter_free(aformat_ctx); e_aformat_ctx: e_aformat: e_volume_ctx_init: avfilter_free(volume_ctx); //e_dict_set: e_volume_ctx: e_volume: e_abuffer_ctx_opt_set: e_abuffer_ctx_init: avfilter_free(abuffer_ctx); e_abuffer_ctx: e_abuffer: avfilter_graph_free (&filter_graph); e_filter_graph: #else // ] [ #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [ const enum AVSampleFormat *sink_sample_fmts FFUNUSED; #else // ] [ const enum AVSampleFormat sink_sample_fmts[] FFUNUSED ={ ocodecpar->format,-1 }; #endif // ] #if defined(FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ const int64_t sink_channel_layouts[] FFUNUSED ={ ocodecpar->channel_layout,-1 }; #endif // ] #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [ const int *sink_sample_rates FFUNUSED; #else // ] [ const int sink_sample_rates[] FFUNUSED ={ ocodecpar->sample_rate,-1 }; #endif // ] char args[512]; FF_CONST AVCodec *ocodec; struct { const AVFilter *f; AVFilterInOut *in; } src; struct { const AVFilter *f; AVFilterInOut *out; } sink; ENTER(__func__); ///////////////////////////////////////////////////////////////////////////// f->graph=avfilter_graph_alloc(); if (!f->graph) { _DMESSAGE("allocating filter graph"); err=AVERROR(ENOMEM); goto e_graph; } ///////////////////////////////////////////////////////////////////////////// // buffer audio source: the decoded frames from the decoder will // be inserted here. src.f=avfilter_get_by_name("abuffer"); if (!src.f) { _DMESSAGE("audio filter \"abuffer\" not available"); err=-1; goto e_src; } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ snprintf(args,sizeof args, "time_base=%d/%d" ":sample_rate=%d" ":sample_fmt=%s" ":channel_layout=0x%"PRIx64, time_base.num, time_base.den, icodecpar->sample_rate, av_get_sample_fmt_name(icodecpar->format), icodecpar->channel_layout ); err=avfilter_graph_create_filter(&f->ctx.src,src.f,"in",args,NULL,f->graph); if (err<0) { _DMESSAGEV("creating filter source: %s (%d)",av_err2str(err),err); goto e_srcctx; } #else // ] [ err=snprintf(args,sizeof args, "time_base=%d/%d" ":sample_rate=%d" ":sample_fmt=%s" ":channel_layout=", time_base.num, time_base.den, icodecpar->sample_rate, av_get_sample_fmt_name(icodecpar->format) ); av_channel_layout_describe(&icodecpar->ch_layout, args+err,sizeof(args)-err); //_DWARNINGV("\"%s\"",args); err=avfilter_graph_create_filter(&f->ctx.src,src.f,"in",args,NULL,f->graph); if (err<0) { _DMESSAGEV("creating filter source: %s (%d)",av_err2str(err),err); goto e_srcctx; } #endif // ] ///////////////////////////////////////////////////////////////////////////// // buffer audio sink: to terminate the filter chain. sink.f=avfilter_get_by_name("abuffersink"); if (!sink.f) { _DMESSAGE("audio filter \"abuffersink\" not available"); err=-1; goto e_sink; } ///////////////////////////////////////////////////////////////////////////// err=avfilter_graph_create_filter(&f->ctx.sink,sink.f,"out",NULL,NULL, f->graph); if (err<0) { _DMESSAGEV("creating filter sink: %s (%d)",av_err2str(err),err); goto e_sinkctx; } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [ /* err= avcodec_get_supported_config(dec_ctx,NULL,AV_CODEC_CONFIG_PIX_FORMAT, 0,(const void**)&sink_sample_fmts,NULL); */ err=av_opt_set_bin(f->ctx.sink,"sample_fmts", sink_sample_fmts,-1,AV_OPT_SEARCH_CHILDREN|AV_OPT_TYPE_FLAG_ARRAY); #else // ] [ err=av_opt_set_int_list(f->ctx.sink,"sample_fmts", sink_sample_fmts,-1,AV_OPT_SEARCH_CHILDREN); #endif // ] if (err<0) { _DMESSAGEV("setting output sample format: %s (%d)",av_err2str(err),err); goto e_sinkargs; } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ err=av_opt_set_int_list(f->ctx.sink,"channel_layouts", sink_channel_layouts,-1,AV_OPT_SEARCH_CHILDREN); #elif 1 // ] [ av_channel_layout_describe(&ocodecpar->ch_layout, args,sizeof(args)); err=av_opt_set(f->ctx.sink,"ch_layouts",args,AV_OPT_SEARCH_CHILDREN); #endif // ] if (err<0) { _DMESSAGEV("setting output channel layout: %s (%d)",av_err2str(err),err); goto e_sinkargs; } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [ #else // ] [ err=av_opt_set_int_list(f->ctx.sink,"sample_rates", sink_sample_rates,-1,AV_OPT_SEARCH_CHILDREN); #endif // ] if (err<0) { _DMESSAGEV("setting output sample rate: %s (%d)",av_err2str(err),err); goto e_sinkargs; } ///////////////////////////////////////////////////////////////////////////// /* * Set the endpoints for the filter graph. The filter_graph will * be linked to the graph described by filters_descr. */ /* * The buffer source output must be connected to the input pad of * the first filter described by filters_descr; since the first * filter input label is not specified, it is set to "in" by * default. */ sink.out=avfilter_inout_alloc(); if (!sink.out) { _DMESSAGE("allocating outputs"); goto e_outputs; } sink.out->name=av_strdup("in"); if (!sink.out->name) { _DMESSAGE("duplicating sink name"); goto e_sinkname; } sink.out->filter_ctx=f->ctx.src; sink.out->pad_idx=0; sink.out->next= NULL; /* * The buffer sink input must be connected to the output pad of * the last filter described by filters_descr; since the last * filter output label is not specified, it is set to "out" by * default. */ src.in=avfilter_inout_alloc(); if (!src.in) { _DMESSAGE("allocating inputs"); goto e_inputs; } src.in->name=av_strdup("out"); if (!src.in->name) { _DMESSAGE("duplicating source name"); goto e_srcname; } src.in->filter_ctx=f->ctx.sink; src.in->pad_idx=0; src.in->next=NULL; ///////////////////////////////////////////////////////////////////////////// err=avfilter_graph_parse_ptr(f->graph,descr,&src.in, &sink.out,NULL); if (err<0) { _DMESSAGEV("parsing: %s (%d)",av_err2str(err),err); goto e_parse; } ///////////////////////////////////////////////////////////////////////////// err=avfilter_graph_config(f->graph,NULL); if (err<0) { _DMESSAGEV("onfiguring: %s (%d)",av_err2str(err),err); goto e_config; } ///////////////////////////////////////////////////////////////////////////// // needs to be called when the graph already has been linked. ocodec=avcodec_find_encoder(ocodecpar->codec_id); if (!ocodec) { _DMESSAGE("target codec doesn't exist"); goto e_ocodec; } if (!(ocodec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) av_buffersink_set_frame_size(f->ctx.sink,ocodecpar->frame_size); ///////////////////////////////////////////////////////////////////////////// avfilter_inout_free(&src.in); avfilter_inout_free(&sink.out); /////////////////////////////////////////////////////////////////////////// //return 0; return RETURN_INT(__FILE__,__LINE__,0); e_ocodec: e_config: e_parse: e_srcname: avfilter_inout_free(&src.in); e_inputs: e_sinkname: avfilter_inout_free(&sink.out); e_outputs: e_sinkargs: e_sinkctx: e_sink: e_srcctx: e_src: avfilter_graph_free(&f->graph); e_graph: #endif // ] //return err; return RETURN_INT(__FILE__,__LINE__,err); } void ff_filter_destroy(ff_filter_t *f) { avfilter_graph_free(&f->graph); } /////////////////////////////////////////////////////////////////////////////// int ff_filter_send_frame(ff_filter_t *f, AVFrame *frame) { return av_buffersrc_add_frame(f->ctx.src,frame); } int ff_filter_receive_frame(ff_filter_t *f, AVFrame *frame) { return av_buffersink_get_frame(f->ctx.sink,frame); } #if defined (FF_HOLZHAMMER) // { FF_ENABLE_DEPRECATION_WARNINGS // ] #endif // ] bs1770gain-0.9.8/libff/ff_mkdir.c0000755000175000017500000000477215035710477013270 00000000000000/* * ff_mkdir.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (_WIN32) // [ #include //#include //#define FFSEPSTRING FFL("\\") //#define FFSTRTOK(str,delim,saveptr) wcstok(str,delim) //#define FFSTAT(path,buf) _wstat(path,buf) //#define FFMKDIR(path) _wmkdir(path) //typedef struct _stat ffstat_t; #else // ] [ //#include //#include #include //#define FFSEPSTRING FFL("/") //#define FFSTRTOK(str,delim,saveptr) strtok_r(str,delim,saveptr) //#define FFSTAT(path,buf) stat(path,buf) //#define FFMKDIR(path) mkdir(path,S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) typedef struct stat ffstat_t; #endif // ] /* int fffexists(const ffchar_t *path) { ffstat_t statbuf; return FFSTAT(path,&statbuf)<0?0:1; } */ /* int fffcmp(const ffchar_t *lpath, const ffchar_t *rpath) { ffstat_t lhs,rhs; int cmp; if (FFSTAT(lpath,&lhs)<0) return -1; else if (FFSTAT(rpath,&rhs)<0) return 1; else if ((cmp=lhs.st_dev-rhs.st_dev)) return cmp; else if ((cmp=lhs.st_ino-rhs.st_ino)) return cmp; else return 0; } */ int ff_mkdir(ffchar_t *path) { ffchar_t *pp=path; if (!path) goto success; #if defined (_WIN32) // [ else if (1 * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include int ff_printer_create(ff_printer_t *p, FILE *f) { p->f=f; p->len=0u; return 0; } void ff_printer_destroy(ff_printer_t *p FFUNUSED) { } void ff_printer_clear(ff_printer_t *p) { p->len=0u; } #if defined (FF_PROGRESS_STDERR) // [ void ff_printer_reset(ff_printer_t *p, FILE *f) #else // ] [ void ff_printer_reset(ff_printer_t *p) #endif // ] { size_t i; #if defined (FF_PROGRESS_STDERR) // [ if (f) p->f=f; #endif // ] for (i=0u;ilen;++i) { #if defined (_WIN32) // [ fwprintf(p->f,L"\b"); #else // ] [ fputc('\b',p->f); #endif // ] } p->len=0u; } #if defined (FF_PROGRESS_STDERR) // [ void ff_printer_flush(ff_printer_t *p, FILE *f) #else // ] [ void ff_printer_flush(ff_printer_t *p) #endif // ] { size_t i; for (i=0u;ilen;++i) { #if defined (_WIN32) // [ fwprintf(p->f,L"\b"); #else // ] [ fputc('\b',p->f); #endif // ] } for (i=0u;ilen;++i) { #if defined (_WIN32) // [ fwprintf(p->f,L" "); #else // ] [ fputc(' ',p->f); #endif // ] } for (i=0u;ilen;++i) { #if defined (_WIN32) // [ fwprintf(p->f,L"\b"); #else // ] [ fputc('\b',p->f); #endif // ] } p->len=0u; fflush(p->f); #if defined (FF_PROGRESS_STDERR) // [ p->f=f; #endif // ] } int ff_printer_printf(ff_printer_t *p, const ffchar_t *format, ...) { va_list ap; va_start(ap,format); #if defined (_WIN32) // [ p->len=vfwprintf(p->f,format,ap); #else // ] [ p->len=vfprintf(p->f,format,ap); #endif // ] va_end(ap); fflush(p->f); return p->len; } bs1770gain-0.9.8/libff/ff_iter.c0000755000175000017500000004626715035710477013132 00000000000000/* * ff_iter.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #include #if 1 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // { FF_DISABLE_DEPRECATION_WARNINGS // [ #endif // } /////////////////////////////////////////////////////////////////////////////// static ff_iter_vmt_t ff_iter_s16i_vmt; static ff_iter_vmt_t ff_iter_s32i_vmt; static ff_iter_vmt_t ff_iter_flti_vmt; static ff_iter_vmt_t ff_iter_dbli_vmt; static ff_iter_vmt_t ff_iter_s16p_vmt; static ff_iter_vmt_t ff_iter_s32p_vmt; static ff_iter_vmt_t ff_iter_fltp_vmt; static ff_iter_vmt_t ff_iter_dblp_vmt; static ff_iter_vmt_t ff_iter_err_vmt; /////////////////////////////////////////////////////////////////////////////// int ff_iter_first(ff_iter_t *i, const AVFrame *frame) { i->frame=frame; switch (frame->format) { ///////////////////////////////////////////////////////////////////////////// case AV_SAMPLE_FMT_NONE: _DMESSAGE("format AV_SAMPLE_FMT_NONE not supported"); goto exit; // interleaved ////////////////////////////////////////////////////////////// case AV_SAMPLE_FMT_U8: _DMESSAGE("format AV_SAMPLE_FMT_U8 not supported"); goto exit; case AV_SAMPLE_FMT_S16: i->vmt=&ff_iter_s16i_vmt; break; case AV_SAMPLE_FMT_S32: i->vmt=&ff_iter_s32i_vmt; break; case AV_SAMPLE_FMT_FLT: i->vmt=&ff_iter_flti_vmt; break; case AV_SAMPLE_FMT_DBL: i->vmt=&ff_iter_dbli_vmt; break; // planar /////////////////////////////////////////////////////////////////// case AV_SAMPLE_FMT_U8P: _DMESSAGE("format AV_SAMPLE_FMT_U8P not supported"); goto exit; case AV_SAMPLE_FMT_S16P: i->vmt=&ff_iter_s16p_vmt; break; case AV_SAMPLE_FMT_S32P: i->vmt=&ff_iter_s32p_vmt; break; case AV_SAMPLE_FMT_FLTP: i->vmt=&ff_iter_fltp_vmt; break; case AV_SAMPLE_FMT_DBLP: i->vmt=&ff_iter_dblp_vmt; break; ///////////////////////////////////////////////////////////////////////////// case AV_SAMPLE_FMT_NB: // Number of sample formats. DO NOT USE if linking dynamically. _DMESSAGE("format AV_SAMPLE_FMT_NB not supported"); goto exit; default: _DMESSAGEV("format %d not supported",frame->format); goto exit; } ///////////////////////////////////////////////////////////////////////////// i->vmt->first(i); ///////////////////////////////////////////////////////////////////////////// return 0; exit: i->vmt=&ff_iter_err_vmt; return -1; } /////////////////////////////////////////////////////////////////////////////// #define FF_INT16_SCALE (1.0/PBU_MAXOF(int16_t)) #define FF_INT32_SCALE (1.0/PBU_MAXOF(int32_t)) #define FF_INT16_SCALE_NEG (1.0/(1.0+PBU_MAXOF(int16_t))) #define FF_INT32_SCALE_NEG (1.0/(1.0+PBU_MAXOF(int32_t))) static void ff_iter_norm(ff_iter_t *i FFUNUSED, double *x, double *max, int channels, int ch, double sample) { if (x) { if (channelsi.s16.rp=(int16_t *)i->frame->data[0]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.s16.mp=i->i.s16.rp+i->frame->channels*i->frame->nb_samples; #else // ] [ i->i.s16.mp=i->i.s16.rp+i->frame->ch_layout.nb_channels*i->frame->nb_samples; #endif // ] } static int ff_iter_s16i_valid(ff_iter_t *i) { return i->i.s16.rpi.s16.mp; } static void ff_iter_s16i_next(ff_iter_t *i) { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.s16.rp+=i->frame->channels; #else // ] [ i->i.s16.rp+=i->frame->ch_layout.nb_channels; #endif // ] } static void ff_iter_s16i_norm(ff_iter_t *i, double *x, double *max) { int ch; int16_t sample; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { sample=i->i.s16.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT16_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT16_SCALE*sample); } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { sample=i->i.s16.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT16_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT16_SCALE*sample); } #endif // ] } static ff_iter_vmt_t ff_iter_s16i_vmt={ .id="s16i", .first=ff_iter_s16i_first, .valid=ff_iter_s16i_valid, .next=ff_iter_s16i_next, .norm=ff_iter_s16i_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_s32i_first(ff_iter_t *i) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->i.s32.rp=(int32_t *)i->frame->data[0]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.s32.mp=i->i.s32.rp+i->frame->channels*i->frame->nb_samples; #else // ] [ i->i.s32.mp=i->i.s32.rp+i->frame->ch_layout.nb_channels*i->frame->nb_samples; #endif // ] } static int ff_iter_s32i_valid(ff_iter_t *i) { return i->i.s32.rpi.s32.mp; } static void ff_iter_s32i_next(ff_iter_t *i) { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.s32.rp+=i->frame->channels; #else // ] [ i->i.s32.rp+=i->frame->ch_layout.nb_channels; #endif // ] } static void ff_iter_s32i_norm(ff_iter_t *i, double *x, double *max) { int ch; int32_t sample; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { sample=i->i.s32.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT32_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT32_SCALE*sample); } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { sample=i->i.s32.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT32_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT32_SCALE*sample); } #endif // ] } static ff_iter_vmt_t ff_iter_s32i_vmt={ .id="s32i", .first=ff_iter_s32i_first, .valid=ff_iter_s32i_valid, .next=ff_iter_s32i_next, .norm=ff_iter_s32i_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_flti_first(ff_iter_t *i) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->i.flt.rp=(float *)i->frame->data[0]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.flt.mp=i->i.flt.rp+i->frame->channels*i->frame->nb_samples; #else // ] [ i->i.flt.mp=i->i.flt.rp+i->frame->ch_layout.nb_channels*i->frame->nb_samples; #endif // ] } static int ff_iter_flti_valid(ff_iter_t *i) { return i->i.flt.rpi.flt.mp; } static void ff_iter_flti_next(ff_iter_t *i) { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.flt.rp+=i->frame->channels; #else // ] [ i->i.flt.rp+=i->frame->ch_layout.nb_channels; #endif // ] } static void ff_iter_flti_norm(ff_iter_t *i, double *x, double *max) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ff_iter_norm(i,x,max,i->frame->channels,ch,i->i.flt.rp[ch]); #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch,i->i.flt.rp[ch]); #endif // ] } static ff_iter_vmt_t ff_iter_flti_vmt={ .id="flti", .first=ff_iter_flti_first, .valid=ff_iter_flti_valid, .next=ff_iter_flti_next, .norm=ff_iter_flti_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_dbli_first(ff_iter_t *i) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->i.dbl.rp=(double *)i->frame->data[0]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.dbl.mp=i->i.dbl.rp+i->frame->channels*i->frame->nb_samples; #else // ] [ i->i.dbl.mp=i->i.dbl.rp+i->frame->ch_layout.nb_channels*i->frame->nb_samples; #endif // ] } static int ff_iter_dbli_valid(ff_iter_t *i) { return i->i.dbl.rpi.dbl.mp; } static void ff_iter_dbli_next(ff_iter_t *i) { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ i->i.dbl.rp+=i->frame->channels; #else // ] [ i->i.dbl.rp+=i->frame->ch_layout.nb_channels; #endif // ] } static void ff_iter_dbli_norm(ff_iter_t *i, double *x, double *max) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ff_iter_norm(i,x,max,i->frame->channels,ch,i->i.dbl.rp[ch]); #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch,i->i.dbl.rp[ch]); #endif // ] } static ff_iter_vmt_t ff_iter_dbli_vmt={ .id="dbli", .first=ff_iter_dbli_first, .valid=ff_iter_dbli_valid, .next=ff_iter_dbli_next, .norm=ff_iter_dbli_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_s16p_first(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.s16.rp[ch]=(int16_t *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.s16.rp[ch]=(int16_t *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #endif // ] i->p.s16.mp=i->p.s16.rp[0]+i->frame->nb_samples; } static int ff_iter_s16p_valid(ff_iter_t *i) { return i->p.s16.rp[0]p.s16.mp; } static void ff_iter_s16p_next(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ++i->p.s16.rp[ch]; #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ++i->p.s16.rp[ch]; #endif // ] } static void ff_iter_s16p_norm(ff_iter_t *i, double *x, double *max) { int ch; int16_t sample; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { sample=*i->p.s16.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT16_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT16_SCALE*sample); } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { sample=*i->p.s16.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT16_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT16_SCALE*sample); } #endif // ] } static ff_iter_vmt_t ff_iter_s16p_vmt={ .id="s16p", .first=ff_iter_s16p_first, .valid=ff_iter_s16p_valid, .next=ff_iter_s16p_next, .norm=ff_iter_s16p_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_s32p_first(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.s32.rp[ch]=(int32_t *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.s32.rp[ch]=(int32_t *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #endif // ] i->p.s32.mp=i->p.s32.rp[0]+i->frame->nb_samples; } static int ff_iter_s32p_valid(ff_iter_t *i) { return i->p.s32.rp[0]p.s32.mp; } static void ff_iter_s32p_next(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ++i->p.s32.rp[ch]; #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ++i->p.s32.rp[ch]; #endif // ] } static void ff_iter_s32p_norm(ff_iter_t *i, double *x, double *max) { int ch; int32_t sample; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { sample=*i->p.s32.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT32_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->channels,ch,FF_INT32_SCALE*sample); } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { sample=*i->p.s32.rp[ch]; if (sample<0) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT32_SCALE_NEG*sample); else ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch, FF_INT32_SCALE*sample); } #endif // ] } static ff_iter_vmt_t ff_iter_s32p_vmt={ .id="s32p", .first=ff_iter_s32p_first, .valid=ff_iter_s32p_valid, .next=ff_iter_s32p_next, .norm=ff_iter_s32p_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_fltp_first(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.flt.rp[ch]=(float *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.flt.rp[ch]=(float *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #endif // ] i->p.flt.mp=i->p.flt.rp[0]+i->frame->nb_samples; } static int ff_iter_fltp_valid(ff_iter_t *i) { return i->p.flt.rp[0]p.flt.mp; } static void ff_iter_fltp_next(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ++i->p.flt.rp[ch]; #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ++i->p.flt.rp[ch]; #endif // ] } static void ff_iter_fltp_norm(ff_iter_t *i, double *x, double *max) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ff_iter_norm(i,x,max,i->frame->channels,ch,*i->p.flt.rp[ch]); #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch,*i->p.flt.rp[ch]); #endif // ] } static ff_iter_vmt_t ff_iter_fltp_vmt={ .id="fltp", .first=ff_iter_fltp_first, .valid=ff_iter_fltp_valid, .next=ff_iter_fltp_next, .norm=ff_iter_fltp_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_dblp_first(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.dbl.rp[ch]=(double *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) { #if defined (__GNUC__) // [ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" #endif // ] i->p.dbl.rp[ch]=(double *)i->frame->data[ch]; #if defined (__GNUC__) // [ #pragma GCC diagnostic pop #endif // ] } #endif // ] i->p.dbl.mp=i->p.dbl.rp[0]+i->frame->nb_samples; } static int ff_iter_dblp_valid(ff_iter_t *i) { return i->p.dbl.rp[0]p.dbl.mp; } static void ff_iter_dblp_next(ff_iter_t *i) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ++i->p.dbl.rp[ch]; #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ++i->p.dbl.rp[ch]; #endif // ] } static void ff_iter_dblp_norm(ff_iter_t *i, double *x, double *max) { int ch; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (ch=0;chframe->channels;++ch) ff_iter_norm(i,x,max,i->frame->channels,ch,*i->p.dbl.rp[ch]); #else // ] [ for (ch=0;chframe->ch_layout.nb_channels;++ch) ff_iter_norm(i,x,max,i->frame->ch_layout.nb_channels,ch,*i->p.dbl.rp[ch]); #endif // ] } static ff_iter_vmt_t ff_iter_dblp_vmt={ .id="dblp", .first=ff_iter_dblp_first, .valid=ff_iter_dblp_valid, .next=ff_iter_dblp_next, .norm=ff_iter_dblp_norm, }; /////////////////////////////////////////////////////////////////////////////// static void ff_iter_err_first(ff_iter_t *i FFUNUSED) { _DMESSAGE("invalid frame iterator"); } static int ff_iter_err_valid(ff_iter_t *i FFUNUSED) { _DMESSAGE("invalid frame iterator"); return 0; } static void ff_iter_err_next(ff_iter_t *i FFUNUSED) { _DMESSAGE("invalid frame iterator"); } static void ff_iter_err_norm(ff_iter_t *i FFUNUSED, double *x FFUNUSED, double *max FFUNUSED) { _DMESSAGE("invalid frame iterator"); } static ff_iter_vmt_t ff_iter_err_vmt={ .id="err", .first=ff_iter_err_first, .valid=ff_iter_err_valid, .next=ff_iter_err_next, .norm=ff_iter_err_norm, }; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // { FF_ENABLE_DEPRECATION_WARNINGS // ] #endif // } bs1770gain-0.9.8/libff/ff_audio.c0000755000175000017500000002446515035710477013264 00000000000000/* * ff_audio.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 1 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #endif // } #if 0 // { #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_HOLZHAMMER) // { FF_DISABLE_DEPRECATION_WARNINGS // [ #endif // } /////////////////////////////////////////////////////////////////////////////// //#define FF_OUTPUT_BIT_RATE 96000 /////////////////////////////////////////////////////////////////////////////// int ff_audio_create(ff_audio_t *audio, ff_inout_t *inout, const ff_param_decode_t *iparam, const AVCodecParameters *ocodecpar) { AVStream *stream=inout->fmt.ctx->streams[inout->ai]; AVCodecParameters *codecpar=stream->codecpar; AVDictionary *opt=NULL; FF_CONST AVCodec *codec; int i; char value[64]; int err; //////////////////////////////////////////////////////////////////////////// if ((iparam&&ocodecpar)||(!iparam&&!ocodecpar)) { _DMESSAGE("unexpected arguments"); goto e_args; } //////////////////////////////////////////////////////////////////////////// if (ocodecpar) { // we're going to encode and will construct the corresponding // stream's codec parameters below. codec=avcodec_find_encoder(ocodecpar->codec_id); if (!codec) { _DMESSAGEV("audio encoder \"%s\" not available", avcodec_get_name(ocodecpar->codec_id)); goto e_codec; } } else { // we're going to decode and receive needed information from the // correponding stream's codec parameters. codec=avcodec_find_decoder(codecpar->codec_id); if (!codec) { _DMESSAGEV("audio decoder \"%s\" not available", avcodec_get_name(codecpar->codec_id)); goto e_codec; } } //////////////////////////////////////////////////////////////////////////// audio->ctx=avcodec_alloc_context3(codec); if (!audio->ctx) { _DMESSAGE("allocating codec context"); goto e_context; } //////////////////////////////////////////////////////////////////////////// if (ocodecpar) { // we're going to encode. if (codec->sample_fmts) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_NONE; // try finding an exact match. for (i=0;0<=codec->sample_fmts[i];++i) { if (codec->sample_fmts[i]==ocodecpar->format) { audio->ctx->sample_fmt=ocodecpar->format; break; } } #if 0 // [ if (AV_SAMPLE_FMT_NONE==audio->ctx->sample_fmt) { // try swapping planar <--> interleaved. for (i=0;0<=codec->sample_fmts[i];++i) { switch (codec->sample_fmts[i]) { // interleaved ////////////////////////////////////////////////////// case AV_SAMPLE_FMT_S16: if (ocodecpar->format==AV_SAMPLE_FMT_S16P) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_S16; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_S32: if (ocodecpar->format==AV_SAMPLE_FMT_S32P) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_S32; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_FLT: if (ocodecpar->format==AV_SAMPLE_FMT_FLTP) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_FLT; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_DBL: if (ocodecpar->format==AV_SAMPLE_FMT_DBLP) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_DBL; goto loop_inner_break; } continue; // planar /////////////////////////////////////////////////////////// case AV_SAMPLE_FMT_S16P: if (ocodecpar->format==AV_SAMPLE_FMT_S16) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_S16P; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_S32P: if (ocodecpar->format==AV_SAMPLE_FMT_S32) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_S32P; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_FLTP: if (ocodecpar->format==AV_SAMPLE_FMT_FLT) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_FLTP; goto loop_inner_break; } continue; case AV_SAMPLE_FMT_DBLP: if (ocodecpar->format==AV_SAMPLE_FMT_DBL) { audio->ctx->sample_fmt=AV_SAMPLE_FMT_DBLP; goto loop_inner_break; } continue; ///////////////////////////////////////////////////////////////////// default: continue; } } loop_inner_break: ; } #endif // ] if (AV_SAMPLE_FMT_NONE==audio->ctx->sample_fmt) { // fallback to the default. audio->ctx->sample_fmt=codec->sample_fmts[0]; } } else audio->ctx->sample_fmt=ocodecpar->format; if (codec->supported_samplerates) { audio->ctx->sample_rate=codec->supported_samplerates[0]; for (i=0;codec->supported_samplerates[i];++i) { if (codec->supported_samplerates[i]==ocodecpar->sample_rate) { audio->ctx->sample_rate=ocodecpar->sample_rate; break; } } } else audio->ctx->sample_rate=ocodecpar->sample_rate; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (codec->channel_layouts) { audio->ctx->channel_layout=codec->channel_layouts[0]; #else // ] [ if (codec->ch_layouts) { audio->ctx->ch_layout=codec->ch_layouts[0]; #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ for (i=0;codec->channel_layouts[i];++i) { if (codec->channel_layouts[i]==ocodecpar->channel_layout) { audio->ctx->channel_layout=ocodecpar->channel_layout; break; } } #else // ] [ for (i=0;0ch_layouts[i].nb_channels;++i) { if (!av_channel_layout_compare(codec->ch_layouts+i,&ocodecpar->ch_layout)) { audio->ctx->ch_layout=ocodecpar->ch_layout; break; } } #endif // ] } else #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ audio->ctx->channel_layout=ocodecpar->channel_layout; audio->ctx->channels =av_get_channel_layout_nb_channels(audio->ctx->channel_layout); #else // ] [ audio->ctx->ch_layout=ocodecpar->ch_layout; //audio->ctx->channels #endif // ] audio->ctx->time_base.num=1; audio->ctx->time_base.den=audio->ctx->sample_rate; #if defined (FF_OUTPUT_BIT_RATE) // [ audio->ctx->bit_rate=FF_OUTPUT_BIT_RATE; #endif // ] stream->time_base=audio->ctx->time_base; } else if (iparam) { // we're going to decode. err=avcodec_parameters_to_context(audio->ctx,codecpar); if (err<0) { _DMESSAGEV("copying codec parameters: %s (%d)",av_err2str(err),err); goto e_copy1; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (0ll<=iparam->request.channel_layout) audio->ctx->request_channel_layout=iparam->request.channel_layout; #endif // ] if (0<=iparam->request.sample_fmt) audio->ctx->request_sample_fmt=iparam->request.sample_fmt; /////////////////////////////////////////////////////////////////////////// if (iparam->drc.enabled&&AV_CODEC_ID_AC3==codecpar->codec_id) { sprintf(value,"%0.1f",iparam->drc.scale); err=av_dict_set(&opt,"drc_scale",value,0); if (err<0) { _DMESSAGEV("setting drc_scale: %s (%d)",av_err2str(err),err); goto e_copy1; } } } ///////////////////////////////////////////////////////////////////////////// err=avcodec_open2(audio->ctx,codec,&opt); av_dict_free(&opt); if (err<0) { _DMESSAGEV("copening codec context: %s (%d)",av_err2str(err),err); goto e_open; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (iparam&&!audio->ctx->channel_layout) { #else // ] [ if (iparam&&!audio->ctx->ch_layout.nb_channels) { #endif // ] #if 0 // [ // this is some strange behaviour: when we request AV_CH_LAYOUT_STEREO // from AV_CH_LAYOUT_5POINT1 it might turn out that everything is fine // (especially "channels") except "channel_layout" might not be set. audio->ctx->channel_layout=iparam->request.channel_layout; #else // ] [ #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (!audio->ctx->channels) { _DMESSAGE("missing input #channels"); goto e_channels; #else // ] [ if (!audio->ctx->ch_layout.nb_channels) { _DMESSAGE("missing input #channels"); goto e_channels; #endif // ] } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ audio->ctx->channel_layout =av_get_default_channel_layout(audio->ctx->channels); #else //#warning #endif // ] #endif // ] } #if 0 // [ if (codecpar) { // we're going to encode and as promised above we copy the codec // context's parameters to the corresponding stream. #else // ] [ // we copy the codec parameters anyway because e.g. "sample_fmt" might // have changed in case of decoding. #endif // ] err=avcodec_parameters_from_context(codecpar,audio->ctx); if (err<0) { _DMESSAGEV("copying codec parameters: %s (%d)",av_err2str(err),err); goto e_copy2; } #if 0 // [ } #endif // ] ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_copy2: e_channels: e_open: e_copy1: avcodec_free_context(&audio->ctx); e_context: e_codec: e_args: return -1; } void ff_audio_destroy(ff_audio_t *audio) { avcodec_free_context(&audio->ctx); } #if defined (FF_HOLZHAMMER) // { FF_ENABLE_DEPRECATION_WARNINGS // ] #endif // } bs1770gain-0.9.8/libff/ff.h0000755000175000017500000005636715036367713012120 00000000000000/* * ff.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if ! defined (__FF_H__) // [ #define __FF_H__ #if defined (HAVE_CONFIG_H) // [ #include #endif // ] #if defined (_WIN32) // [ #include #endif // ] #include #include #include #include #include #include #include #include #if defined (HAVE_LIBPOSTPROC) // [ #include #endif // ] #include #if defined (__cplusplus) // [ extern "C" { #endif // ] /////////////////////////////////////////////////////////////////////////////// #define FF_TOBIAS_BUG_FIX #define FF_MUXEER_CONTINUE_ON_INVALIDDATA //#define FF_MUXEER_FIFO #if defined (FF_MUXEER_FIFO) // [ #define FF_FIFO #endif // ] //#define FF_BITMASK_BASED_CHANNEL_LAYOUT #if defined (HAVE_WORKINPROGRESS) // [ #define FF_FILTER_REDESIGNED #define FF_INOUT_REDESIGNED #else // ] [ #define FF_SAMPLE_FMTS_DEPRECATED_QUICK_FIX #if ! defined (FF_SAMPLE_FMTS_DEPRECATED_QUICK_FIX) // [ #define FF_SAMPLE_FMTS_DEPRECATED_FIX #endif // ] #endif // ] //libav: Switch to new channel layout API: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2833 #define FF_HOLZHAMMER #if defined (FF_HOLZHAMMER) // [ // the "Holzhammer" is taken from "libavutil/internal.h" #if ! defined (FF_DISABLE_DEPRECATION_WARNINGS) // [ #define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #endif // ] #if ! defined (FF_ENABLE_DEPRECATION_WARNINGS) // [ #define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"") #endif // ] #else // ] [ #if ! defined (FF_DISABLE_DEPRECATION_WARNINGS) // [ #define FF_DISABLE_DEPRECATION_WARNINGS #endif // ] #if ! defined (FF_ENABLE_DEPRECATION_WARNINGS) // [ #define FF_ENABLE_DEPRECATION_WARNINGS #endif // ] #endif // ] //#define FF_WARN_CHANNEL_OVERFLOW_AV_LOG //#define FF_WARN_CHANNEL_OVERFLOW_DISABLE #define FF_PROGRESS_STDERR //#define FF_CHANNEL_LAYOUT_DEPRECATED #define FF_SERGEY_INDEX_BUGFIX #define FF_INPUT_LIST #define FF_CONST const /////////////////////////////////////////////////////////////////////////////// #if defined (PBU_CONSOLE_UTF16) // [ #define FF_CONSOLE_UTF16 #endif // ] #if defined (_WIN32) // [ #define FF_OPTION_UTF16 #define FF_GETOPT_LONG(argc,argv,optstring,longopts,longindex) \ getoptW_long(argc,argv,optstring,longopts,longindex) #define FFL(x) L ## x #define _FFSTR(x) L ## x #define FFSTR(x) _FFSTR(x) #define FFSEPCHAR FFL('\\') #define FFBASENAME(s) pbu_wbasename(s) #define FFISDIGIT(ch) iswdigit(ch) #define FFATOI(x) _wtoi(x) #define FFATOF(x) _wtof(x) #define FFSTRCASECMP(s1,s2) wcsicmp(s1,s2) #define FFSTRDUP(s) _wcsdup(s) #define FFSTRLEN(s) wcslen(s) #define FFSTRCMP(s1,s2) wcscmp(s1,s2) #define _FFSTRCMP(s1,s2) wcscmp(L##s1,s2) #define FFSTRCPY(s1,s2) wcscpy(s1,s2) #define FFSTRSTR(s1,s2) wcsstr(s1,s2) #define FFFOPEN(path,mode) _wfopen(path,mode) #if 0 // [ #define _FFPUTC(c,f) fputwc(c,f) #define FFPUTC(c,f) _FFPUTC(L##c,f) #define _FFPUTS(s,f) fputws(s,f) #define FFPUTS(s,f) _FFPUTS(L##s,f) #define _FFPRINTF(f,format,...) fwprintf(f,format,__VA_ARGS__) #define FFPRINTF(f,format,...) _FFPRINTF(f,L##format,__VA_ARGS__) #endif // ] #define FFSPRINTF(s,size,format,...) swprintf(s,size,format,__VA_ARGS__) #define FFSNPRINTF(s,size,format,...) snwprintf(s,size,format,__VA_ARGS__) #define FFMESSAGE(m) PBU_DMESSAGEW(L##m) #define FFVMESSAGE(m,...) PBU_DVMESSAGEW(L##m,__VA_ARGS__) #define FFWARNING(m) PBU_DWARNINGW(L##m) #define FFVWARNING(m,...) PBU_DVWARNINGW(L##m,__VA_ARGS__) #define FFVWRITELN(m,...) PBU_DVWRITELNW(L##m,__VA_ARGS__) #define FFSTRTOK_R(str,delim,saveptr) wcstok(str,delim) #if ! defined (PATH_MAX) // [ #define PATH_MAX MAX_PATH #endif // ] typedef wchar_t ffchar_t; #define PBU_WIDEN2(x) L ## x #define PBU_WIDEN(x) PBU_WIDEN2(x) #else // ] [ #define FF_GETOPT_LONG(argc,argv,optstring,longopts,longindex) \ getopt_long(argc,argv,optstring,longopts,longindex) #define FFL(x) x #define FFSTR(x) x #define FFBASENAME(s) pbu_basename(s) #define FFSEPCHAR FFL('/') #define FFISDIGIT(ch) isdigit(ch) #define FFATOI(x) atoi(x) #define FFATOF(x) atof(x) #if defined (_MSC_VER) // [ #define FFSTRCASECMP(s1,s2) stricmp(s1,s2) #else // ] [ #define FFSTRCASECMP(s1,s2) strcasecmp(s1,s2) #endif // ] #define FFSTRDUP(s) strdup(s) #define FFSTRLEN(s) strlen(s) #define FFSTRCMP(s1,s2) strcmp(s1,s2) #define _FFSTRCMP(s1,s2) strcmp(s1,s2) #define FFSTRCPY(s1,s2) strcpy(s1,s2) #define FFSTRSTR(s1,s2) strstr(s1,s2) #define FFFOPEN(path,mode) fopen(path,mode) #if 0 // [ #define _FFPUTC(s,f) fputc(s,f) #define FFPUTC(s,f) _FFPUTC(s,f) #define _FFPUTS(s,f) fputs(s,f) #define FFPUTS(s,f) _FFPUTS(s,f) #define _FFPRINTF(f,format,...) fprintf(f,format,__VA_ARGS__) #define FFPRINTF(f,format,...) _FFPRINTF(f,format,__VA_ARGS__) #endif // ] #define FFSPRINTF(s,size,format,...) sprintf(s,format,__VA_ARGS__) #define FFSNPRINTF(s,size,format,...) snprintf(s,size,format,__VA_ARGS__) #define FFMESSAGE(m) PBU_DMESSAGE(m) #define FFVMESSAGE(m,...) PBU_DVMESSAGE(m,__VA_ARGS__) #define FFWARNING(m) PBU_DWARNING(m) #define FFVWARNING(m,...) PBU_DVWARNING(m,__VA_ARGS__) #define FFVWRITELN(m,...) PBU_DVWRITELN(m,__VA_ARGS__) #define FFSTRTOK_R(str,delim,saveptr) strtok_r(str,delim,saveptr) typedef char ffchar_t; #endif // ] #define FFPATHSEP FFSEPCHAR /////////////////////////////////////////////////////////////////////////////// #ifdef __GNUC__ // [ #define FFUNUSED __attribute__((__unused__)) #else // ] [ #define FFUNUSED #endif // ] #if defined (HAVE_FF_DYNLOAD) // [ /////////////////////////////////////////////////////////////////////////////// #if ! defined (FF_AVUTIL_V) // [ #define FF_AVUTIL_V PBU_STR(LIBAVUTIL_VERSION_MAJOR) #endif // ] #if ! defined (FF_AVCODEC_V) // [ #define FF_AVCODEC_V PBU_STR(LIBAVCODEC_VERSION_MAJOR) #endif // ] #if ! defined (FF_AVFORMAT_V) // [ #define FF_AVFORMAT_V PBU_STR(LIBAVFORMAT_VERSION_MAJOR) #endif // ] #if ! defined (FF_SWRESAMPLE_V) // [ #define FF_SWRESAMPLE_V PBU_STR(LIBSWRESAMPLE_VERSION_MAJOR) #endif // ] #if ! defined (FF_SWSCALE_V) // [ #define FF_SWSCALE_V PBU_STR(LIBSWSCALE_VERSION_MAJOR) #endif // ] #if ! defined (FF_POSTPROC_V) // [ #define FF_POSTPROC_V PBU_STR(LIBPOSTPROC_VERSION_MAJOR) #endif // ] #if ! defined (FF_AVFILTER_V) // [ #define FF_AVFILTER_V PBU_STR(LIBAVFILTER_VERSION_MAJOR) #endif // ] #if defined (_WIN32) // [ /// WINDOWS //////////////////////////////////////////// #if defined (FF_AVUTIL_V) // [ #define FF_AVUTIL L"avutil-" PBU_WIDEN(FF_AVUTIL_V) L".dll" #else // ] [ #define FF_AVUTIL L"avutil.dll" #endif // ] #if defined (FF_AVCODEC_V) // [ #define FF_AVCODEC L"avcodec-" PBU_WIDEN(FF_AVCODEC_V) L".dll" #else // ] [ #define FF_AVCODEC L"avcodec.dll" #endif // ] #if defined (FF_AVFORMAT_V) // [ #define FF_AVFORMAT L"avformat-" PBU_WIDEN(FF_AVFORMAT_V) L".dll" #else // ] [ #define FF_AVFORMAT L"avformat.dll" #endif // ] #if defined (FF_SWRESAMPLE_V) // [ #define FF_SWRESAMPLE L"swresample-" PBU_WIDEN(FF_SWRESAMPLE_V) L".dll" #else // ] [ #define FF_SWRESAMPLE L"swresample.dll" #endif // ] #if defined (FF_SWSCALE_V) // [ #define FF_SWSCALE L"swscale-" PBU_WIDEN(FF_SWSCALE_V) L".dll" #else // ] [ #define FF_SWSCALE L"swscale.dll" #endif // ] #if defined (FF_POSTPROC_V) // [ #define FF_POSTPROC L"postproc-" PBU_WIDEN(FF_POSTPROC_V) L".dll" #else // ] [ #define FF_POSTPROC L"postproc.dll" #endif // ] #if defined (FF_AVFILTER_V) // [ #define FF_AVFILTER L"avfilter-" PBU_WIDEN(FF_AVFILTER_V) L".dll" #else // ] [ #define FF_AVFILTER L"avfilter.dll" #endif // ] #elif defined __APPLE__ // ] [ /// APPLE ////////////////////////////////////////////// #if defined (FF_AVUTIL_V) // [ #define FF_AVUTIL "libavutil." FF_AVUTIL_V ".dylib" #else // ] [ #define FF_AVUTIL "libavutil.dylib" #endif // ] #if defined (FF_AVCODEC_V) // [ #define FF_AVCODEC "libavcodec." FF_AVCODEC_V ".dylib" #else // ] [ #define FF_AVCODEC "libavcodec.dylib" #endif // ] #if defined (FF_AVFORMAT_V) // [ #define FF_AVFORMAT "libavformat." FF_AVFORMAT_V ".dylib" #else // ] [ #define FF_AVFORMAT "libavformat.dylib" #endif // ] #if defined (FF_SWRESAMPLE_V) // [ #define FF_SWRESAMPLE "libswresample." FF_SWRESAMPLE_V ".dylib" #else // ] [ #define FF_SWRESAMPLE "libswresample.dylib" #endif // ] #if defined (FF_SWSCALE_V) // [ #define FF_SWSCALE "libswscale." FF_SWSCALE_V ".dylib" #else // ] [ #define FF_SWSCALE "libswscale.dylib" #endif // ] #if defined (FF_POSTPROC_V) // [ #define FF_POSTPROC "libpostproc." FF_POSTPROC_V ".dylib" #else // ] [ #define FF_POSTPROC "libpostproc.dylib" #endif // ] #if defined (FF_AVFILTER_V) // [ #define FF_AVFILTER "libavfilter." FF_AVFILTER_V ".dylib" #else // ] [ #define FF_AVFILTER "libavfilter.dylib" #endif // ] #else // ] [ /// LINUX ////////////////////////////////////////////////////////////// #if defined (FF_AVUTIL_V) // [ #define FF_AVUTIL "libavutil.so." FF_AVUTIL_V #else // ] [ #define FF_AVUTIL "libavutil.so" #endif // ] #if defined (FF_AVCODEC_V) // [ #define FF_AVCODEC "libavcodec.so." FF_AVCODEC_V #else // ] [ #define FF_AVCODEC "libavcodec.so" #endif // ] #if defined (FF_AVFORMAT_V) // [ #define FF_AVFORMAT "libavformat.so." FF_AVFORMAT_V #else // ] [ #define FF_AVFORMAT "libavformat.so" #endif // ] #if defined (FF_SWRESAMPLE_V) // [ #define FF_SWRESAMPLE "libswresample.so." FF_SWRESAMPLE_V #else // ] [ #define FF_SWRESAMPLE "libswresample.so" #endif // ] #if defined (FF_SWSCALE_V) // [ #define FF_SWSCALE "libswscale.so." FF_SWSCALE_V #else // ] [ #define FF_SWSCALE "libswscale.so" #endif // ] #if defined (FF_POSTPROC_V) // [ #define FF_POSTPROC "libpostproc.so." FF_POSTPROC_V #else // ] [ #define FF_POSTPROC "libpostproc.so" #endif // ] #if defined (FF_AVFILTER_V) // [ #define FF_AVFILTER "libavfilter.so." FF_AVFILTER_V #else // ] [ #define FF_AVFILTER "libavfilter.so" #endif // ] #endif // ] /////////////////////////////////////////////////////////////////////////////// int ff_dynload(const ffchar_t *dirname); void ff_unload(void); const char *ff_dynload_path(void); #endif // ] /////////////////////////////////////////////////////////////////////////////// #define FF_PACKET_UNREF #define FF_FRAME_UNREF /* * as it seems it is impossible to pass-through a partial flac stream * (cf. "https://trac.ffmpeg.org/ticket/7864".) our hack consists in * reading/decoding and re-encoding/writing. */ #define FF_FLAC_HACK #define FF_STREAM_METADATA #define FF_RESAMPLER_RATE #define FF_RESAMPLER_NB_SAMPLES #if defined (HAVE_FF_DYNLOAD) // [ /////////////////////////////////////////////////////////////////////////////// /* * avfilter * avcodec * avutil * swresample * avformat * avutil * avcodec * avutil * postproc * avutil * swresample * avutil * swscale * avutil * avutil * swresample * avcodec * avformat * swscale * postproc * avfilter */ #endif // ] /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ int ff_csv2avdict(const char *file, const wchar_t *filew, char sep, AVDictionary **metadata, int erropen); #else // ] [ int ff_csv2avdict(const char *file, char sep, AVDictionary **metadata, int erropen); #endif // ] #if defined (_WIN32) // [ char *ff_wcs2str(const wchar_t *wcs, char *buf, int codepage, size_t size); #endif // ] int ff_fexists(const ffchar_t *path); int ff_fcmp(const ffchar_t *lpath, const ffchar_t *rpath); int ff_rm(const ffchar_t *path); int ff_mv(const ffchar_t *source, const ffchar_t *target); int ff_mkdir(ffchar_t *path); /////////////////////////////////////////////////////////////////////////////// typedef enum ff_lfe ff_lfe_t; typedef const struct ff_iter_vmt ff_iter_vmt_t; typedef struct ff_iter ff_iter_t; typedef struct ff_param_decode ff_param_decode_t; typedef struct ff_audio ff_audio_t; typedef const struct ff_input_callback ff_input_callback_t; #if defined (FF_STREAM_METADATA) // [ typedef enum ff_metadata_type ff_metadata_type_t; #endif // ] typedef const struct ff_output_callback ff_output_callback_t; typedef struct ff_inout ff_inout_t; typedef struct ff_resampler ff_resampler_t; typedef enum ff_analyzer_state ff_analyzer_state_t; typedef struct ff_analyzer ff_analyzer_t; typedef struct ff_filter ff_filter_t; typedef struct ff_fifo ff_fifo_t; typedef enum ff_muxer_state ff_muxer_state_t; typedef struct ff_muxer ff_muxer_t; typedef struct ff_printer ff_printer_t; /////////////////////////////////////////////////////////////////////////////// /* * if there are more than 6 channels, the layout is not set by the decoder, * and instead the default libavcodec channel layout guess is used * -> 7 channels, 6.1 (front left, right, center, lfe, back center, * side left, right) * -> 8 channels, 7.1 (front left, right, center, lfe, back left, * right, side left, right) * http://lists.xiph.org/pipermail//flac-dev/2013-January/003569.html */ enum ff_lfe { FF_LFE_THRESHOLD=6, FF_LFE_CHANNEL=3, }; /////////////////////////////////////////////////////////////////////////////// struct ff_iter_vmt { const char *id; void (*first)(ff_iter_t *i); int (*valid)(ff_iter_t *i); void (*next)(ff_iter_t *i); void (*norm)(ff_iter_t *i, double *x, double *max); }; struct ff_iter { ff_iter_vmt_t *vmt; const AVFrame *frame; union { // interleaved //////////////////////////////////////////////////////////// union { union { struct { int16_t *rp,*mp; } s16; struct { int32_t *rp,*mp; } s32; struct { float *rp,*mp; } flt; struct { double *rp,*mp; } dbl; }; } i; // planar ///////////////////////////////////////////////////////////////// union { union { struct { int16_t *rp[AV_NUM_DATA_POINTERS],*mp; } s16; struct { int32_t *rp[AV_NUM_DATA_POINTERS],*mp; } s32; struct { float *rp[AV_NUM_DATA_POINTERS],*mp; } flt; struct { double *rp[AV_NUM_DATA_POINTERS],*mp; } dbl; }; } p; }; }; int ff_iter_first(ff_iter_t *i, const AVFrame *frame); /////////////////////////////////////////////////////////////////////////////// struct ff_param_decode { #if 0 // [ struct { enum AVSampleFormat sample_fmt; int64_t channel_layout; } request; #elif 0 // ] [ union { struct { attribute_deprecated enum AVSampleFormat sample_fmt; attribute_deprecated int64_t channel_layout; }; AVChannelLayout ch_layout; } request; #else // ] [ struct { int tag; struct { enum AVSampleFormat sample_fmt; int64_t channel_layout; }; AVChannelLayout ch_layout; } request; #endif // ] struct { int enabled; double scale; } drc; }; /////////////////////////////////////////////////////////////////////////////// struct ff_audio { AVCodecContext *ctx; }; int ff_audio_create(ff_audio_t *audio, ff_inout_t *inout, const ff_param_decode_t *iparam, const AVCodecParameters *ocodecpar); void ff_audio_destroy(ff_audio_t *audio); /////////////////////////////////////////////////////////////////////////////// // interface implemented in e.g. "bg_track.c". struct ff_input_callback { const char *(*path)(const void *data); #if defined (_WIN32) // [ const wchar_t *(*pathw)(const void *data); #endif // ] const ff_param_decode_t *(*decode)(const void *data); int (*upsample)(const void *data); int (*transcode)(const void *data); int (*csv)(const void *data); int (*suppress_progress)(const void *data); struct { int64_t (*begin)(const void *data); int64_t (*duration)(const void *data); } interval; struct { int (*create)(void *data, const AVCodecParameters *codecpar); void (*destroy)(void *data); int (*add)(void *data, int upsampled, AVFrame *frame); } stats; }; // interface implemented in e.g. "bg_muxer.c". #if defined (FF_STREAM_METADATA) // [ enum ff_metadata_type { FF_METADATA_TYPE_FORMAT, FF_METADATA_TYPE_AUDIO, FF_METADATA_TYPE_VIDEO, }; #endif // ] struct ff_output_callback { const char *(*path)(const void *data); const ff_analyzer_t *(*analyzer)(const void *data); enum AVSampleFormat (*sample_fmt)(const void *data); #if defined (FF_STREAM_METADATA) // [ void (*metadata)(void *data, AVDictionary **om, const AVDictionary *im, ff_metadata_type_t type); #else // ] [ void (*metadata)(void *data, AVDictionary **om, const AVDictionary *im); #endif // ] // just called from the muxer. enum AVCodecID (*codec_id)(const void *data, const AVOutputFormat *oformat); }; struct ff_printer { FILE *f; size_t len; }; int ff_printer_create(ff_printer_t *p, FILE *f); void ff_printer_destroy(ff_printer_t *p); void ff_printer_clear(ff_printer_t *p); #if defined (FF_PROGRESS_STDERR) // [ void ff_printer_flush(ff_printer_t *p, FILE *f); void ff_printer_reset(ff_printer_t *p, FILE *f); #else // ] [ void ff_printer_flush(ff_printer_t *p); void ff_printer_reset(ff_printer_t *p); #endif // ] #if 0 // [ int ff_printer_printf(ff_printer_t *p, const char *format, ...); #if defined (_WIN32) // [ int ff_printer_wprintf(ff_printer_t *p, const wchar_t *format, ...); #endif // ] #else // ] [ #if defined (WIN32) // [ #define _FF_PRINTER_PRINTF(p,format,...) \ ff_printer_printf(p,L##format,__VA_ARGS__) #else // ] [ #define _FF_PRINTER_PRINTF(p,format,...) \ ff_printer_printf(p,format,__VA_ARGS__) #endif // ] int ff_printer_printf(ff_printer_t *p, const ffchar_t *format, ...); #endif // ] struct ff_inout { #if defined (FF_INPUT_LIST) // [ int list; const char *path; #endif // ] struct { void *data; union { ff_input_callback_t *in; ff_output_callback_t *out; }; } cb; ff_printer_t *printer; struct { AVFormatContext *ctx; } fmt; int ai,vi; ff_audio_t audio; }; #if defined (FF_INPUT_LIST) // [ //////// void ff_inout_list(ff_inout_t *inout, int out); #endif // ] //////// #if defined (FF_SERGEY_INDEX_BUGFIX) // [ #if defined (FF_INPUT_LIST) // [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int list, int ai, int vi); #else // ] [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int ai, int vi); #endif // ] #else // ] [ #if defined (FF_INPUT_LIST) // [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p, int list); #else // ] [ int ff_input_create(ff_inout_t *in, ff_input_callback_t *cb, void *data, int warn, ff_printer_t *p); #endif // ] #endif // ] void ff_input_destroy(ff_inout_t *in); // for re-opening for a second time, e.g. for the purpose of re-muxing: int ff_input_open_analyzer(ff_inout_t *in); #if defined (FF_FLAC_HACK) // [ int ff_input_open_muxer(ff_inout_t *in, int *hack); #else // ] [ int ff_input_open_muxer(ff_inout_t *in); #endif // ] void ff_input_close(ff_inout_t *in); void ff_inout_interval(ff_inout_t *inout, int64_t *begin, int64_t *duration, AVStream *stream); int ff_input_progress(ff_inout_t *in, AVPacket *pkt); //////// #if defined (FF_INPUT_LIST) // [ #if defined (FF_FLAC_HACK) // [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata, enum AVSampleFormat sample_fmt, int list); #else // ] [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *cb, void *data, int list); #endif // ] #else // ] [ #if defined (FF_FLAC_HACK) // [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *ocb, void *odata, enum AVSampleFormat sample_fmt); #else // ] [ int ff_output_create(ff_inout_t *out, ff_output_callback_t *cb, void *data); #endif // ] #endif // ] void ff_output_destroy(ff_inout_t *out); /////////////////////////////////////////////////////////////////////////////// #if defined (FF_CHANNEL_LAYOUT_DEPRECATED) // [ int64_t ff_layout2int64(const AVChannelLayout *layout); #endif // ] /////////////////////////////////////////////////////////////////////////////// struct ff_resampler { #if defined (FF_RESAMPLER_RATE) // [ uint32_t irate,orate; #endif // ] #if defined (FF_RESAMPLER_NB_SAMPLES) // [ // because the resampler might reduce the frame's nb_samples we remember // how many nb_samples we've allocated. int nb_samples; #endif // ] SwrContext *ctx; AVFrame *frame; }; int ff_resampler_create(ff_resampler_t *res, const AVCodecParameters *ocodecpar, const AVCodecParameters *icodecpar); void resampler_destroy(ff_resampler_t *res); int resampler_apply(ff_resampler_t *res, AVFrame *frame); /////////////////////////////////////////////////////////////////////////////// enum ff_analyzer_state { FF_ANALYZER_DECODER_SEND_PACKET, FF_ANALYZER_DECODER_RECEIVE_FRAME, }; struct ff_analyzer { ff_analyzer_state_t state; ff_inout_t *in; ff_resampler_t normalizer; ff_resampler_t upsampler; AVPacket *pkt; AVFrame *frame; }; int ff_analyzer_create(ff_analyzer_t *a, ff_inout_t *in); void ff_analyzer_destroy(ff_analyzer_t *a, int destroy_stats); int ff_analyzer_loop(ff_analyzer_t *analyzer); /////////////////////////////////////////////////////////////////////////////// struct ff_filter { struct { AVFilterContext *sink,*src; } ctx; AVFilterGraph *graph; }; int ff_filter_create(ff_filter_t *filter, const AVCodecParameters *ocodecpar, const AVCodecParameters *icodecpar, AVRational time_base, const char *descr); void ff_filter_destroy(ff_filter_t *filter); int ff_filter_send_frame(ff_filter_t *filter, AVFrame *frame); int ff_filter_receive_frame(ff_filter_t *filter, AVFrame *frame); /////////////////////////////////////////////////////////////////////////////// #if defined (FF_FIFO) // [ // fifo not used. just for reference. struct ff_fifo { AVCodecParameters ocodecpar; int flush; AVAudioFifo *fifo; }; #endif // ] int ff_fifo_create(ff_fifo_t *fifo, const AVCodecParameters *ocodecpar); void ff_fifo_destroy(ff_fifo_t *fifo); int ff_fifo_size(ff_fifo_t *fifo); int ff_fifo_send_frame(ff_fifo_t *fifo, AVFrame *frame); int ff_fifo_receive_frame(ff_fifo_t *fifo, AVFrame *frame); /////////////////////////////////////////////////////////////////////////////// enum ff_muxer_state { FF_MUXER_DECODER_SEND_PACKET, FF_MUXER_DECODER_RECEIVE_FRAME, FF_MUXER_FILTER_SEND_FRAME, FF_MUXER_FILTER_RECEIVE_FRAME, FF_MUXER_ENCODER_SEND_FRAME, FF_MUXER_ENCODER_RECEIVE_PACKET, }; struct ff_muxer { ff_muxer_state_t state; ff_inout_t *in,*out; AVPacket *pkt; ff_filter_t filter; AVFrame *frame; struct { int64_t ts; #if defined (FF_MUXEER_FIFO) // [ //AVAudioFifo *fifo; ff_fifo_t fifo; #endif // ] } audio; }; int ff_muxer_create(ff_muxer_t *muxer, ff_inout_t *in, ff_inout_t *out, const char *filter); void ff_muxer_destroy(ff_muxer_t *muxer); int ff_muxer_loop(ff_muxer_t *muxer); #if defined (__cplusplus) // [ } #endif // ] #endif // __FF_H__ ] bs1770gain-0.9.8/libff/ff_csv2avdict.c0000755000175000017500000003371415035710477014230 00000000000000/* * ff_csv2avdict.c * * Copyright (C) 2014 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 0 && defined (strtok_r) // [ #undef strtok_r #endif // ] //#define DEBUG #define PRIV_BUF_SIZE 1024 #define PRIV_FOLDER_CSV FFL("folder.csv") /////////////////////////////////////////////////////////////////////////////// #define PRIV_CH_SIZE 4 typedef struct priv priv_t; typedef int (*priv_get_t)(priv_t *); struct priv { char *buf; char *wp; char *mp; FILE *f; priv_get_t get; char ch[PRIV_CH_SIZE+1]; }; static priv_t *priv_init(priv_t *b, FILE *f); static priv_t *priv_cleanup(priv_t *b); static int priv_realloc(priv_t *b, size_t n); static int priv_gets(priv_t *b); #if defined (_WIN32) // { static int priv_get_utf16le(priv_t *b); static int priv_get_utf16be(priv_t *b); #endif // } static int priv_get_utf8(priv_t *b); static int priv_get_ansi(priv_t *b); /////////////////////////////////////////////////////////////////////////////// static priv_t *priv_init(priv_t *b, FILE *f) { #if defined (_WIN32) // { static const uint8_t utf16le[]={ 0xFF,0xFE,0x00 }; static const uint8_t utf16be[]={ 0xFE,0xFF,0x00 }; #endif // } static const uint8_t utf8[]={ 0xEF,0xBB,0xBF,0x00 }; long pos; const uint8_t *rp; uint8_t ch; memset(b,0,sizeof *b); if (NULL==(b->buf=malloc(PRIV_BUF_SIZE))) goto error; b->wp=b->buf; b->mp=b->buf+PRIV_BUF_SIZE; b->f=f; if ((pos=ftell(f)<-1l)) { _DMESSAGE("getting file length"); goto error; } #if defined (_WIN32) // [ // UTF-16 LE rp=utf16le; while (*rp) { if (1!=fread(&ch,1,1,f)||*rp++!=ch) goto utf16be; } #if 0 && defined (PBU_DEBUG) // [ fprintf(stderr,"UTF-16 LE\n"); #endif // ] if (0==(b->get=priv_get_utf16le)(b)) { _DMESSAGE("getting utf16le"); goto error; } return b; utf16be: // UTF-16 BE if (0!=fseek(f,pos,SEEK_SET)) { _DMESSAGE("seeking"); goto error; } rp=utf16be; while (*rp) { if (1!=fread(&ch,1,1,f)||*rp++!=ch) goto utf8; } #if 0 && defined (PBU_DEBUG) // [ fprintf(stderr,"UTF-16 BE\n"); #endif // ] if (0==(b->get=priv_get_utf16be)(b)) { _DMESSAGE("getting utf16be"); goto error; } _DWRITELNV("*** \"%s\" ***",b->buf); return b; utf8: // UTF-8 if (0!=fseek(f,pos,SEEK_SET)) { _DMESSAGE("seeking"); goto error; } #endif // ] rp=utf8; while (*rp) { if (1!=fread(&ch,1,1,f)||*rp++!=ch) goto ansi; } #if 0 && defined (PBU_DEBUG) // [ fprintf(stderr,"UTF-8\n"); #endif // ] if (0==(b->get=priv_get_utf8)(b)) { _DMESSAGE("getting utf8"); goto error; } return b; ansi: // ANSI if (0!=fseek(f,pos,SEEK_SET)) { _DMESSAGE("seeking"); goto error; } #if 0 && defined (PBU_DEBUG) fprintf(stderr,"ANSI\n"); #endif if (0==(b->get=priv_get_ansi)(b)) { _DMESSAGE("getting ansi"); goto error; } return b; error: priv_cleanup(b); return NULL; } static priv_t *priv_cleanup(priv_t *b) { if (NULL!=b->buf) free(b->buf); return b; } static int priv_realloc(priv_t *b, size_t n) { size_t size=b->mp-b->buf; size_t offs=b->wp-b->buf; char *tmp; if (sizebuf,size))) { _DMESSAGE("reallocationg"); return -1; } b->buf=tmp; b->wp=b->buf+offs; b->mp=b->buf+size; } return 0; } #if 0 && defined (_WIN32) && defined (UNICODE) // [ static FILE *priv_fopen(const char *name, const wchar_t *wmode) { int n1,n2; wchar_t *wname=NULL; FILE *f=NULL; n1=MultiByteToWideChar( CP_UTF8, // __in UINT CodePage, 0, // __in DWORD dwFlags, name, // __in LPCSTR lpMultiByteStr, -1, // __in int cbMultiByte, NULL, // __out_opt LPWSTR lpWideCharStr, 0 // __in int cchWideChar ); if (0==n1||NULL==(wname=malloc(n1*sizeof *wname))) goto cleanup; n2=MultiByteToWideChar( CP_UTF8, // __in UINT CodePage, 0, // __in DWORD dwFlags, name, // __in LPCSTR lpMultiByteStr, -1, // __in int cbMultiByte, wname, // __out_opt LPWSTR lpWideCharStr, n1 // __in int cchWideChar ); if (n2!=n1) goto cleanup; f=_wfopen(wname,wmode); cleanup: if (NULL!=wname) free(wname); return f; } #endif // ] static int priv_get_ansi(priv_t *b) { if (1!=fread(b->ch,1,1,b->f)) goto error; b->ch[1]=0; return 1; error: b->ch[0]=0; return 0; } // http://zaemis.blogspot.de/2011/06/reading-unicode-utf-8-by-hand-in-c.html static int priv_get_utf8(priv_t *b) { // mask values for bit pattern of first byte in multi-byte // UTF-8 sequences: // 192 - 110xxxxx - for U+0080 to U+07FF // 224 - 1110xxxx - for U+0800 to U+FFFF // 240 - 11110xxx - for U+010000 to U+1FFFFF static unsigned short mask[] = {192, 224, 240}; char *wp=b->ch; size_t n; int i; // read first byte into buffer if (EOF==(i=getc(b->f))) { // we don't want to have an error message when EOF. //_DMESSAGE("unexpected EOF"); goto error; } *wp=(char)i; // check how many more bytes need to be read for character n = 0; while (n<3 && (*wp & mask[n]) == mask[n]) ++n; ++wp; // read subsequent character bytes if (0f)) { _DMESSAGE("reading"); goto error; } wp+=n; } *wp=0; // return number of bytes read into buffer return 1+n; error: b->ch[0]=0; return 0; } #if defined (_WIN32) /*&& defined (UNICODE)*/ // { static int priv_get_utf16(priv_t *b, int (*read)(wchar_t *, FILE *)) { wchar_t wch; int n; // NOTE: function read() is an argument! if (0!=read(&wch,b->f)) { // we don't want to have an error message when EOF. //_DMESSAGE("reading"); goto error; } n=WideCharToMultiByte( CP_UTF8, // __in UINT CodePage 0, // __in DWORD dwFlags &wch, // __in LPCWSTR lpWideCharStr 1, // __in int cchWideChar b->ch, // __out_opt LPSTR lpMultiByteStr PRIV_CH_SIZE, // __in int cbMultiByte NULL, // __in_opt LPCSTR lpDefaultChar NULL // __out_opt LPBOOL lpUsedDefaultChar ); if (PRIV_CH_SIZEch[n]=0; return n; error: b->ch[0]=0; return 0; } static int priv_read_utf16le(wchar_t *wch, FILE *f) { if (1!=fread(wch,sizeof *wch,1,f)) { // we don't want to have an error message when EOF. //_DMESSAGE("reading"); return -1; } return 0; } static int priv_get_utf16le(priv_t *b) { return priv_get_utf16(b,priv_read_utf16le); } static int priv_read_utf16be(wchar_t *wch, FILE *f) { if (1!=fread(((char *)wch)+1,1,1,f)) { _DMESSAGE("reading"); return -1; } if (1!=fread((char *)wch,1,1,f)) { _DMESSAGE("reading"); return -1; } return 0; } static int priv_get_utf16be(priv_t *b) { return priv_get_utf16(b,priv_read_utf16be); } #endif // } static int priv_gets(priv_t *b) { priv_get_t get=b->get; char *ch=b->ch; int n; b->wp=b->buf; for (;;) { if (0==*ch) goto end_line; else if (0==strcmp("\r",ch)) { if (0==get(b)) goto end_line; else if (0==strcmp("\n",ch)) get(b); goto end_line; } else if (0==strcmp("\n",ch)) { if (0==get(b)) goto end_line; else if (0==strcmp("\r",ch)) get(b); goto end_line; } n=strlen(ch); if (0!=priv_realloc(b,n)) { _DMESSAGE("reallocating"); return -1; } memcpy(b->wp,ch,n); b->wp+=n; if (0==get(b)) goto end_line; continue; end_line: if (0!=priv_realloc(b,1)) { _DMESSAGE("reallocating"); return -1; } *b->wp++=0; #if 0 && defined (PBU_DEBUG) // [ fprintf(stderr,"\"%s\"\n",b->buf); #endif // ] break; } return 0; } static int priv_loop(FILE *f, const char *name, char sep, AVDictionary **metadata) { priv_t b; char tok[]={sep,0}; char *head=NULL; char *rp=NULL; char *pp=NULL; char *hrp=NULL; char *hmp; char *np=NULL; int code=-1; (void)np; memset(&b,0,sizeof b); // initilialize parser. if (NULL==priv_init(&b,f)) { _DMESSAGE("initializing"); goto cleanup; } // read the header. if (0!=priv_gets(&b)) { _DMESSAGE("initializing"); goto cleanup; } if (NULL==(head=malloc(b.wp-b.buf))) { _DMESSAGE("initializing"); goto cleanup; } memcpy(head,b.buf,b.wp-b.buf); hmp=head+(b.wp-b.buf); for (rp=strtok_r(head,tok,&np);NULL!=rp;rp=strtok_r(NULL,tok,&np)) ; if (0!=strcmp("file",head)) { _DMESSAGE("field \"file\" undefined"); goto cleanup; } do { if (0!=priv_gets(&b)) goto cleanup; pp=b.buf; rp=strtok_r(b.buf,tok,&np); for (hrp=head;hrpkey,tag->value); cleanup: av_dict_free(&dict); return 0; } int main1(int argc, char **argv) { FILE *f=NULL; priv_t b; char *head=NULL; char *rp=NULL; char *pp=NULL; char *hrp=NULL; char *hmp; #if ! defined (_WIN32) char *np=NULL; #endif memset(&b,0,sizeof b); // open input file. if (NULL==(f=fopen(argv[1],"rb"))) goto cleanup; // initilialize parser. if (NULL==priv_init(&b,f)) goto cleanup; // read the header. if (0!=priv_gets(&b)) goto cleanup; if (NULL==(head=malloc(b.wp-b.buf))) goto cleanup; memcpy(head,b.buf,b.wp-b.buf); hmp=head+(b.wp-b.buf); #if defined (_WIN32) for (rp=strtok(head,"\t");NULL!=rp;rp=strtok(NULL,"\t")) #else for (rp=strtok_r(head,"\t",&np);NULL!=rp;rp=strtok_r(NULL,"\t",&np)) #endif //printf("%s\n",rp); ; do { if (0!=priv_gets(&b)) goto cleanup; pp=b.buf; rp=strtok(b.buf,"\t"); for (hrp=head;hrp * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 1 // { #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ #undef FF_BITMASK_BASED_CHANNEL_LAYOUT #endif // ] #if defined (FF_HOLZHAMMER) // [ #undef FF_HOLZHAMMER #endif // ] #endif // } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) FF_DISABLE_DEPRECATION_WARNINGS // [ #endif /////////////////////////////////////////////////////////////////////////////// #define FF_ANALYZER_CREATE_OCHANNELS #define FF_ANALYZER_OCODECPAR_PTR #define FF_ANALYZER_STATS_CREATE //#define FF_ANALYZER_STATS_DESTROY int ff_analyzer_create(ff_analyzer_t *a, ff_inout_t *in) { ff_input_callback_t *cb=in->cb.in; void *data=in->cb.data; int upsample=cb&&cb->upsample?cb->upsample(data):-1; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ const ff_param_decode_t *(*decode)(const void *)=cb?cb->decode:NULL; int64_t channel_layout=decode?decode(data)->request.channel_layout:-1ll; #endif // ] #if defined (FF_ANALYZER_STATS_CREATE) // [ int (*create)(void *, const AVCodecParameters *)=cb?cb->stats.create:NULL; #endif // ] #if defined (FF_ANALYZER_STATS_DESTROY) // [ void (*destroy)(void *data) FFUNUSED=cb?cb->stats.destroy:NULL; #endif // ] #if defined (FF_ANALYZER_OCODECPAR_PTR) // [ AVCodecParameters *icodecpar,*ocodecpar; #else // ] [ AVCodecParameters *icodecpar,ocodecpar; #endif // err ENTER(__func__); ///////////////////////////////////////////////////////////////////////////// if (in->ai<0) { _DMESSAGE("input not initialized"); goto e_args; } ///////////////////////////////////////////////////////////////////////////// icodecpar=in->fmt.ctx->streams[in->ai]->codecpar; #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (!icodecpar->channel_layout) { _DMESSAGE("missing input channel layout"); goto e_args; } #elif 0 // ] [ if (AV_CHANNEL_ORDER_UNSPEC==icodecpar->ch_layout.order) { _DMESSAGE("missing input channel layout"); goto e_args; } #else // ] [ if (!icodecpar->ch_layout.nb_channels) { _DMESSAGE("missing input channel layout"); goto e_args; } #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (!channel_layout) { _DMESSAGE("missing output channel layout"); goto e_args; } #endif // ] ///////////////////////////////////////////////////////////////////////////// if (!in->audio.ctx) { _DMESSAGE("audio decoder not opened"); goto e_args; } ///////////////////////////////////////////////////////////////////////////// a->state=FF_ANALYZER_DECODER_SEND_PACKET; a->in=in; ///////////////////////////////////////////////////////////////////////////// #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ if (0llchannel_layout) { #endif // ] #if defined (FF_ANALYZER_OCODECPAR_PTR) // [ /* * from "avcodec.h": * * sizeof(AVCodecParameters) is not a part of the public ABI, * this struct must be allocated with avcodec_parameters_alloc() * and freed with avcodec_parameters_free(). */ ocodecpar=avcodec_parameters_alloc(); if (!ocodecpar) { _DMESSAGE("ocodecpar"); goto e_normalizer_ocodecpar; } if (avcodec_parameters_copy(ocodecpar,icodecpar)<0) { _DMESSAGE("copying codecpar"); avcodec_parameters_free(&ocodecpar); goto e_normalizer_ocodecpar_copy; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ ocodecpar->channel_layout=channel_layout; #if defined (FF_ANALYZER_CREATE_OCHANNELS) // [ ocodecpar->channels=av_get_channel_layout_nb_channels(channel_layout); #endif // ] #endif // ] /////////////////////////////////////////////////////////////////////////// if (ff_resampler_create(&a->normalizer,ocodecpar,icodecpar)<0) { _DMESSAGE("creating normalizer"); avcodec_parameters_free(&ocodecpar); goto e_normalizer; } #if defined (FF_ANALYZER_STATS_CREATE) // [ /////////////////////////////////////////////////////////////////////////// if (create&&create(data,ocodecpar)<0) { _DMESSAGE("creating statistics"); avcodec_parameters_free(&ocodecpar); goto e_stats; } #endif // ] avcodec_parameters_free(&ocodecpar); #else // ] [ ocodecpar=*icodecpar; ocodecpar.channel_layout=channel_layout; #if defined (FF_ANALYZER_CREATE_OCHANNELS) // [ ocodecpar.channels=av_get_channel_layout_nb_channels(channel_layout); #endif // ] /////////////////////////////////////////////////////////////////////////// if (ff_resampler_create(&a->normalizer,&ocodecpar,icodecpar)<0) { _DMESSAGE("creating normalizer"); goto e_normalizer; } /////////////////////////////////////////////////////////////////////////// if (create&&create(data,&ocodecpar)<0) { _DMESSAGE("creating statistics"); goto e_stats; } #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ } else { #endif // ] /////////////////////////////////////////////////////////////////////////// a->normalizer.ctx=NULL; #if 0 && defined (FF_ANALYZER_STATS_CREATE) // [ /////////////////////////////////////////////////////////////////////////// if (create&&create(data,icodecpar)<0) { _DMESSAGE("creating statistics"); goto e_stats; } #endif // ] #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [ } #endif // ] ///////////////////////////////////////////////////////////////////////////// a->pkt=av_packet_alloc(); if (!a->pkt) { _DMESSAGE("allocating packet"); goto e_packet; } ///////////////////////////////////////////////////////////////////////////// a->frame=av_frame_alloc(); if (!a->frame) { _DMESSAGE("allocating frame"); goto e_frame; } ///////////////////////////////////////////////////////////////////////////// PRINTF(__FILE__,__LINE__,"upsample:%p\n",cb?cb->upsample:NULL); PRINTF(__FILE__,__LINE__,"upsample:%d\n",upsample); if (1sample_rate*=upsample; ocodecpar->format=AV_SAMPLE_FMT_DBLP; if (ff_resampler_create(&a->upsampler,ocodecpar,icodecpar)<0) { _DMESSAGE("creating upsampler"); avcodec_parameters_free(&ocodecpar); goto e_upsampler; } #else // ] [ ocodecpar=*icodecpar; ocodecpar.sample_rate*=upsample; ocodecpar.format=AV_SAMPLE_FMT_DBLP; if (ff_resampler_create(&a->upsampler,&ocodecpar,icodecpar)<0) { _DMESSAGE("creating upsampler"); goto e_upsampler; } #endif // ] } else a->upsampler.ctx=NULL; ///////////////////////////////////////////////////////////////////////////// //return 0; return RETURN_INT(__FILE__,__LINE__,0); //cleanup: if (a->upsampler.ctx) resampler_destroy(&a->upsampler); e_upsampler: #if defined (FF_ANALYZER_OCODECPAR_PTR) // [ e_upsampler_ocodecpar_copy: e_upsampler_ocodecpar: #endif // ] av_frame_free(&a->frame); e_frame: av_packet_free(&a->pkt); e_packet: if (cb&&cb->stats.destroy) cb->stats.destroy(data); e_stats: if (a->normalizer.ctx) resampler_destroy(&a->normalizer); e_normalizer: #if defined (FF_ANALYZER_OCODECPAR_PTR) // [ e_normalizer_ocodecpar_copy: e_normalizer_ocodecpar: #endif // ] e_args: //return -1; return RETURN_INT(__FILE__,__LINE__,-1); } void ff_analyzer_destroy(ff_analyzer_t *a, int destroy_stats) { ff_input_callback_t *cb=a->in->cb.in; void *data=a->in->cb.data; #if defined (FF_INPUT_LIST) // [ if (a->in->list) { ff_inout_list(a->in,0); a->in->list=0; } #endif // ] if (a->upsampler.ctx) resampler_destroy(&a->upsampler); av_frame_free(&a->frame); av_packet_free(&a->pkt); if (destroy_stats&&cb&&cb->stats.destroy) cb->stats.destroy(data); if (a->normalizer.ctx) resampler_destroy(&a->normalizer); } /////////////////////////////////////////////////////////////////////////////// static int ff_analyzer_process_frame(ff_analyzer_t *a, AVFrame *frame) { ff_input_callback_t *cb=a->in->cb.in; void *data=a->in->cb.data; #if 0 && defined (FF_TOBIAS_BUG_FIX) // [ int (*fun_upsample)(const void *data)=cb?cb->upsample:NULL; int flag_upsample=fun_upsample(data); #endif // ] int (*add)(void *, int, AVFrame *)=cb?cb->stats.add:NULL; int err; //#warning add PRINTF(__FILE__,__LINE__,"a->normalizer.ctx: %p\n",a->normalizer.ctx); PRINTF(__FILE__,__LINE__,"add: %p\n",add); PRINTF(__FILE__,__LINE__,"a->upsampler.ctx: %p\n",a->upsampler.ctx); if (a->normalizer.ctx) { // normalize. err=resampler_apply(&a->normalizer,frame); if (err<0) { _DMESSAGEV("applying normalizer: %s (%d)",av_err2str(err),err); goto exit; } #if 0 && defined (FF_TOBIAS_BUG_FIX) // [ PRINTF(__FILE__,__LINE__,"fun_upsample: %p\n",fun_upsample); PRINTF(__FILE__,__LINE__,"flag_upsample: %d\n",flag_upsample); if (flag_upsample) { // add to normalized non-upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,flag_upsample,a->normalizer.frame); LEAVE(); if (err<0) { _DMESSAGEV("adding normalized statistics: %s (%d)", av_err2str(err),err); goto exit; } if (!frame) { // we need to flush normalized non-upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,flag_upsample,NULL); LEAVE(); if (err<0) { _DMESSAGEV("flushing normalized statistics: %s (%d)", av_err2str(err),err); goto exit; } } } #else // ] [ if (add) { // add to normalized non-upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,0,a->normalizer.frame); LEAVE(); if (err<0) { _DMESSAGEV("adding normalized statistics: %s (%d)", av_err2str(err),err); goto exit; } if (!frame) { // we need to flush normalized non-upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,0,NULL); LEAVE(); if (err<0) { _DMESSAGEV("flushing normalized statistics: %s (%d)", av_err2str(err),err); goto exit; } } } #endif // ] } else if (add) { // add non-normalized non-upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,0,frame); LEAVE(); if (err<0) { _DMESSAGEV("adding statistics: %s (%d)",av_err2str(err),err); goto exit; } } if (a->upsampler.ctx) { // upsample. err=resampler_apply(&a->upsampler,frame); if (err<0) { _DMESSAGEV("applying upsampler: %s (%d)",av_err2str(err),err); goto exit; } if (add) { // add to upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,1,a->upsampler.frame); LEAVE(); if (err<0) { _DMESSAGEV("adding upsampled statistics: %s (%d)", av_err2str(err),err); goto exit; } } if (!frame) { // we need to flush upsample statistics. ENTER_LINE(__FILE__,__LINE__); err=add(data,1,NULL); LEAVE(); if (err<0) { _DMESSAGEV("flushing upsampled statistics: %s (%d)", av_err2str(err),err); goto exit; } } } err=0; exit: return err; } static int ff_analyzer_send_packet(ff_analyzer_t *a, AVPacket *pkt) { int err=-1; for (;;) { switch (a->state) { case FF_ANALYZER_DECODER_SEND_PACKET: err=avcodec_send_packet(a->in->audio.ctx,pkt); #if defined (FF_PACKET_UNREF) // [ if (pkt) av_packet_unref(pkt); #endif // ] switch (err) { case AVERROR_EOF: goto e_loop; case AVERROR_INVALIDDATA: // Invalid data found when processing input. // No respective documentation found. May occur at the end of MP3. // Intentional fall-through. continue; case 0: // 0 on success a->state=FF_ANALYZER_DECODER_RECEIVE_FRAME; continue; default: _DMESSAGEV("sending packet: %s (%d)",av_err2str(err),err); return err; } case FF_ANALYZER_DECODER_RECEIVE_FRAME: err=avcodec_receive_frame(a->in->audio.ctx,a->frame); switch (err) { case 0: // 0: success, a frame was returned we need to process. err=ff_analyzer_process_frame(a,a->frame); #if defined (FF_FRAME_UNREF) // [ av_frame_unref(a->frame); #endif // ] if (err<0) { _DMESSAGEV("processing frame: %s (%d)",av_err2str(err),err); goto e_loop; } continue; case AVERROR_EOF: // we need to flush processing. err=ff_analyzer_process_frame(a,NULL); if (err<0) { _DMESSAGEV("processing frame: %s (%d)",av_err2str(err),err); goto e_loop; } a->state=FF_ANALYZER_DECODER_SEND_PACKET; return err; case AVERROR(EAGAIN): // AVERROR(EAGAIN): output is not available in this state - user must // try to send new input // read the next packet. a->state=FF_ANALYZER_DECODER_SEND_PACKET; return err; default: #if defined (FF_MUXEER_CONTINUE_ON_INVALIDDATA) // [ // try again. _DWARNINGV("receiving frame: %s (%d:\"%s\")",av_err2str(err),err, a->in->cb.in->path(a->in->cb.data)); a->state=FF_ANALYZER_DECODER_SEND_PACKET; continue; #else // ] [ _DMESSAGEV("receiving frame: %s (%d)",av_err2str(err),err); return err; #endif // ] } default: _DMESSAGE("unexpected state"); goto e_loop; } } return 0; e_loop: return err; } int ff_analyzer_loop(ff_analyzer_t *a) { AVFormatContext *ctx=a->in->fmt.ctx; AVPacket *pkt=a->pkt; int err; read: err=av_read_frame(ctx,pkt); if (err<0) goto eof; else if ((int)ctx->nb_streams<=pkt->stream_index) { #if defined (FF_PACKET_UNREF) // [ av_packet_unref(a->pkt); #endif // ] goto read; } if (ff_input_progress(a->in,pkt)<0) goto eof; if (a->in->ai!=a->pkt->stream_index) { // a packet from a stream we're not interested in has to be skipped. #if defined (FF_PACKET_UNREF) // [ av_packet_unref(a->pkt); #endif // ] goto read; } // an audio packet has been read which has to be decoded. // the packet is unrefed by analyzer_send_packet(). err=ff_analyzer_send_packet(a,a->pkt); if (FF_ANALYZER_DECODER_SEND_PACKET==a->state) { switch (err) { case AVERROR(EAGAIN): goto read; case AVERROR_EOF: goto eof; default: #if 0 // [ Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\02_all_stand_up_never_say_never.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\03_the_oriental.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\01_blues_and_rhythm.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\04_creepin_up_on_you.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\06_solid_gold.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\07_green.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\05_heavy_traffic.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\08_jam_side_down.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\09_diggin_burt_bacharach.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\12_i_don_t_remember_anymore.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\10_do_it_again.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\11_another_day.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\13_money_don_t_matter.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) Error: decoding frame: Error number 0 occurred (0:"F:\r128\audio\contemp\status_quo\2002_heavy_traffic\14_rhythm_of_life.mp3"). (ff_analyzer.c:461:ff_analyzer_loop) _DMESSAGEV("decoding frame: %s (%d)",av_err2str(err),err); goto e_loop; #else // ] [ _DWARNINGV("decoding frame: %s (%d:\"%s\")",av_err2str(err),err, a->in->cb.in->path(a->in->cb.data)); goto eof; #endif // ] } } eof: ///////////////////////////////////////////////////////////////////////////// // we need to flush the decoder. err=ff_analyzer_send_packet(a,NULL); // TODO: // /e/r128/video/contemp/gov_t_mule/2013_05_18_hangout_music_festival/Chapter-001.mkv" if (err<0&&FF_ANALYZER_DECODER_SEND_PACKETstate) { _DMESSAGEV("decoding frame: %s (%d)",av_err2str(err),err); goto e_loop; } ///////////////////////////////////////////////////////////////////////////// #if defined (FF_PROGRESS_STDERR) // [ ff_printer_flush(a->in->printer,stderr); #else // ] [ ff_printer_flush(a->in->printer); #endif // ] ///////////////////////////////////////////////////////////////////////////// return 0; e_loop: return err; } #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) FF_ENABLE_DEPRECATION_WARNINGS // ] #endif bs1770gain-0.9.8/libff/Makefile.am0000755000175000017500000000152015035710477013363 00000000000000AM_CPPFLAGS= AM_CPPFLAGS+=-I$(top_srcdir)/libpbutil AM_CPPFLAGS+=-I$(top_srcdir)/lib1770-2 $(libff_a_OBJECTS): $(CONFIG_HEADER) $(libff_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil.h $(libff_a_OBJECTS): $(top_srcdir)/libpbutil/pbutil_priv.h $(libff_a_OBJECTS): $(top_srcdir)/lib1770-2/lib1770.h noinst_LIBRARIES=libff.a libff_a_SOURCES= libff_a_SOURCES+=ff.h libff_a_SOURCES+=ff_muxer.c libff_a_SOURCES+=ff_fifo.c libff_a_SOURCES+=ff_filter.c libff_a_SOURCES+=ff_analyzer.c libff_a_SOURCES+=ff_resampler.c libff_a_SOURCES+=ff_inout.c libff_a_SOURCES+=ff_printer.c libff_a_SOURCES+=ff_audio.c libff_a_SOURCES+=ff_iter.c libff_a_SOURCES+=ff_wcs2str.c libff_a_SOURCES+=ff_csv2avdict.c libff_a_SOURCES+=ff_mv.c libff_a_SOURCES+=ff_fcmp.c libff_a_SOURCES+=ff_fexists.c libff_a_SOURCES+=ff_mkdir.c libff_a_SOURCES+=ff_rm.c #libff_a_SOURCES+=ff_dynload.c bs1770gain-0.9.8/config.h.in0000664000175000017500000000470415036407371012273 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to libavcodec major version. */ #undef FF_AVCODEC_V /* Define to libavfilter major version. */ #undef FF_AVFILTER_V /* Define to libavformat major version. */ #undef FF_AVFORMAT_V /* Define to libavutil major version. */ #undef FF_AVUTIL_V /* Define to libswscale major version. */ #undef FF_POSTPROC_V /* Define to libswresample major version. */ #undef FF_SWRESAMPLE_V /* Define to libswscale major version. */ #undef FF_SWSCALE_V /* Define to 1 when xml output should be possible. */ #undef HAVE_BG_XML /* Define to 1 if FFmpeg should be loaded dynamically. */ #undef HAVE_FF_DYNLOAD /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 when compiled with references to libpostproc. */ #undef HAVE_LIBPOSTPROC /* Define to 1 when compiled with a rudimentary trace. */ #undef HAVE_PBU_TRACE /* Define to 1 if you have pthreads. */ #undef HAVE_PTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 when compiled with workinprogress. */ #undef HAVE_WORKINPROGRESS /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION bs1770gain-0.9.8/COPYING0000755000175000017500000004325415035710477011312 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. bs1770gain-0.9.8/README0000755000175000017500000000030515035710477011125 00000000000000BS1770GAIN is a loudness scanner compliant with ITU-R BS.1770 and its flavors EBU R128, ATSC A/85, and ReplayGain 2.0. It helps normalizing the loudness of audio and video files to the same level. bs1770gain-0.9.8/ChangeLog0000755000175000017500000000000015035710477012007 00000000000000bs1770gain-0.9.8/libbg/0000755000175000017500000000000015037175773011411 500000000000000bs1770gain-0.9.8/libbg/bg_param_threads.c0000755000175000017500000003111215035710477014752 00000000000000/* * bg_param_threads.c * * Copyright (C) 2014-2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (BG_PARAM_THREADS) // [ /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ static DWORD WINAPI ThreadProc(LPVOID lpParameter); #else // ] [ static void *start_routine(void *p); #endif // ] #if defined (BG_PARAM_NODE_VMT) // [ static bg_param_node_vmt_t vmt; #endif // ] /////////////////////////////////////////////////////////////////////////////// void bg_param_request_clear(bg_param_request_t *request) { request->tag=bg_param_request_tag_null; #if defined (BG_PARAM_SCRIPT) // [ request->script=NULL; #endif // ] request->tree=NULL; request->visitor=NULL; request->dispatch=NULL; } /////////////////////////////////////////////////////////////////////////////// int bg_param_node_create(bg_param_node_t *node, bg_param_threads_t *threads) { ///////////////////////////////////////////////////////////////////////////// #if defined (BG_PARAM_NODE_VMT) // [ node->vmt=&vmt; #endif // ] node->prev=NULL; node->next=NULL; node->threads=threads; bg_param_request_clear(&node->request); if (bg_sync_create(&node->sync)<0) { _DMESSAGE("creating syncition"); goto e_sync; } #if defined (_WIN32) // [ ///////////////////////////////////////////////////////////////////////////// node->hThread=CreateThread( NULL, // LPSECURITY_ATTRIBUTES lpThreadAttributes, 0, // SIZE_T dwStackSize, ThreadProc, // LPTHREAD_START_ROUTINE lpStartAddress, node, // __drv_aliasesMem LPVOID lpParameter, 0, // DWORD dwCreationFlags, NULL // LPDWORD lpThreadId ); if (!node->hThread) { _DMESSAGEV("creating thread (%lu)",GetLastError()); goto e_thread; } #else // ] [ int err; ///////////////////////////////////////////////////////////////////////////// err=pthread_create( &node->thread, // pthread_t *thread, NULL, // const pthread_attr_t *attr, start_routine, // void *(*start_routine) (void *), node // void *arg ); if (err) { _DMESSAGEV("creating thread (%d)",err); goto e_thread; } #endif // ] return 0; //cleanup: #if ! defined (_WIN32) // [ pthread_join(node->thread,NULL); #else // ] [ WaitForSingleObject(node->hThread,INFINITE); CloseHandle(node->hThread); #endif // ] e_thread: bg_sync_destroy(&node->sync); e_sync: return -1; } #if 0 // [ void bg_param_node_destroy(bg_param_node_t *node, int destroy) #else // ] [ void bg_param_node_destroy(bg_param_node_t *node) #endif // ] { #if defined (BG_PARAM_SCRIPT) // [ bg_param_node_request(node,bg_param_request_tag_kill,NULL,NULL,NULL,NULL); #else // ] [ bg_param_node_request(node,bg_param_request_tag_kill,NULL,NULL,NULL); #endif // ] #if ! defined (_WIN32) // [ pthread_join(node->thread,NULL); #else // ] [ WaitForSingleObject(node->hThread,INFINITE); CloseHandle(node->hThread); #endif // ] #if 0 // [ if (destroy) #endif // ] bg_sync_destroy(&node->sync); } #if defined (BG_PARAM_SCRIPT) // [ void bg_param_node_request(bg_param_node_t *node, bg_param_request_tag_t tag, ffchar_t *script, bg_tree_t *tree, bg_visitor_t *visitor, bg_dispatch_t *dispatch) #else // ] [ void bg_param_node_request(bg_param_node_t *node, bg_param_request_tag_t tag, bg_tree_t *tree, bg_visitor_t *visitor, bg_dispatch_t *dispatch) #endif // ] { bg_sync_lock(&node->sync); // { node->request.tag=tag; #if defined (BG_PARAM_SCRIPT) // [ node->request.script=script; #endif // ] node->request.tree=tree; node->request.visitor=visitor; node->request.dispatch=dispatch; bg_sync_signal(&node->sync); bg_sync_unlock(&node->sync); // } } /////////////////////////////////////////////////////////////////////////////// int bg_param_list_create(bg_param_list_t *list, int n, bg_param_node_t *nodes, bg_param_threads_t *threads) { list->count=0; list->head=NULL; list->tail=NULL; while (n) { --n; if (bg_param_node_create(nodes+n,threads)<0) { _DMESSAGE("creating node"); goto e_node; } bg_param_list_push(list,nodes+n); } return 0; //clean: #if 0 // [ bg_param_list_destroy(list,1); #else // ] [ bg_param_list_destroy(list); #endif // ] e_node: return -1; } #if 0 // [ void bg_param_list_destroy(bg_param_list_t *list, int destroy) #else // ] [ void bg_param_list_destroy(bg_param_list_t *list) #endif // ] { bg_param_node_t *cur,*prev; cur=list->tail; while (cur) { prev=cur->prev; #if 0 // [ if (destroy) #endif // ] bg_param_list_unlink(list,cur); #if 0 // [ bg_param_node_destroy(cur,destroy); #else // ] [ bg_param_node_destroy(cur); #endif // ] cur=prev; } } bg_param_node_t *bg_param_list_unlink(bg_param_list_t *list, bg_param_node_t *node) { bg_param_node_t *prev=node->prev; bg_param_node_t *next=node->next; if (prev) prev->next=node->next; else list->head=node->next; node->next=NULL; if (next) next->prev=node->prev; else list->tail=node->prev; node->prev=NULL; --list->count; return prev; } bg_param_node_t *bg_param_list_pop(bg_param_list_t *list) { bg_param_node_t *node=list->tail; bg_param_list_unlink(list,node); return node; } bg_param_node_t *bg_param_list_push(bg_param_list_t *list, bg_param_node_t *node) { node->prev=list->tail; node->next=NULL; if (list->tail) list->tail->next=node; else list->head=node; ++list->count; return list->tail=node; } /////////////////////////////////////////////////////////////////////////////// int bg_param_threads_create(bg_param_threads_t *threads, int n) { ///////////////////////////////////////////////////////////////////////////// if (bg_sync_create(&threads->sync)<0) { _DMESSAGE("creating syncition"); goto e_sync; } ///////////////////////////////////////////////////////////////////////////// threads->nodes=calloc(n,sizeof *threads->nodes); if (!threads->nodes) { _DMESSAGE("allocating nodes"); goto e_nodes; } ///////////////////////////////////////////////////////////////////////////// if (bg_param_list_create(&threads->list.free,n,threads->nodes,threads)<0) { _DMESSAGE("creating free list"); goto e_free; } ///////////////////////////////////////////////////////////////////////////// if (bg_param_list_create(&threads->list.active,0,NULL,threads)<0) { _DMESSAGE("creating active list"); goto e_active; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: #if 0 // [ bg_param_list_destroy(&threads->list.active,1); #else // ] [ bg_param_list_destroy(&threads->list.active); #endif // ] e_active: #if 0 // [ bg_param_list_destroy(&threads->list.free,1); #else // ] [ bg_param_list_destroy(&threads->list.free); #endif // ] e_free: free(threads->nodes); e_nodes: bg_sync_destroy(&threads->sync); e_sync: return -1; } void bg_param_threads_destroy(bg_param_threads_t *threads FFUNUSED) { #if 0 // [ bg_param_list_destroy(&threads->list.active,0); bg_param_list_destroy(&threads->list.free,1); #else // ] [ bg_param_list_destroy(&threads->list.active); bg_param_list_destroy(&threads->list.free); #endif // ] free(threads->nodes); bg_sync_destroy(&threads->sync); } #if defined (BG_PARAM_SCRIPT) // [ void bg_param_threads_visitor_run(bg_param_threads_t *threads, ffchar_t *script, bg_visitor_t *visitor, bg_tree_t *tree, bg_dispatch_t *dispatch) #else // ] [ void bg_param_threads_visitor_run(bg_param_threads_t *threads, bg_visitor_t *visitor, bg_tree_t *tree, bg_dispatch_t *dispatch) #endif // ] { bg_param_node_t *node; bg_sync_lock(&threads->sync); // { #if 0 // [ while (!threads->list.free.count) { #else // ] [ while (!threads->list.free.tail) { #endif // ] if (!threads->list.active.count) { _DMESSAGE("something went wrong"); exit(1); } bg_sync_wait(&threads->sync); #if 1 // [ } if (!threads->list.free.count) { _DMESSAGEV("empty free list: %d %p",threads->list.free.count, threads->list.free.tail); exit(1); } #else // ] [ } if (!threads->list.free.tail) { _DMESSAGEV("empty free list: %d %p",threads->list.free.count, threads->list.free.tail); exit(1); } #endif // ] node=bg_param_list_pop(&threads->list.free); bg_param_list_push(&threads->list.active,node); bg_sync_unlock(&threads->sync); // } #if defined (BG_PARAM_SCRIPT) // [ bg_param_node_request(node,bg_param_request_tag_visitor_run,script, tree,visitor,dispatch); #else // ] [ bg_param_node_request(node,bg_param_request_tag_visitor_run,tree,visitor, dispatch); #endif // ] } void bg_param_threads_drain(bg_param_threads_t *threads) { bg_sync_lock(&threads->sync); // { while (threads->list.active.count) bg_sync_wait(&threads->sync); bg_sync_unlock(&threads->sync); // } } /////////////////////////////////////////////////////////////////////////////// void bg_param_threads_release(bg_param_threads_t *threads, bg_param_node_t *node) { #if 0 && defined (_WIN32) // [ bg_sync_lock(&threads->sync); #endif // ] bg_param_list_unlink(&threads->list.active,node); bg_param_list_push(&threads->list.free,node); bg_sync_signal(&threads->sync); #if 0 && defined (_WIN32) // [ bg_sync_unlock(&threads->sync); #endif // ] } #if defined (BG_PARAM_NODE_VMT) // [ #define BG_PARAM_NODE_VMT_PROC 1 #else // ] [ #define BG_PARAM_NODE_VMT_PROC 0 #endif // ] #if defined (_WIN32) // [ static DWORD WINAPI ThreadProc(LPVOID lpParameter) { bg_param_node_t *node=lpParameter; #else // ] [ static void *start_routine(void *p) { bg_param_node_t *node=p; #endif // ] bg_sync_lock(&node->sync); #if ! (BG_PARAM_NODE_VMT_PROC) // [ bg_param_threads_t *threads=node->threads; #endif // ] bg_param_request_t request; for (;;) { bg_sync_wait(&node->sync); request=node->request; bg_param_request_clear(&node->request); switch (request.tag) { case bg_param_request_tag_null: continue; case bg_param_request_tag_kill: goto e_kill; case bg_param_request_tag_visitor_run: #if (BG_PARAM_NODE_VMT_PROC) // [ bg_node_run(node,&request); #else // ] [ ///////////////////////////////////////////////////////////////////////// request.dispatch(request.tree,request.visitor); ///////////////////////////////////////////////////////////////////////// if (request.tree->parent) { bg_sync_lock(&request.tree->parent->helper.sync); --request.tree->parent->helper.nchildren; bg_sync_signal(&request.tree->parent->helper.sync); bg_sync_unlock(&request.tree->parent->helper.sync); } ///////////////////////////////////////////////////////////////////////// bg_param_threads_release(threads,node); #endif // ] continue; } } e_kill: bg_sync_unlock(&node->sync); #if ! defined (_WIN32) // [ return NULL; } #else // ] [ return 0; } #endif // ] #if defined (BG_PARAM_NODE_VMT) // [ static void run(bg_param_node_t *node, bg_param_request_t *request) { bg_tree_t *tree=request->tree; #if defined (BG_PARAM_SCRIPT) // [ if (request->script) bg_process_tree_run_script(tree); else { #endif // ] /////////////////////////////////////////////////////////////////////////// request->dispatch(tree,request->visitor); #if defined (BG_PARAM_SCRIPT) // [ } #endif // ] ///////////////////////////////////////////////////////////////////////////// if (tree->parent) { bg_sync_lock(&tree->parent->helper.sync); --tree->parent->helper.nchildren; bg_sync_signal(&tree->parent->helper.sync); bg_sync_unlock(&tree->parent->helper.sync); } ///////////////////////////////////////////////////////////////////////////// bg_param_threads_release(node->threads,node); } static bg_param_node_vmt_t vmt={ .run=run, }; #endif // ] #endif // ] bs1770gain-0.9.8/libbg/bg_tree.c0000755000175000017500000002251615035710477013107 00000000000000/* * bg_tree.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// int bg_tree_common_create(bg_tree_t *tree, bg_param_t *param, bg_tree_t *parent, const ffchar_t *path) { ///////////////////////////////////////////////////////////////////////////// memset(tree,0,sizeof *tree); ///////////////////////////////////////////////////////////////////////////// tree->vmt=NULL; tree->param=param; tree->argv=param->argv.cur; tree->parent=parent; tree->depth=parent?1u+parent->depth:0u; tree->next=NULL; tree->prev=NULL; ///////////////////////////////////////////////////////////////////////////// if (bg_tree_source_create(&tree->source,path)<0) { _DMESSAGE("creating source path"); goto e_path; } #if defined (_WIN32) // [ // if LANG is set to e.g. "en_US.UTF-8" we assume we're run from // e.g. MSYS2 shell undestanding UTF-8 otherwise from MS console using // codepage OEM. In the latter case we need an OEM representation of // the basename. if (param->oem&&tree->source.basename) { tree->oem.basename=bg_wcs2str(tree->source.basename,CP_OEMCP); if (!tree->oem.basename) { _DMESSAGE("creating oem basename"); goto e_basename; } } else tree->oem.basename=NULL; // in any case we need an utf-8 representation of path (end basaname.) if (bg_tree_patha_create(&tree->utf8,tree->source.path,CP_UTF8)<0) { _DMESSAGE("creating patha"); goto e_patha; } #endif // ] ///////////////////////////////////////////////////////////////////////////// if (bg_tree_stats_create(tree)<0) { _DMESSAGE("creating stats"); goto e_stats; } #if defined (BG_PARAM_THREADS) // [ if (param->nthreads&&bg_threads_helper_create(&tree->helper)<0) { _DMESSAGE("creating threads"); goto e_threads; } #endif // ] ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: #if defined (BG_PARAM_THREADS) // [ if (param->nthreads) bg_threads_helper_destroy(&tree->helper); e_threads: #endif // ] bg_tree_stats_destroy(tree); e_stats: #if defined (_WIN32) // [ bg_tree_patha_destroy(&tree->utf8); e_patha: if (tree->oem.basename) free(tree->oem.basename); e_basename: #endif // ] bg_tree_path_destroy(&tree->source); e_path: return -1; } void bg_tree_common_destroy(bg_tree_t *tree) { #if defined (BG_PARAM_THREADS) // [ if (tree->param->nthreads) bg_threads_helper_destroy(&tree->helper); #endif // ] bg_tree_stats_destroy(tree); #if defined (_WIN32) // [ bg_tree_patha_destroy(&tree->utf8); if (tree->oem.basename) free(tree->oem.basename); #endif // ] bg_tree_path_destroy(&tree->source); } int bg_tree_stats_create(bg_tree_t *tree) { bg_param_t *param=tree->param; if (param->process) { /////////////////////////////////////////////////////////////////////////// if (BG_FLAGS_AGG_MOMENTARY¶m->flags.aggregate) { tree->stats.momentary=lib1770_stats_new(); if (!tree->stats.momentary) { _DMESSAGE("creating momentary statistics"); goto emomentary; } } else tree->stats.momentary=NULL; /////////////////////////////////////////////////////////////////////////// if (BG_FLAGS_AGG_SHORTTERM¶m->flags.aggregate) { tree->stats.shortterm=lib1770_stats_new(); if (!tree->stats.shortterm) { _DMESSAGE("creating shortterm statistics"); goto eshortterm; } } else tree->stats.shortterm=NULL; } else { tree->stats.momentary=NULL; tree->stats.shortterm=NULL; } tree->stats.samplepeak=0.0; tree->stats.truepeak=0.0; return 0; //cleanup: if (tree->stats.shortterm) lib1770_stats_close(tree->stats.shortterm); eshortterm: if (tree->stats.momentary) lib1770_stats_close(tree->stats.momentary); emomentary: return -1; } void bg_tree_stats_destroy(bg_tree_t *tree) { if (tree->stats.shortterm) { lib1770_stats_close(tree->stats.shortterm); tree->stats.shortterm=NULL; } if (tree->stats.momentary) { lib1770_stats_close(tree->stats.momentary); tree->stats.momentary=NULL; } } int bg_leaf_create(bg_tree_t **tree, bg_param_t *param, bg_tree_t *parent, const ffchar_t *path) { ///////////////////////////////////////////////////////////////////////////// *tree=malloc(sizeof **tree); if (!*tree) { #if defined (BG_TREE_CREATE_CHILD_WARNING) // [ _DWARNING("allocating tree"); #endif // ] goto e_malloc; } ///////////////////////////////////////////////////////////////////////////// if (bg_tree_common_create(*tree,param,parent,path)<0) { #if defined (BG_TREE_CREATE_CHILD_WARNING) // [ _DWARNING("creating tree"); #endif // ] goto e_common; } ///////////////////////////////////////////////////////////////////////////// if (0<=bg_track_content_create(*tree)) { ; } else if (!param->overwrite &&(BG_FLAGS_EXT_COPY¶m->flags.extension) &&0<=bg_file_content_create(*tree)) { ; } else { #if defined (BG_TREE_CREATE_CHILD_WARNING) // [ #if defined (_WIN32) // [ _DWARNING("creating leaf \"%S\"",(*tree)->path.source); #else // ] [ _DWARNING("creating leaf \"%s\"",(*tree)->path.source); #endif // ] #endif // ] goto e_child; } if (parent&&bg_album_push(parent,*tree)<0) { _DMESSAGE("pushing"); goto e_push; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: if (parent) bg_album_pop(parent); e_push: e_child: bg_tree_common_destroy(*tree); e_common: free(*tree); *tree=NULL; e_malloc: return -1; } double *bg_tree_samplepeak(bg_tree_t *tree) { return tree->param->flags.aggregate&BG_FLAGS_AGG_SAMPLEPEAK ?&tree->stats.samplepeak:NULL; } double *bg_tree_truepeak(bg_tree_t *tree) { return tree->param->flags.aggregate&BG_FLAGS_AGG_TRUEPEAK ?&tree->stats.truepeak:NULL; } int bg_tree_merge(bg_tree_t *lhs, const bg_tree_t *rhs) { bg_flags_agg_t aggregate=lhs->param->flags.aggregate; if (aggregate!=rhs->param->flags.aggregate) { _DMESSAGE("trying to merge incompatible trees"); goto emerge; } if (BG_TREE_TYPE_FILE==lhs->vmt->type||BG_TREE_TYPE_FILE==rhs->vmt->type) goto success; if (lhs->param->process) { #if 1 // [ if (0!=(BG_FLAGS_AGG_MOMENTARY&aggregate)) lib1770_stats_merge(lhs->stats.momentary,rhs->stats.momentary); if (0!=(BG_FLAGS_AGG_SHORTTERM&aggregate)) lib1770_stats_merge(lhs->stats.shortterm,rhs->stats.shortterm); if (0!=(BG_FLAGS_AGG_SAMPLEPEAK&aggregate)) { if (lhs->stats.samplepeakstats.samplepeak) lhs->stats.samplepeak=rhs->stats.samplepeak; } if (0!=(BG_FLAGS_AGG_TRUEPEAK&aggregate)) { if (lhs->stats.truepeakstats.truepeak) lhs->stats.truepeak=rhs->stats.truepeak; } #else // ] [ if (lhs->stats.momentary&&rhs->stats.momentary) lib1770_stats_merge(lhs->stats.momentary,rhs->stats.momentary); if (lhs->stats.shortterm&&rhs->stats.shortterm) lib1770_stats_merge(lhs->stats.shortterm,rhs->stats.shortterm); if (0!=(BG_FLAGS_AGG_SAMPLEPEAK&aggregate)) { if (lhs->stats.samplepeakstats.samplepeak) lhs->stats.samplepeak=rhs->stats.samplepeak; } if (0!=(BG_FLAGS_AGG_TRUEPEAK&aggregate)) { if (lhs->stats.truepeakstats.truepeak) lhs->stats.truepeak=rhs->stats.truepeak; } #endif // ] } success: return 0; emerge: return -1; } #if defined (_WIN32) // [ const char *bg_tree_in_basename(bg_tree_t *tree) { #if 0 // [ fprintf(stdout,"oem: %d %p (%s:%d:%s)\n",tree->param->oem,tree->oem.basename, __FILE__,__LINE__,__func__); fflush(stdout); #endif // ] return tree->oem.basename?tree->oem.basename:tree->utf8.basename; } const wchar_t *bg_tree_in_basenamew(bg_tree_t *tree) { return tree->source.basename; } const char *bg_tree_out_basename(bg_tree_t *tree) { bg_track_t *track=&tree->track; // just needed for tracks. if (BG_TREE_TYPE_TRACK!=tree->vmt->type) { _DMESSAGEV("unexpected tree type %d",tree->vmt->type); return ""; } else { #if defined (BG_WIN32_TARGET_UTF8) // [ return track->target.oem.basename ?track->target.oem.basename:track->target.utf8.basename; #else // ] [ return track->target.oem.basename ?track->target.oem.basename:track->target.basename; #endif // ] } } const wchar_t *bg_tree_out_basanamew(bg_tree_t *tree) { return tree->target.basename; } #else // ] [ const char *bg_tree_in_basename(bg_tree_t *tree) { return tree->source.basename; } const char *bg_tree_out_basename(bg_tree_t *tree) { return tree->target.basename; } #endif // ] bs1770gain-0.9.8/libbg/bg_basenamea.c0000755000175000017500000000230415035710477014055 00000000000000/* * bg_basenamea * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (_WIN32) // [ const char *bg_basenamea(const char *path) { const char *bn=path; const char *basename; if (1 * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if ! defined (__BG_H__) // [ #define __BG_H__ #if defined (HAVE_CONFIG_H) // [ #include #endif // ] #include //#define BG_PRINT_PARAM_CLASSIC //#define BG_UNIT_LRA //#define BG_LOUDNESS_ALL #define BG_TOBIAS_BUG_FIX #define BG_TRADITIONAL #if ! defined(BG_TRADITIONAL) // [ #define BG_OPPOSITE #endif // ] #define BG_ESCAPE_XML #if defined (_WIN32) // [ #define BG_COMPILE_TIME_EXPR #endif // ] #define BG_SAMPLES_COUNT #define BG_SERGEY_XML_FIX #define BG_PARAM_QUIET //#define BG_PARAM_PREAMP #if defined (BG_PARAM_QUIET) // [ #if defined (HAVE_PTHREAD) || defined (_WIN32) // [ #define BG_PARAM_THREADS #endif // ] #if defined (BG_PARAM_THREADS) // [ // don't define! //#define BG_VISITOR_NOTIFY_PARENT #endif // ] #if defined (HAVE_PTHREAD) // [ #include #endif // ] #endif // ] #include #include #include #include #if defined (__cplusplus) // [ extern "C" { #endif // ] #if defined (FF_WARN_CHANNEL_OVERFLOW_DISABLE) // [ #define BG_WARN_CHANNEL_OVERFLOW_DISABLE #endif // ] /////////////////////////////////////////////////////////////////////////////// #if ! defined (_WIN32) // [ //#define BG_UTF8_ITER #if defined (BG_UTF8_ITER) // [ //#define BG_UTF8_ITER_WCS #define BG_UTF8_ITER_MASK #else // ] [ #define BG_CHAR_NEXTA #endif // ] #endif // ] #define BG_PARAM_XML_CDATA #define BG_PARAM_SKIP_SCAN #define BG_PARAM_REFERENCE //#define BG_PARAM_NODE_VMT #define BG_PARAM_NODE_VMT #if defined (BG_PARAM_NODE_VMT) // [ #define BG_PARAM_SCRIPT #if defined (BG_PARAM_SCRIPT) // [ #define BG_PARAM_SHELL #endif // ] #endif // ] #define BG_TEMP_PREFIX FFL(".") #define BG_CLOCK #define BG_TRACK_ID #if defined (_WIN32) // [ //#define BG_UNICODE #if defined (BG_UNICODE) // [ //#define BG_NUTF16 #endif // ] #endif // ] //#define BG_PARAM_SLEEP //#define BG_BWF_TAGS //#define BG_TREE_CREATE_CHILD_WARNING //#define BG_PARAM_LFE #if defined (BG_PARAM_LFE) // [ #define BG_CHANNEL_LFE 3 #endif // ] #if defined (_WIN32) // [ #define BG_WIN32_TARGET_UTF8 // WARNING: define BG_WIN32_CREATE_LOCALE at your own risk: at the run-time // of our system _create_locale() doesn't exist and hence you're compiling // un-tested code. //#define BG_WIN32_CREATE_LOCALE #endif // ] /////////////////////////////////////////////////////////////////////////////// typedef unsigned long bg_bits_t; typedef struct bg_album bg_album_t; typedef enum bg_track_tag bg_track_tag_t; typedef struct bg_track_target bg_track_target_t; typedef struct bg_track bg_track_t; typedef enum bg_tree_type bg_tree_type_t; typedef const struct bg_annotation_vmt bg_annotation_vmt_t; typedef const struct bg_tree_vmt bg_tree_vmt_t; typedef struct bg_tree_path bg_tree_path_t; #if defined (_WIN32) // [ typedef struct bg_tree_patha bg_tree_patha_t; #endif // ] typedef struct bg_tree bg_tree_t; typedef const struct bg_visitor_vmt bg_visitor_vmt_t; typedef struct bg_visitor bg_visitor_t; typedef struct bg_param_block bg_param_block_t; typedef enum bg_flags_agg bg_flags_agg_t; typedef enum bg_flags_ext bg_flags_ext_t; typedef enum bg_flags_mode bg_flags_mode_t; typedef enum bg_flags_norm bg_flags_norm_t; typedef const struct bg_print_vmt bg_print_vmt_t; typedef const struct bg_print_conf bg_print_conf_t; typedef const struct bg_param_unit bg_param_unit_t; #if defined (BG_UTF8_ITER) // [ typedef const struct bg_utf8_iter_vmt bg_utf8_iter_vmt_t; #if defined (BG_UTF8_ITER_MASK) // [ typedef enum bg_utf8_iter_mask bg_utf8_iter_mask_t; #endif // ] typedef struct bg_utf8_iter bg_utf8_iter_t; #endif // ] #if defined (BG_PARAM_THREADS) // [ typedef struct bg_sync bg_sync_t; typedef struct bg_threads_helper bg_threads_helper_t; typedef int (bg_dispatch_t)(bg_tree_t *tree, bg_visitor_t *vis); typedef enum bg_param_request_tag bg_param_request_tag_t; typedef struct bg_param_request bg_param_request_t; #if defined (BG_PARAM_NODE_VMT) // [ typedef struct bg_param_node_vmt bg_param_node_vmt_t; #endif // ] typedef struct bg_param_node bg_param_node_t; typedef struct bg_param_list bg_param_list_t; typedef struct bg_param_threads bg_param_threads_t; #endif // ] typedef struct bg_param bg_param_t; typedef struct bg_param_argv bg_param_argv_t; /////////////////////////////////////////////////////////////////////////////// void bg_set_output_xml(bg_param_t *param); int bg_is_output_xml(const bg_param_t *param); /////////////////////////////////////////////////////////////////////////////// int64_t bg_parse_time(const ffchar_t *s); ffchar_t *bg_pathnorm(ffchar_t *path); const ffchar_t *bg_basename(const ffchar_t *path); #if defined (_WIN32) // [ char *bg_wcs2str(const wchar_t *wcs, unsigned int codepage); const char *bg_basenamea(const char *path); #endif // ] /////////////////////////////////////////////////////////////////////////////// enum bg_tree_type { BG_TREE_TYPE_NULL=0, BG_TREE_TYPE_FILE=1<<0, BG_TREE_TYPE_TRACK=1<<1, BG_TREE_TYPE_ALBUM=1<<2, BG_TREE_TYPE_ROOT=1<<3, BG_TREE_TYPE_LEAF=BG_TREE_TYPE_FILE|BG_TREE_TYPE_TRACK, BG_TREE_TYPE_BRANCH=BG_TREE_TYPE_ALBUM|BG_TREE_TYPE_ROOT, }; struct bg_annotation_vmt { int (*create)(bg_tree_t *tree); void (*destroy)(bg_tree_t *tree); }; struct bg_tree_vmt { #if defined (PBU_MESSAGE_AV_LOG) // [ const char *id; #else // ] [ const ffchar_t *id; #endif // ] const bg_tree_type_t type; void (*destroy)(bg_tree_t *tree); int (*accept)(bg_tree_t *tree, bg_visitor_t *vis); bg_annotation_vmt_t annotation; #if defined (BG_TRACK_ID) // [ void (*track_id)(bg_tree_t *tree, int *id); #endif // ] }; //////// int bg_root_create(bg_tree_t *tree, bg_param_t *param); int bg_root_annotation_create(bg_tree_t *tree); void bg_root_annotation_destroy(bg_tree_t *tree); //////// struct bg_album { // counts BG_TREE_TYPE_FILEs and BG_TREE_TYPE_TRACKs. struct { unsigned max,cur; } nchildren; unsigned nleafs; #if defined (BG_TRACK_ID) // [ struct { int id; } track; #endif // ] bg_tree_t *first; bg_tree_t *last; }; int bg_album_create(bg_tree_t **tree, bg_param_t *param, bg_tree_t *parent, const ffchar_t *path); void bg_album_destroy(bg_tree_t *tree); int bg_album_content_create(bg_tree_t *tree, bg_tree_vmt_t *vmt); void bg_album_content_destroy(bg_tree_t *tree); int bg_album_push(bg_tree_t *tree, bg_tree_t *child); bg_tree_t *bg_album_pop(bg_tree_t *tree); int bg_album_annotation_create(bg_tree_t *tree); void bg_album_annotation_destroy(bg_tree_t *tree); //////// enum bg_track_tag { BG_TRACK_TAG_ALGORITHM=1<<0, BG_TRACK_TAG_REFERENCE_LOUDNESS=1<<1, BG_TRACK_TAG_TRACK_GAIN=1<<2, BG_TRACK_TAG_TRACK_PEAK=1<<3, BG_TRACK_TAG_ALBUM_GAIN=1<<4, BG_TRACK_TAG_ALBUM_PEAK=1<<5, BG_TRACK_TAG_MAX=1<<6, }; //////// struct bg_track_target { #if defined (_WIN32) // [ #if defined (BG_WIN32_TARGET_UTF8) // [ struct { #endif // ] char *path; const char *basename; #if defined (BG_WIN32_TARGET_UTF8) // [ } utf8; #endif // ] // if LANG is set to e.g. "en_US.UTF-8" we assume we're run from // e.g. MSYS2 shell undestanding UTF-8 otherwise from MS console using // codepage OEM. In the latter case we need an OEM representation of // e.g. basename. struct { char *basename; } oem; #endif // ] wchar_t *title; struct { size_t len; } pfx; }; //////// struct bg_track { ff_inout_t input; ff_analyzer_t analyzer; bg_track_target_t target; // an utf-8 representation of the target path. struct { char *path; } temp; struct { unsigned long id; } root; struct { #if defined (BG_TRACK_ID) // [ int id; #else // ] [ unsigned long id; #endif // ] } album; struct { lib1770_pre_t *pre; } filter; struct { lib1770_block_t *momentary; lib1770_block_t *shortterm; } block; }; int bg_track_content_create(bg_tree_t *tree); int bg_track_annotation_create(bg_tree_t *tree); void bg_track_annotation_destroy(bg_tree_t *tree); int bg_file_content_create(bg_tree_t *tree); int bg_file_annotation_create(bg_tree_t *tree); void bg_file_annotation_destroy(bg_tree_t *tree); //////// struct bg_tree_path { ffchar_t *path; const ffchar_t *basename; }; int bg_tree_source_create(bg_tree_path_t *tp, const ffchar_t *path); void bg_tree_path_destroy(bg_tree_path_t *tp); #if defined (_WIN32) // [ //////// struct bg_tree_patha { char *path; const char *basename; }; int bg_tree_patha_create(bg_tree_patha_t *p, const wchar_t *path, unsigned int codepage); void bg_tree_patha_destroy(bg_tree_patha_t *p); #endif // ] #if defined (BG_UTF8_ITER) // [ /////////////////////////////////////////////////////////////////////////////// struct bg_utf8_iter_vmt { int (*valid)(bg_utf8_iter_t *i); const uint8_t *(*next)(bg_utf8_iter_t *i); void (*apply)(bg_utf8_iter_t *i); void (*flush)(bg_utf8_iter_t *i); }; #if defined (BG_UTF8_ITER_MASK) // [ enum bg_utf8_iter_mask { // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". BG_UTF8_ITER_MASK_ONE_BYTE=~(1u<<7u), BG_UTF8_ITER_MASK_TWO_BYTES=~(1u<<5u), BG_UTF8_ITER_MASK_THREE_BYTES=~(1u<<4u), BG_UTF8_ITER_MASK_FOUR_BYTES=~(1u<<3u), BG_UTF8_ITER_MBS_SIZE=4, }; #else // ] [ #error not implemented yet #endif // ] struct bg_utf8_iter { bg_utf8_iter_vmt_t *vmt; #if defined (BG_UTF8_ITER_MASK) // [ uint8_t mbs[BG_UTF8_ITER_MBS_SIZE]; #endif // ] const uint8_t *rp; uint8_t *wp; size_t *size; #if defined (BG_UTF8_ITER_WCS) // [ uint8_t wcs; #endif // ] }; void bg_utf8_iter_first(bg_utf8_iter_t *i, const char *rp, char *wp, size_t *size); #elif defined (BG_CHAR_NEXTA) // ] [ const char *bg_char_nexta(const char *str); #elif defined (_WIN32) // ] [ #define bg_char_nexta(str) CharNextA(str) #endif // ] #if defined (BG_PARAM_THREADS) // [ //////// struct bg_sync { #if defined (HAVE_PTHREAD) // [ pthread_mutex_t mutex; pthread_cond_t cond; #elif defined (_WIN32) // ] [ CRITICAL_SECTION cs; HANDLE hEvent; #endif // ] }; int bg_sync_create(bg_sync_t *sync); void bg_sync_destroy(bg_sync_t *sync); void bg_sync_lock(bg_sync_t *sync); void bg_sync_unlock(bg_sync_t *sync); void bg_sync_signal(bg_sync_t *sync); void bg_sync_wait(bg_sync_t *sync); //////// struct bg_threads_helper { unsigned nchildren; bg_sync_t sync; }; int bg_threads_helper_create(bg_threads_helper_t *helper); void bg_threads_helper_destroy(bg_threads_helper_t *helper); #endif // ] struct bg_tree { bg_tree_vmt_t *vmt; bg_param_t *param; bg_param_argv_t *argv; bg_tree_path_t source; #if defined (_WIN32) // [ // if LANG is set to e.g. "en_US.UTF-8" we assume we're run from // e.g. MSYS2 shell undestanding UTF-8 otherwise from MS console using // codepage OEM. In the latter case we need an OEM representation of // e.g. basename. struct { char *basename; } oem; bg_tree_patha_t utf8; #endif // ] bg_tree_path_t target; bg_tree_path_t temp; bg_tree_t *parent; unsigned depth; bg_tree_t *next; bg_tree_t *prev; struct { lib1770_stats_t *momentary; lib1770_stats_t *shortterm; double samplepeak; double truepeak; } stats; #if defined (BG_PARAM_THREADS) // [ bg_threads_helper_t helper; #endif // ] union { bg_album_t album; bg_track_t track; }; }; int bg_tree_common_create(bg_tree_t *tree, bg_param_t *param, bg_tree_t *parent, const ffchar_t *path); void bg_tree_common_destroy(bg_tree_t *tree); int bg_tree_stats_create(bg_tree_t *tree); void bg_tree_stats_destroy(bg_tree_t *tree); // narrow character representation of the basename. const char *bg_tree_in_basename(bg_tree_t *tree); const char *bg_tree_out_basename(bg_tree_t *tree); #if defined (_WIN32) // [ // wide character representation of the basename. const wchar_t *bg_tree_in_basenamew(bg_tree_t *tree); const wchar_t *bg_tree_out_basenamew(bg_tree_t *tree); #endif // ] #if defined (BG_PARAM_SCRIPT) // [ int bg_process_tree_run_script(bg_tree_t *tree); #endif // ] int bg_leaf_create(bg_tree_t **tree, bg_param_t *param, bg_tree_t *parent, const ffchar_t *path); double *bg_tree_samplepeak(bg_tree_t *tree); double *bg_tree_truepeak(bg_tree_t *tree); int bg_tree_merge(bg_tree_t *lhs, const bg_tree_t *rhs); /////////////////////////////////////////////////////////////////////////////// // from "bg_print_conf.c" [ double bg_print_conf_norm(bg_tree_t *tree); double bg_print_conf_momentary_mean(bg_tree_t *tree); double bg_print_conf_momentary_mean_relative(bg_tree_t *tree); double bg_print_conf_momentary_maximum(bg_tree_t *tree); double bg_print_conf_momentary_maximum_relative(bg_tree_t *tree); double bg_print_conf_momentary_range(bg_tree_t *tree); double bg_print_conf_shortterm_mean(bg_tree_t *tree); double bg_print_conf_shortterm_mean_relative(bg_tree_t *tree); double bg_print_conf_shortterm_maximum(bg_tree_t *tree); double bg_print_conf_shortterm_maximum_relative(bg_tree_t *tree); double bg_print_conf_shortterm_range(bg_tree_t *tree); double bg_print_conf_samplepeak_absolute(bg_tree_t *tree); double bg_print_conf_samplepeak_relative(bg_tree_t *tree); double bg_print_conf_truepeak_absolute(bg_tree_t *tree); double bg_print_conf_truepeak_relative(bg_tree_t *tree); const char *bg_print_conf_unit_lum(bg_tree_t *tree); const char *bg_print_conf_unit_lram(bg_tree_t *tree); const char *bg_print_conf_unit_spm(bg_tree_t *tree); const char *bg_print_conf_unit_tpm(bg_tree_t *tree); #if defined (_WIN32) // [ const wchar_t *bg_print_conf_unit_luw(bg_tree_t *tree); const wchar_t *bg_print_conf_unit_lraw(bg_tree_t *tree); const wchar_t *bg_print_conf_unit_spw(bg_tree_t *tree); const wchar_t *bg_print_conf_unit_tpw(bg_tree_t *tree); #endif // ] // ] /////////////////////////////////////////////////////////////////////////////// // several phases are implemented by means of the visitor pattern (cf. e.g. // https://en.wikipedia.org/wiki/Visitor_pattern.) we've got the following // phases: // 1) annotation (cf. below), // 2) analysis, and // 3) re-muxing/transcoding. struct bg_visitor_vmt { #if defined (PBU_DEBUG) // [ const char *id; #endif // ] void (*destroy)(bg_visitor_t *vis); int (*dispatch_file)(bg_visitor_t *vis, bg_tree_t *tree); int (*dispatch_track)(bg_visitor_t *vis, bg_tree_t *tree); int (*dispatch_album)(bg_visitor_t *vis, bg_tree_t *tree); int (*dispatch_root)(bg_visitor_t *vis, bg_tree_t *tree); }; int bg_analyzer_create(bg_visitor_t *vis); int bg_analyzer_album_prefix(bg_visitor_t *vis, bg_tree_t *tree); int bg_analyzer_album_suffix(bg_visitor_t *vis, bg_tree_t *tree); #if 0 && defined (BG_PARAM_THREADS) // [ int bg_analyzer_track(bg_visitor_t *vis, bg_tree_t *tree); #endif // ] int bg_muxer_create(bg_visitor_t *vis); #if 0 && defined (BG_PARAM_THREADS) // [ int bg_muxer_track(bg_visitor_t *vis FFUNUSED, bg_tree_t *tree); #endif // ] //////// struct bg_visitor { bg_visitor_vmt_t *vmt; int depth; }; /////////////////////////////////////////////////////////////////////////////// struct bg_print_vmt { const char *id; int infix; void (*encoding)(bg_param_t *param, int bits); int (*head)(bg_tree_t *tree, int depth, FILE *f); int (*tail)(bg_tree_t *tree, int depth, FILE *f); }; extern bg_print_vmt_t bg_print_classic_vmt; #if defined (HAVE_BG_XML) // [ extern bg_print_vmt_t bg_print_xml_vmt; #endif // ] extern bg_print_vmt_t bg_print_csv_vmt; //////// struct bg_param_block { double ms; int partition; struct { double gate; } mean; struct { double gate; double lower_bound; double upper_bound; } range; }; //////// enum { BG_FLAGS_AGG_MOMENTARY_MEAN_OFFSET, BG_FLAGS_AGG_MOMENTARY_MAXIMUM_OFFSET, BG_FLAGS_AGG_MOMENTARY_RANGE_OFFSET, BG_FLAGS_AGG_SHORTTERM_MEAN_OFFSET, BG_FLAGS_AGG_SHORTTERM_MAXIMUM_OFFSET, BG_FLAGS_AGG_SHORTTERM_RANGE_OFFSET, BG_FLAGS_AGG_SAMPLEPEAK_OFFSET, BG_FLAGS_AGG_TRUEPEAK_OFFSET, BG_FLAGS_AGG_MAX_OFFSET, }; enum bg_flags_agg { #if 1 // [ BG_FLAGS_AGG_MOMENTARY_MEAN=1<vmt->run(node,request)) #endif // ] int bg_param_node_create(bg_param_node_t *node, bg_param_threads_t *threads); #if 0 // [ void bg_param_node_destroy(bg_param_node_t *node, int destroy); #else // ] [ void bg_param_node_destroy(bg_param_node_t *node); #endif // ] #if defined (BG_PARAM_SCRIPT) // [ void bg_param_node_request(bg_param_node_t *node, bg_param_request_tag_t tag, ffchar_t *script, bg_tree_t *tree, bg_visitor_t *visitor, bg_dispatch_t *dispatch); #else // ] [ void bg_param_node_request(bg_param_node_t *node, bg_param_request_tag_t tag, bg_tree_t *tree, bg_visitor_t *visitor, bg_dispatch_t *dispatch); #endif // ] //////// struct bg_param_list { int count; bg_param_node_t *head,*tail; }; int bg_param_list_create(bg_param_list_t *list, int n, bg_param_node_t *nodes, bg_param_threads_t *threads); #if 0 // [ void bg_param_list_destroy(bg_param_list_t *list, int destroy); #else void bg_param_list_destroy(bg_param_list_t *list); #endif // ] bg_param_node_t *bg_param_list_unlink(bg_param_list_t *list, bg_param_node_t *node); bg_param_node_t *bg_param_list_pop(bg_param_list_t *list); bg_param_node_t *bg_param_list_push(bg_param_list_t *list, bg_param_node_t *node); //////// struct bg_param_threads { bg_sync_t sync; bg_param_node_t *nodes; struct { bg_param_list_t free; bg_param_list_t active; } list; }; int bg_param_threads_create(bg_param_threads_t *threads, int n); void bg_param_threads_destroy(bg_param_threads_t *threads); #if defined (BG_PARAM_SCRIPT) // [ void bg_param_threads_visitor_run(bg_param_threads_t *threads, ffchar_t *script, bg_visitor_t *visitor, bg_tree_t *tree, bg_dispatch_t *dispatch); #else // ] [ void bg_param_threads_visitor_run(bg_param_threads_t *threads, bg_visitor_t *visitor, bg_tree_t *tree, bg_dispatch_t *dispatch); #endif // ] void bg_param_threads_drain(bg_param_threads_t *threads); #endif // ] //////// struct bg_param { struct { bg_param_argv_t *min; bg_param_argv_t *cur; bg_param_argv_t *max; } argv; struct count { unsigned long cur; unsigned long max; } count; int process; #if defined (BG_PARAM_PREAMP) // [ float preamp; #endif // ] #if defined (FF_INPUT_LIST) // [ struct { int in,out; } list; #endif // ] #if defined (BG_PARAM_SKIP_SCAN) // [ int skip_scan; #endif // ] #if defined (BG_PARAM_REFERENCE) // [ ffchar_t *reference; #endif // ] #if defined (BG_PARAM_SCRIPT) // [ ffchar_t *script; #endif // ] #if defined (BG_SAMPLES_COUNT) // [ struct { int threshould; } upsampler; #endif // ] struct { int separator; struct { int console; int file; } header; } csv; #if defined (BG_PARAM_XML_CDATA) // [ struct { int cdata; } xml; #endif // ] #if defined (BG_PARAM_SHELL) // [ struct { ffchar_t *interpreter; ffchar_t *parameter; } shell; #endif // ] bg_pilot_t pilot; bg_visitor_t analyzer; bg_tree_t root,*tos; struct { bg_print_vmt_t *vmt; } print; ff_printer_t printer; int loglevel; struct { #if defined (_WIN32) // [ char name[64]; #else // ] [ char *name; #endif // ] } codec; const ffchar_t *temp_prefix; struct { int hierarchy; int progress; } suppress; #if defined (_WIN32) // [ // if LANG is set to e.g. "en_US.UTF-8" we assume we're run from // e.g. MSYS2 shell undestanding UTF-8 otherwise from MS console using // codepage OEM. In the latter case we need an OEM representation of // e.g. basename. int oem; #endif // ] ff_param_decode_t decode; struct { FILE *f; int bits; } result; struct { ffchar_t *dirname; } output; int ai,vi; struct { bg_flags_ext_t extension; bg_flags_mode_t mode; bg_flags_agg_t aggregate; bg_flags_norm_t norm; } flags; #if defined (BG_PARAM_DUMP) // [ int dump; #endif // ] #if defined (BG_PARAM_STEREO) // [ int stereo; #endif // ] double norm; double preamp; #if defined (BG_TRADITIONAL) // [ int traditional; #elif defined (BG_OPPOSITE) // ] [ int opposite; #endif // ] struct { int enabled; double value; } weight; #if defined (BG_CLOCK) // [ int time; #endif // ] #if defined (BG_PARAM_LFE) // [ int lfe; #endif // ] #if defined (_WIN32) && defined (BG_WIN32_CREATE_LOCALE) // [ _locale_t locale; #endif // ] int overwrite; bg_param_unit_t *unit; struct { char pfx[128]; } tag; struct { ffchar_t *sfx; } out; struct { const ffchar_t *audio; const ffchar_t *video; } ext; struct { int64_t begin; int64_t duration; } interval; #if defined (BG_PARAM_QUIET) // [ int quiet; #endif // ] #if defined (BG_PARAM_THREADS) // [ int nthreads; bg_param_threads_t threads; #endif // ] #if defined (BG_PARAM_SLEEP) // [ int sleep; #endif // ] bg_param_block_t momentary; bg_param_block_t shortterm; #if defined (FF_PROGRESS_STDERR) // [ FILE *stdprog; #endif // ] #if defined (FF_WARN_CHANNEL_OVERFLOW_DISABLE) // [ int warn_channel_overflow_disable; #endif // ] }; int bg_param_create(bg_param_t *param); void bg_param_destroy(bg_param_t *param); int bg_param_alloc_arguments(bg_param_t *param, size_t size); void bg_param_free_argumets(bg_param_t *param); void bg_param_set_unit_ebu(bg_param_t *param); void bg_param_set_unit_db(bg_param_t *param); void bg_param_set_process(bg_param_t *param); int bg_param_loop(bg_param_t *param, ffchar_t *const *argv); /////////////////////////////////////////////////////////////////////////////// struct bg_print_conf { bg_flags_agg_t agg; struct { #if defined (_WIN32) // [ struct { struct { const wchar_t *classic; const wchar_t *xml; const wchar_t *csv; } label; } w; #endif // ] struct { struct { const char *classic; const char *xml; const char *csv; } label; } n; }; struct { int argc; struct { double (*fn)(bg_tree_t *tree); #if defined (_WIN32) // [ struct { const wchar_t *format; const wchar_t *(*unit)(bg_param_t *param); } w; #endif // ] struct { const char *format; const char *(*unit)(bg_param_t *param); } n; } argv[2]; }; }; #if defined (_WIN32) // [ void bg_print_conf_unitw(FILE *f, int lc, bg_print_conf_t *c, bg_param_t *param, int argv); #endif // ] void bg_print_conf_unit(FILE *f, int lc, bg_print_conf_t *c, bg_param_t *param, int argv); extern bg_print_conf_t bg_print_conf[BG_FLAGS_AGG_MAX_OFFSET]; #if defined (__cplusplus) // [ } #endif // ] #endif // __BG_H__ ] bs1770gain-0.9.8/libbg/bg_pilot.h0000755000175000017500000000733515035710477013306 00000000000000/* * bg_pilot.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if ! defined (__BG_PILOT_H__) // [ #define __BG_PILOT_H__ #if defined (_WIN32) // [ #include #else // ] [ #include #endif // ] #include #if defined (__cplusplus) // [ extern "C" { #endif // ] /////////////////////////////////////////////////////////////////////////////// /* * The purpose of this data structure reminds us on De Broglie–Bohm theory's * pilot wave (https://en.wikipedia.org/wiki/De_Broglie–Bohm_theory.) Hence * we called it "pilot". */ typedef const struct bg_pilot_hist_vmt bg_pilot_hist_vmt_t; typedef struct bg_pilot_hist_leaf bg_pilot_hist_leaf_t; typedef struct bg_pilot_hist_branch bg_pilot_hist_branch_t; typedef struct bg_pilot_hist bg_pilot_hist_t; typedef const struct bg_pilot_callback bg_pilot_callback_t; typedef struct bg_pilot_client bg_pilot_client_t; typedef struct bg_pilot bg_pilot_t; /////////////////////////////////////////////////////////////////////////////// struct bg_pilot_hist_vmt { #if defined (PBU_DEBUG) // [ const char *id; #endif // ] void (*destroy)(bg_pilot_hist_t *hist); const ffchar_t *(*first)(bg_pilot_hist_t *hist); const ffchar_t *(*next)(bg_pilot_hist_t *hist); }; //////// struct bg_pilot_hist_leaf { #if defined (_MSC_VER) // [ // just to make msc happy ... int __noop; #endif // ] }; int bg_pilot_hist_leaf_create(bg_pilot_hist_t *hist); //////// struct bg_pilot_hist_branch { #if defined (_WIN32) // [ HANDLE hFind; WIN32_FIND_DATAW e; #else // ] [ DIR *dir; struct dirent *e; #endif // ] }; #if defined (_WIN32) // [ int bg_pilot_hist_branch_create(bg_pilot_hist_t *hist, HANDLE hFind, WIN32_FIND_DATAW *e); #else // ] [ int bg_pilot_hist_branch_create(bg_pilot_hist_t *hist, DIR *dir); #endif // ] //////// struct bg_pilot_hist { bg_pilot_hist_vmt_t *vmt; // common data are ceated (destroyed) in bg_pilot::push (bg_pilot::pop.) [ ffchar_t *path; bg_pilot_t *pilot; void *data; // ] union { bg_pilot_hist_leaf_t leaf; bg_pilot_hist_branch_t branch; }; }; //////// struct bg_pilot_callback { struct { int (*enter)(bg_pilot_hist_t *hist, void *data); void (*leave)(bg_pilot_hist_t *hist, void *data); } leaf; struct { int (*enter)(bg_pilot_hist_t *hist, void *data); void (*leave)(bg_pilot_hist_t *hist, void *data); } branch; }; //////// struct bg_pilot_client { bg_pilot_callback_t *cb; void *data; }; //////// struct bg_pilot { bg_pilot_client_t client; bg_pilot_hist_t *min; bg_pilot_hist_t *nxt; bg_pilot_hist_t *max; }; int bg_pilot_create(bg_pilot_t *pilot, size_t size, bg_pilot_callback_t *cb, void *data); void bg_pilot_destroy(bg_pilot_t *pilot); int bg_pilot_first(bg_pilot_t *pilot, const ffchar_t *path); int bg_pilot_next(bg_pilot_t *pilot, int size); int bg_pilot_loop(bg_pilot_t *pilot, const ffchar_t *path); int bg_pilot_empty(const bg_pilot_t *pilot); #if defined (__cplusplus) // [ } #endif // ] #endif // __BG_PILOT_H__ ] bs1770gain-0.9.8/libbg/bg_pilot_branch.c0000755000175000017500000001023115035710477014603 00000000000000/* * bg_pilot_branch.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// static bg_pilot_hist_vmt_t bg_pilot_hist_branch_vmt; /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ int bg_pilot_hist_branch_create(bg_pilot_hist_t *hist, HANDLE hFind, WIN32_FIND_DATAW *e) #else // ] [ int bg_pilot_hist_branch_create(bg_pilot_hist_t *hist, DIR *dir) #endif // ] { bg_pilot_client_t *client=&hist->pilot->client; bg_pilot_hist_branch_t *branch=&hist->branch; hist->vmt=&bg_pilot_hist_branch_vmt; #if defined (_WIN32) // [ branch->hFind=hFind; branch->e=*e; #else // ] [ branch->dir=dir; branch->e=NULL; #endif // ] ///////////////////////////////////////////////////////////////////////////// if (client->cb&&client->cb->branch.enter) { if (client->cb->branch.enter(hist,client->data)<0) { _DMESSAGE("entering branch"); goto e_enter; } } return 0; //cleanup: e_enter: #if defined (_WIN32) // [ FindClose(hFind); #else // ] [ closedir(dir); #endif // ] return -1; } static void bg_pilot_hist_branch_destroy(bg_pilot_hist_t *hist) { bg_pilot_client_t *client=&hist->pilot->client; bg_pilot_hist_branch_t *branch=&hist->branch; if (client->cb&&client->cb->branch.leave) client->cb->branch.leave(hist,client->data); #if defined (_WIN32) // [ FindClose(branch->hFind); #else // ] [ closedir(branch->dir); #endif // ] } /////////////////////////////////////////////////////////////////////////////// static int bg_pilot_hist_branch_navdir(bg_pilot_hist_t *hist) { bg_pilot_hist_branch_t *branch=&hist->branch; #if defined (_WIN32) // [ if (!wcscmp(L".",branch->e.cFileName)) return 1; else if (!wcscmp(L"..",branch->e.cFileName)) return 1; #else // ] [ if (!strcmp(".",branch->e->d_name)) return 1; else if (!strcmp("..",branch->e->d_name)) return 1; #endif // ] else return 0; } static const ffchar_t *bg_pilot_hist_branch_first(bg_pilot_hist_t *hist) { const ffchar_t *entry=NULL; bg_pilot_hist_branch_t *branch=&hist->branch; #if defined (_WIN32) // [ while (bg_pilot_hist_branch_navdir(hist)) { if (!FindNextFileW(branch->hFind,&branch->e)) goto e_readdir; } entry=branch->e.cFileName; #else // ] [ do { branch->e=readdir(branch->dir); if (!branch->e) goto e_readdir; } while (bg_pilot_hist_branch_navdir(hist)); entry=branch->e->d_name; #endif // ] //cleanup: e_readdir: return entry; } static const ffchar_t *bg_pilot_hist_branch_next(bg_pilot_hist_t *hist) { const ffchar_t *entry=NULL; bg_pilot_hist_branch_t *branch=&hist->branch; #if defined (_WIN32) // [ do { if (!FindNextFileW(branch->hFind,&branch->e)) goto e_readdir; } while (bg_pilot_hist_branch_navdir(hist)); entry=branch->e.cFileName; #else // ] [ do { branch->e=readdir(branch->dir); if (!branch->e) goto e_readdir; } while (bg_pilot_hist_branch_navdir(hist)); entry=branch->e->d_name; #endif // ] //cleanup: e_readdir: return entry; } /////////////////////////////////////////////////////////////////////////////// static bg_pilot_hist_vmt_t bg_pilot_hist_branch_vmt={ #if defined (PBU_DEBUG) // [ .id="branch", #endif // ] .destroy=bg_pilot_hist_branch_destroy, .first=bg_pilot_hist_branch_first, .next=bg_pilot_hist_branch_next, }; bs1770gain-0.9.8/libbg/bg_process.c0000755000175000017500000006647015035710477013635 00000000000000/* * bg_process.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (BG_PARAM_SCRIPT) // [ #if defined (_WIN32) // [ #include #include #else // ] [ #include #include #include #endif // ] //#define BG_ENVIR_DEBUG typedef const ffchar_t *ffenvir_t[2]; #if defined (_WIN32) // [ static void path2posix(ffchar_t *p) { while ((p=wcsstr(p,L"\\"))) *p=L'/'; } static size_t envira2envirp(const ffenvir_t *envira, ffchar_t *envirp, int posix) { wchar_t *envir=GetEnvironmentStringsW(),*rp=envir; size_t size=0; size_t size_loop; if (envir) { // for Windows, we need to clone the environment. while (*rp) { size_loop=wcslen(rp)+1; if (envirp) { wcscpy(envirp,rp); envirp+=size_loop; #if defined (BG_ENVIR_DEBUG) // [ envirp[-1]=L'#'; #endif // ] } rp+=size_loop; size+=size_loop*sizeof *envirp; } size+=rp-envir; FreeEnvironmentStringsW(envir); } while ((*envira)[0]) { if ((*envira)[1][0]) { if (envirp) { wcscpy(envirp,(*envira)[0]); envirp+=wcslen(envirp)+1; envirp[-1]=L'='; wcscpy(envirp,(*envira)[1]); if (posix) path2posix(envirp); envirp+=wcslen(envirp)+1; #if defined (BG_ENVIR_DEBUG) // [ envirp[-1]=L'#'; #endif // ] } size_loop=wcslen((*envira)[0])*sizeof *envirp; size_loop+=sizeof *envirp; size_loop=wcslen((*envira)[1])*sizeof *envirp; size_loop+=sizeof *envirp; size+=size_loop; } ++envira; } size+=sizeof *envirp; if (envirp) *envirp++=L'\0'; return size; } #else // ] [ static size_t envira2envirpp(const ffenvir_t *envira, ffchar_t **envirpp) { int size=0; const ffenvir_t *rp=envira; ffchar_t **wpp=envirpp; ffchar_t *wp; while ((*rp)[0]) { if ((*rp)[1]&&wpp) ++wpp; ++rp; } // we need to allocate space for a terminating NULL!!! [ if (wpp) *wpp++=NULL; size+=sizeof wpp; // ] wp=(ffchar_t *)wpp; rp=envira; wpp=envirpp; while ((*rp)[0]) { if ((*rp)[1]) { if (wpp) { *wpp=wp; strcpy(wp,(*rp)[0]); wp+=strlen(wp); *wp++='='; strcpy(wp,(*rp)[1]); wp+=strlen(wp); ++wp; ++wpp; } size+=strlen((*rp)[0]); ++size; size+=strlen((*rp)[1]); ++size; size+=sizeof wpp; } ++rp; } return size; } #endif // ] static int bg_process_muxer_track_annotation_create(bg_tree_t *tree) { int err=-1; #if defined (FF_FLAC_HACK) // [ int hack; #endif // ] if (tree->param->output.dirname||tree->param->overwrite) { #if defined (FF_FLAC_HACK) // [ if (ff_input_open_muxer(&tree->track.input,&hack)<0) { _DMESSAGE("re-opening input"); goto e_input; } #else // ] [ if (ff_input_open_muxer(&tree->track.input)<0) { _DMESSAGE("re-opening input"); goto e_input; } #endif // ] if (tree->vmt->annotation.create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } } err=0; e_annotate: ff_input_close(&tree->track.input); e_input: return err; } static void bg_process_muxer_track_annotation_destroy(bg_tree_t *tree) { if (tree->param->output.dirname||tree->param->overwrite) tree->vmt->annotation.destroy(tree); } static void bg_process_muxer_track_comment(bg_tree_t *tree) { bg_param_t *param=tree->param; bg_track_t *track=&tree->track; #if defined (BG_PARAM_QUIET) // [ if (!param->quiet) { #endif // ] #if defined (BG_PARAM_SKIP_SCAN) // [ if (param->skip_scan) fprintf(stdout,"%s\n",bg_tree_out_basename(tree)); else { #endif // ] fprintf(stdout,"[%lu/%lu] %s\n",track->root.id,param->count.max, bg_tree_out_basename(tree)); #if defined (BG_PARAM_SKIP_SCAN) // [ } #endif // ] fflush(stdout); #if defined (BG_PARAM_QUIET) // [ } #endif // ] } #define BG_ENVIR_ALBUM #if defined (_WIN32) // [ static ffchar_t *bg_process_get_envirp(bg_tree_t *tree, int posix) #else // ] [ static ffchar_t **bg_process_get_envirpp(bg_tree_t *tree) #endif // ] { #if defined (BG_ENVIR_ALBUM) // [ bg_tree_t *parent=tree->parent; #endif // ] ffchar_t norm[32]; ///////////////////////////////////////////////////////////////////////////// ffchar_t track_momentary_mean[32]; ffchar_t track_momentary_mean_relative[32]; ffchar_t track_momentary_maximum[32]; ffchar_t track_momentary_maximum_relative[32]; ffchar_t track_momentary_range[32]; //////// ffchar_t track_shortterm_mean[32]; ffchar_t track_shortterm_mean_relative[32]; ffchar_t track_shortterm_maximum[32]; ffchar_t track_shortterm_maximum_relative[32]; ffchar_t track_shortterm_range[32]; ///////////////////////////////////////////////////////////////////////////// ffchar_t track_samplepeak_absolute[32]; ffchar_t track_samplepeak_relative[32]; ffchar_t track_truepeak_absolute[32]; ffchar_t track_truepeak_relative[32]; #if defined (BG_ENVIR_ALBUM) // [ //////// ffchar_t album_momentary_mean[32]; ffchar_t album_momentary_mean_relative[32]; ffchar_t album_momentary_maximum[32]; ffchar_t album_momentary_maximum_relative[32]; ffchar_t album_momentary_range[32]; //////// ffchar_t album_shortterm_mean[32]; ffchar_t album_shortterm_mean_relative[32]; ffchar_t album_shortterm_maximum[32]; ffchar_t album_shortterm_maximum_relative[32]; ffchar_t album_shortterm_range[32]; ///////////////////////////////////////////////////////////////////////////// ffchar_t album_samplepeak_absolute[32]; ffchar_t album_samplepeak_relative[32]; ffchar_t album_truepeak_absolute[32]; ffchar_t album_truepeak_relative[32]; #endif // ] const ffenvir_t envir[]={ {FFL("BS1770GAIN_SOURCE"),tree->source.path}, {FFL("BS1770GAIN_TARGET"),tree->target.path}, //{FFL("BS1770GAIN_TARGET_DIRECTORY"),tree->parent->target.path}, #if defined (_WIN32) // [ {FFL("BS1770GAIN_LU"),bg_print_conf_unit_luw(tree)}, {FFL("BS1770GAIN_LRA"),bg_print_conf_unit_lraw(tree)}, #else // ] [ {FFL("BS1770GAIN_LU"),bg_print_conf_unit_lum(tree)}, {FFL("BS1770GAIN_LRA"),bg_print_conf_unit_lram(tree)}, #endif // ] {FFL("BS1770GAIN_OVERWRITE"),tree->param->overwrite?FFL("yes"):FFL("")}, {FFL("BS1770GAIN_NORM"),norm}, /////////////////////////////////////////////////////////////////////////// {FFL("BS1770GAIN_INTEGRATED"), track_momentary_mean}, {FFL("BS1770GAIN_INTEGRATED_RELATIVE"), track_momentary_mean_relative}, {FFL("BS1770GAIN_MOMENTARY_MEAN"), track_momentary_mean}, {FFL("BS1770GAIN_MOMENTARY_MEAN_RELATIVE"), track_momentary_mean_relative}, {FFL("BS1770GAIN_MOMENTARY_MAXIMUM"), track_momentary_maximum}, {FFL("BS1770GAIN_MOMENTARY_MAXIMUM_RELATIVE"), track_momentary_maximum_relative}, {FFL("BS1770GAIN_MOMENTARY_RANGE"), track_momentary_range}, //////// {FFL("BS1770GAIN_SHORTTERM"), track_shortterm_mean}, {FFL("BS1770GAIN_SHORTTERM_RELATIVE"), track_shortterm_mean_relative}, {FFL("BS1770GAIN_SHORTTERM_MEAN"), track_shortterm_mean}, {FFL("BS1770GAIN_SHORTTERM_MEAN_RELATIVE"), track_shortterm_mean_relative}, {FFL("BS1770GAIN_SHORTTERM_MAXIMUM"), track_shortterm_maximum}, {FFL("BS1770GAIN_SHORTTERM_MAXIMUM_RELATIVE"), track_shortterm_maximum_relative}, {FFL("BS1770GAIN_SHORTTERM_RANGE"), track_shortterm_range}, //////// {FFL("BS1770GAIN_SAMPLEPEAK_ABSOLUTE"), track_samplepeak_absolute}, {FFL("BS1770GAIN_SAMPLEPEAK_RELATIVE"), track_samplepeak_relative}, {FFL("BS1770GAIN_TRUEPEAK_ABSOLUTE"), track_truepeak_absolute}, {FFL("BS1770GAIN_TRUEPEAK_RELATIVE"), track_truepeak_relative}, /////////////////////////////////////////////////////////////////////////// {FFL("BS1770GAIN_TRACK_INTEGRATED"), track_momentary_mean}, {FFL("BS1770GAIN_TRACK_INTEGRATED_RELATIVE"), track_momentary_mean_relative}, {FFL("BS1770GAIN_TRACK_MOMENTARY_MEAN"), track_momentary_mean}, {FFL("BS1770GAIN_TRACK_MOMENTARY_MEAN_RELATIVE"), track_momentary_mean_relative}, {FFL("BS1770GAIN_TRACK_MOMENTARY_MAXIMUM"), track_momentary_maximum}, {FFL("BS1770GAIN_TRACK_MOMENTARY_MAXIMUM_RELATIVE"), track_momentary_maximum_relative}, {FFL("BS1770GAIN_TRACK_MOMENTARY_RANGE"), track_momentary_range}, //////// {FFL("BS1770GAIN_TRACK_SHORTTERM"), track_shortterm_mean}, {FFL("BS1770GAIN_TRACK_SHORTTERM_RELATIVE"), track_shortterm_mean_relative}, {FFL("BS1770GAIN_TRACK_SHORTTERM_MEAN"), track_shortterm_mean}, {FFL("BS1770GAIN_TRACK_SHORTTERM_MEAN_RELATIVE"), track_shortterm_mean_relative}, {FFL("BS1770GAIN_TRACK_SHORTTERM_MAXIMUM"), track_shortterm_maximum}, {FFL("BS1770GAIN_TRACK_SHORTTERM_MAXIMUM_RELATIVE"), track_shortterm_maximum_relative}, {FFL("BS1770GAIN_TRACK_SHORTTERM_RANGE"), track_shortterm_range}, //////// {FFL("BS1770GAIN_TRACK_SAMPLEPEAK_ABSOLUTE"), track_samplepeak_absolute}, {FFL("BS1770GAIN_TRACK_SAMPLEPEAK_RELATIVE"), track_samplepeak_relative}, {FFL("BS1770GAIN_TRACK_TRUEPEAK_ABSOLUTE"), track_truepeak_absolute}, {FFL("BS1770GAIN_TRACK_TRUEPEAK_RELATIVE"), track_truepeak_relative}, #if defined (BG_ENVIR_ALBUM) // [ /////////////////////////////////////////////////////////////////////////// {FFL("BS1770GAIN_ALBUM_INTEGRATED"), album_momentary_mean}, {FFL("BS1770GAIN_ALBUM_INTEGRATED_RELATIVE"), album_momentary_mean_relative}, {FFL("BS1770GAIN_ALBUM_MOMENTARY_MEAN"), album_momentary_mean}, {FFL("BS1770GAIN_ALBUM_MOMENTARY_MEAN_RELATIVE"), album_momentary_mean_relative}, {FFL("BS1770GAIN_ALBUM_MOMENTARY_MAXIMUM"), album_momentary_maximum}, {FFL("BS1770GAIN_ALBUM_MOMENTARY_MAXIMUM_RELATIVE"), album_momentary_maximum_relative}, {FFL("BS1770GAIN_ALBUM_MOMENTARY_RANGE"), album_momentary_range}, //////// {FFL("BS1770GAIN_ALBUM_SHORTTERM"), album_shortterm_mean}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_RELATIVE"), album_shortterm_mean_relative}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_MEAN"), album_shortterm_mean}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_MEAN_RELATIVE"), album_shortterm_mean_relative}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_MAXIMUM"), album_shortterm_maximum}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_MAXIMUM_RELATIVE"), album_shortterm_maximum_relative}, {FFL("BS1770GAIN_ALBUM_SHORTTERM_RANGE"), album_shortterm_range}, //////// {FFL("BS1770GAIN_ALBUM_SAMPLEPEAK_ABSOLUTE"), album_samplepeak_absolute}, {FFL("BS1770GAIN_ALBUM_SAMPLEPEAK_RELATIVE"), album_samplepeak_relative}, {FFL("BS1770GAIN_ALBUM_TRUEPEAK_ABSOLUTE"), album_truepeak_absolute}, {FFL("BS1770GAIN_ALBUM_TRUEPEAK_RELATIVE"), album_truepeak_relative}, #endif // ] /////////////////////////////////////////////////////////////////////////// {NULL,NULL} }; size_t size; #if defined (_WIN32) // [ ffchar_t *envirp; #else // ] [ ffchar_t **envirpp; #endif // ] ///////////////////////////////////////////////////////////////////////////// _SNPRINTF(norm,(sizeof norm)/(sizeof norm[0]),"%0.2lf", bg_print_conf_norm(tree)); ///////////////////////////////////////////////////////////////////////////// if (BG_FLAGS_AGG_MOMENTARY_MEAN&tree->param->flags.aggregate) { size=(sizeof track_momentary_mean)/(sizeof track_momentary_mean[0]); _SNPRINTF(track_momentary_mean,size,"%0.2f", bg_print_conf_momentary_mean(tree)); //////// size=(sizeof track_momentary_mean_relative) /(sizeof track_momentary_mean_relative[0]), _SNPRINTF(track_momentary_mean_relative,size,"%0.2f", bg_print_conf_momentary_mean_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ /////////////////////////////////////////////////////////////////////////// size=(sizeof album_momentary_mean)/(sizeof album_momentary_mean[0]); _SNPRINTF(album_momentary_mean,size,"%0.2f", bg_print_conf_momentary_mean(parent)); //////// size=(sizeof album_momentary_mean_relative) /(sizeof album_momentary_mean_relative[0]), _SNPRINTF(album_momentary_mean_relative,size,"%0.2f", bg_print_conf_momentary_mean_relative(parent)); #endif // ] } else { size=sizeof track_momentary_mean; memset(track_momentary_mean,0,size); //////// size=sizeof track_momentary_mean_relative; memset(track_momentary_mean_relative,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_momentary_mean; memset(album_momentary_mean,0,size); //////// size=sizeof album_momentary_mean_relative; memset(album_momentary_mean_relative,0,size); #endif // ] } if (BG_FLAGS_AGG_MOMENTARY_MAXIMUM&tree->param->flags.aggregate) { size=(sizeof track_momentary_maximum) /(sizeof track_momentary_maximum[0]); _SNPRINTF(track_momentary_maximum,size,"%0.2f", bg_print_conf_momentary_maximum(tree)); //////// size=(sizeof track_momentary_maximum_relative) /(sizeof track_momentary_maximum_relative[0]), _SNPRINTF(track_momentary_maximum_relative,size,"%0.2f", bg_print_conf_momentary_maximum_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_momentary_maximum) /(sizeof album_momentary_maximum[0]); _SNPRINTF(album_momentary_maximum,size,"%0.2f", bg_print_conf_momentary_maximum(parent)); //////// size=(sizeof album_momentary_maximum_relative) /(sizeof album_momentary_maximum_relative[0]), _SNPRINTF(album_momentary_maximum_relative,size,"%0.2f", bg_print_conf_momentary_maximum_relative(parent)); #endif // ] } else { size=sizeof track_momentary_maximum; memset(track_momentary_maximum,0,size); //////// size=sizeof track_momentary_maximum_relative; memset(track_momentary_maximum_relative,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_momentary_maximum; memset(album_momentary_maximum,0,size); //////// size=sizeof album_momentary_maximum_relative; memset(album_momentary_maximum_relative,0,size); #endif // ] } if (BG_FLAGS_AGG_MOMENTARY_RANGE&tree->param->flags.aggregate) { size=(sizeof track_momentary_range)/(sizeof track_momentary_range[0]); _SNPRINTF(track_momentary_range,size,"%0.2f", bg_print_conf_momentary_range(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_momentary_range)/(sizeof album_momentary_range[0]); _SNPRINTF(album_momentary_range,size,"%0.2f", bg_print_conf_momentary_range(parent)); #endif // ] } else { size=sizeof track_momentary_range; memset(track_momentary_range,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_momentary_range; memset(album_momentary_range,0,size); #endif // ] } ///////////////////////////////////////////////////////////////////////////// if (BG_FLAGS_AGG_SHORTTERM_MEAN&tree->param->flags.aggregate) { size=(sizeof track_shortterm_mean)/(sizeof track_shortterm_mean[0]); _SNPRINTF(track_shortterm_mean,size,"%0.2f", bg_print_conf_shortterm_mean(tree)); //////// size=(sizeof track_shortterm_mean_relative) /(sizeof track_shortterm_mean_relative[0]), _SNPRINTF(track_shortterm_mean_relative,size,"%0.2f", bg_print_conf_shortterm_mean_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_shortterm_mean)/(sizeof album_shortterm_mean[0]); _SNPRINTF(album_shortterm_mean,size,"%0.2f", bg_print_conf_shortterm_mean(parent)); //////// size=(sizeof album_shortterm_mean_relative) /(sizeof album_shortterm_mean_relative[0]), _SNPRINTF(album_shortterm_mean_relative,size,"%0.2f", bg_print_conf_shortterm_mean_relative(parent)); #endif // ] } else { size=sizeof track_shortterm_mean; memset(track_shortterm_mean,0,sizeof track_shortterm_mean); //////// size=sizeof track_shortterm_mean_relative; memset(track_shortterm_mean_relative,0,size); } if (BG_FLAGS_AGG_SHORTTERM_MAXIMUM&tree->param->flags.aggregate) { size=(sizeof track_shortterm_maximum)/(sizeof track_shortterm_maximum[0]), _SNPRINTF(track_shortterm_maximum,size,"%0.2f", bg_print_conf_shortterm_maximum(tree)); //////// size=(sizeof track_shortterm_maximum_relative) /(sizeof *track_shortterm_maximum_relative); _SNPRINTF(track_shortterm_maximum_relative,size,"%0.2f", bg_print_conf_shortterm_maximum_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_shortterm_maximum)/(sizeof album_shortterm_maximum[0]), _SNPRINTF(album_shortterm_maximum,size,"%0.2f", bg_print_conf_shortterm_maximum(parent)); //////// size=(sizeof album_shortterm_maximum_relative) /(sizeof *album_shortterm_maximum_relative); _SNPRINTF(album_shortterm_maximum_relative,size,"%0.2f", bg_print_conf_shortterm_maximum_relative(parent)); #endif // ] } else { size=sizeof track_shortterm_maximum; memset(track_shortterm_maximum,0,size); //////// size=sizeof track_shortterm_maximum_relative; memset(track_shortterm_maximum_relative,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_shortterm_maximum; memset(album_shortterm_maximum,0,size); //////// size=sizeof album_shortterm_maximum_relative; memset(album_shortterm_maximum_relative,0,size); #endif // ] } if (BG_FLAGS_AGG_SHORTTERM_RANGE&tree->param->flags.aggregate) { size=(sizeof track_shortterm_range)/(sizeof track_shortterm_range[0]); _SNPRINTF(track_shortterm_range,size,"%0.2f", bg_print_conf_shortterm_range(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_shortterm_range)/(sizeof album_shortterm_range[0]); _SNPRINTF(album_shortterm_range,size,"%0.2f", bg_print_conf_shortterm_range(parent)); #endif // ] } else { size=sizeof track_shortterm_range; memset(track_shortterm_range,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_shortterm_range; memset(album_shortterm_range,0,size); #endif // ] } ///////////////////////////////////////////////////////////////////////////// if (BG_FLAGS_AGG_SAMPLEPEAK&tree->param->flags.aggregate) { size=(sizeof track_samplepeak_absolute) /(sizeof track_samplepeak_absolute[0]); _SNPRINTF(track_samplepeak_absolute,size,"%0.2f", bg_print_conf_samplepeak_absolute(tree)); //////// size=(sizeof track_samplepeak_relative) /(sizeof track_samplepeak_relative[0]); _SNPRINTF(track_samplepeak_relative,size,"%0.2f", bg_print_conf_samplepeak_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_samplepeak_absolute) /(sizeof album_samplepeak_absolute[0]); _SNPRINTF(album_samplepeak_absolute,size,"%0.2f", bg_print_conf_samplepeak_absolute(parent)); //////// size=(sizeof album_samplepeak_relative) /(sizeof album_samplepeak_relative[0]); _SNPRINTF(album_samplepeak_relative,size,"%0.2f", bg_print_conf_samplepeak_relative(parent)); #endif // ] } else { size=sizeof track_samplepeak_absolute; memset(track_samplepeak_absolute,0,sizeof track_samplepeak_absolute); //////// size=sizeof track_samplepeak_relative; memset(track_samplepeak_relative,0,sizeof track_samplepeak_relative); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_samplepeak_absolute; memset(album_samplepeak_absolute,0,sizeof album_samplepeak_absolute); //////// size=sizeof album_samplepeak_relative; memset(album_samplepeak_relative,0,sizeof album_samplepeak_relative); #endif // ] } if (BG_FLAGS_AGG_TRUEPEAK&tree->param->flags.aggregate) { size=(sizeof track_truepeak_absolute) /(sizeof track_truepeak_absolute[0]); _SNPRINTF(track_truepeak_absolute,size,"%0.2f", bg_print_conf_truepeak_absolute(tree)); //////// size=(sizeof track_truepeak_relative) /(sizeof track_truepeak_relative[0]); _SNPRINTF(track_truepeak_relative,size,"%0.2f", bg_print_conf_truepeak_relative(tree)); #if defined (BG_ENVIR_ALBUM) // [ //////// size=(sizeof album_truepeak_absolute) /(sizeof album_truepeak_absolute[0]); _SNPRINTF(album_truepeak_absolute,size,"%0.2f", bg_print_conf_truepeak_absolute(parent)); //////// size=(sizeof album_truepeak_relative) /(sizeof album_truepeak_relative[0]); _SNPRINTF(album_truepeak_relative,size,"%0.2f", bg_print_conf_truepeak_relative(parent)); #endif // ] } else { size=sizeof track_truepeak_absolute; memset(track_truepeak_absolute,0,size); //////// size=sizeof track_truepeak_relative; memset(track_truepeak_relative,0,size); #if defined (BG_ENVIR_ALBUM) // [ //////// size=sizeof album_truepeak_absolute; memset(album_truepeak_absolute,0,size); //////// size=sizeof album_truepeak_relative; memset(album_truepeak_relative,0,size); #endif // ] } #if defined (_WIN32) // [ size=envira2envirp(envir,NULL,posix); if (!size||!(envirp=malloc(size))) { _DMESSAGE("allocating envirp"); goto e_envirp_alloc; } if (envira2envirp(envir,envirp,posix)!=size) { _DMESSAGE("initilizing envirp"); goto e_envirp_init; } return envirp; e_envirp_init: free(envirp); e_envirp_alloc: #else // ] [ size=envira2envirpp(envir,NULL); if (!size||!(envirpp=malloc(size))) { _DMESSAGE("allocating envirpp"); goto e_envirpp_alloc; } if (envira2envirpp(envir,envirpp)!=size) { _DMESSAGE("initilizing envirpp"); goto e_envirpp_init; } return envirpp; e_envirpp_init: free(envirpp); e_envirpp_alloc: #endif // ] return NULL; } static int _bg_process_tree_run_script(bg_tree_t *tree) { #if defined (_WIN32) // [ static const wchar_t CMD_EXEC[]=L"C:\\Windows\\system32\\cmd.exe /C "; static const wchar_t CMD_CALL[]=L"C:\\Windows\\system32\\cmd.exe /C call "; #endif // ] int err=-1; bg_param_t *param=tree->param; #if defined (_WIN32) // [ struct _stat buf; const wchar_t *CMD; STARTUPINFOW startup_info; PROCESS_INFORMATION process_info; wchar_t *cmd,*wp; ffchar_t *envirp=NULL; int bRes; #if defined (BG_PARAM_SHELL) // [ int posix; #endif // ] memset(&startup_info,0,sizeof startup_info); startup_info.cb=sizeof startup_info; memset(&process_info,0,sizeof process_info); #if defined (BG_PARAM_SHELL) // [ if (param->shell.interpreter) { posix=1; wp=cmd=malloc((wcslen(param->shell.interpreter) +1 +wcslen(param->shell.parameter) +1 +1+wcslen(param->script)+1)*sizeof *cmd); if (!cmd) { DMESSAGE("allocating cmd"); goto e_cmd; } wcscpy(wp,param->shell.interpreter); wp+=wcslen(wp); *wp++=L' '; wcscpy(wp,param->shell.parameter); wp+=wcslen(wp); *wp++=L' '; *wp++=L'"'; wcscpy(wp,param->script); path2posix(wp); wp+=wcslen(wp); *wp++=L'"'; *wp=L'\0'; } else { #endif // ] posix=0; CMD=_wstat(param->script,&buf)?CMD_EXEC:CMD_CALL; wp=cmd=malloc((wcslen(CMD)+wcslen(param->script)+2)*sizeof *cmd); if (!cmd) { DMESSAGE("allocating cmd"); goto e_cmd; } wcscpy(wp,CMD); wp+=wcslen(wp); *wp++=L'"'; wcscpy(wp,param->script); wp+=wcslen(wp); *wp++=L'"'; *wp=L'\0'; #if defined (BG_PARAM_SHELL) // [ } #endif // ] if (!(envirp=bg_process_get_envirp(tree,posix))) { _DMESSAGE("creating envirp"); goto e_envirp; } #if defined (BG_ENVIR_DEBUG) // [ _DWRITELNV("envirp:\"%" PBU_PRIs "\"",envirp); exit(1); #endif // ] for (;;) { bRes=CreateProcessW( NULL, // LPCWSTR lpApplicationName, cmd, // LPWSTR lpCommandLine, NULL, // LPSECURITY_ATTRIBUTES lpProcessAttributes, NULL, // LPSECURITY_ATTRIBUTES lpThreadAttributes, TRUE, // BOOL bInheritHandles, CREATE_UNICODE_ENVIRONMENT, // DWORD dwCreationFlags, envirp, // LPVOID lpEnvironment, NULL, // LPCWSTR lpCurrentDirectory, &startup_info, // LPSTARTUPINFOW lpStartupInfo, &process_info // LPPROCESS_INFORMATION lpProcessInformation ); if (bRes) { DWORD dwExitCode; WaitForSingleObject(process_info.hProcess,INFINITE); GetExitCodeProcess(process_info.hProcess,&dwExitCode); //_WRITELNV("dwExitCode:%lu",dwExitCode); CloseHandle(process_info.hProcess); CloseHandle(process_info.hThread); bg_process_muxer_track_comment(tree); free(envirp); if (!dwExitCode) { err=0; break; } } else { _DMESSAGE("creating process"); free(envirp); break; } //cleanup: e_envirp: free(cmd); e_cmd: #else // ] [ for (;;) { pid_t pid=fork(); if (pid<0) { // something went wrong. _DMESSAGE("forking"); break; } else if (0shell.interpreter,param->shell.parameter, param->script,NULL}; #else // ] [ char *argv[]={"/bin/sh","-c",param->script,NULL}; #endif // ] ffchar_t **envirpp; if (!(envirpp=bg_process_get_envirpp(tree))) { _DMESSAGE("creating envirpp"); goto e_envirpp; } err=execve(argv[0],argv,envirpp); // we should never go here ... free(envirpp); e_envirpp: _exit(EXIT_FAILURE); } } #endif // ] #if defined (_WIN32) // [ } #endif // ] return err; } int bg_process_tree_run_script(bg_tree_t *tree) { int err=-1; if (!tree->param->script) { _DMESSAGE("missing script"); goto e_script; } if (BG_TREE_TYPE_TRACK!=tree->vmt->type) { _DMESSAGEV("attempt to run script on \"%s\"",tree->vmt->id); goto e_type; } if (tree->param->script) { if (bg_process_muxer_track_annotation_create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } err=_bg_process_tree_run_script(tree); bg_process_muxer_track_annotation_destroy(tree); e_annotate: ; } e_type: e_script: return err; } #endif // ] bs1770gain-0.9.8/libbg/bg_pilot.c0000755000175000017500000001673515035710477013305 00000000000000/* * bg_pilot.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// int bg_pilot_create(bg_pilot_t *pilot, size_t size, bg_pilot_callback_t *cb, void *data) { ///////////////////////////////////////////////////////////////////////////// pilot->client.cb=cb; pilot->client.data=data; ///////////////////////////////////////////////////////////////////////////// pilot->min=malloc(size*sizeof pilot->min[0]); if (!pilot->min) { _DMESSAGE("allocating"); goto e_malloc; } ///////////////////////////////////////////////////////////////////////////// pilot->nxt=pilot->min; pilot->max=pilot->min+size; ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: free(pilot->min); e_malloc: return -1; } static int bg_pilot_realloc(bg_pilot_t *pilot) { size_t size=pilot->max-pilot->min; size_t offs=pilot->nxt-pilot->min; bg_pilot_hist_t *min; ///////////////////////////////////////////////////////////////////////////// size<<=1; if (!size) { _DMESSAGE("overflow"); goto e_overflow; } ///////////////////////////////////////////////////////////////////////////// min=realloc(pilot->min,size*sizeof min[0]); if (!min) { _DMESSAGE("reallocating"); goto e_realloc; } pilot->min=min; pilot->nxt=min+offs; pilot->max=min+size; ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_realloc: e_overflow: return -1; } void bg_pilot_destroy(bg_pilot_t *pilot) { while (pilot->minnxt) { --pilot->nxt; pilot->nxt->vmt->destroy(pilot->nxt); } free(pilot->min); } /////////////////////////////////////////////////////////////////////////////// #if defined (_WIN32) // [ static wchar_t *pathcpyw(wchar_t *target, const wchar_t *source) { wchar_t *tp=target; while (*source) { switch (*source) { case L'/': *tp++=L'\\'; ++source; break; default: *tp++=*source++; break; } } *tp=0; return target; } #endif // ] static int bg_pilot_push(bg_pilot_t *pilot, const ffchar_t *path) { bg_pilot_hist_t *cur=pilot->minnxt?pilot->nxt-1:NULL; const ffchar_t *root=cur?cur->path:NULL; size_t len1=root?FFSTRLEN(root):0u; size_t len2=path?FFSTRLEN(path):0u; size_t size=(len1?len1+1:0)+(len2?len2+1:0); ffchar_t *pp; #if defined (_WIN32) // [ wchar_t *mask,*mp; HANDLE hFind; WIN32_FIND_DATAW e; #else // ] [ DIR *dir; #endif // ] ///////////////////////////////////////////////////////////////////////////// if (!size) { _DMESSAGE("size"); goto e_size; } ///////////////////////////////////////////////////////////////////////////// if (pilot->max==pilot->nxt&&bg_pilot_realloc(pilot)<0) { _DMESSAGE("reallocating"); goto e_realloc; } cur=pilot->nxt; ++pilot->nxt; ///////////////////////////////////////////////////////////////////////////// cur->path=pp=malloc(size*sizeof cur->path[0]); if (!cur->path) { _DMESSAGE("allocatig path"); goto e_path; } cur->pilot=pilot; #if defined (_WIN32) // [ if (len1) { pathcpyw(pp,root); pp+=len1; if (len2) *pp++=FFPATHSEP; } if (len2) { pathcpyw(pp,path); pp+=len2; } while (cur->pathpath); mp+=wcslen(mask); *mp++=FFPATHSEP; *mp++=L'*'; *mp++=L'\0'; memset(&e,0,sizeof e); hFind=FindFirstFileW(mask,&e); free(mask); if (INVALID_HANDLE_VALUE==hFind) { if (bg_pilot_hist_leaf_create(cur)<0) { _DMESSAGE("creating leaf"); goto e_entry; } } else { if (bg_pilot_hist_branch_create(cur,hFind,&e)<0) { _DMESSAGE("creating branch"); goto e_entry; } } #else // ] [ if (len1) { strcpy(pp,root); pp+=len1; if (len2) *pp++=FFPATHSEP; } if (len2) { strcpy(pp,path); pp+=len2; } while (cur->pathpath); if (dir) { if (bg_pilot_hist_branch_create(cur,dir)<0) { _DMESSAGE("creating branch"); goto e_entry; } } else { if (bg_pilot_hist_leaf_create(cur)<0) { _DMESSAGE("creating leaf"); goto e_entry; } } #endif // ] ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_entry: #if defined (_WIN32) // [ e_mask: #endif // ] if (cur) free(cur->path); e_path: --pilot->nxt; e_realloc: e_size: return -1; } static void bg_pilot_pop(bg_pilot_t *pilot) { bg_pilot_hist_t *cur=pilot->minnxt?pilot->nxt-1:NULL; if (cur) { cur->vmt->destroy(cur); if (cur->path) free(cur->path); --pilot->nxt; } } int bg_pilot_first(bg_pilot_t *pilot, const ffchar_t *path) { int err=-1; bg_pilot_hist_t *cur; ///////////////////////////////////////////////////////////////////////////// do { if (bg_pilot_push(pilot,path)<0) { _DMESSAGE("pushing"); goto e_push; } cur=pilot->nxt-1; path=cur->vmt->first(cur); } while (path); ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_push: return err; } int bg_pilot_next(bg_pilot_t *pilot, int size) { int err=-1; bg_pilot_hist_t *cur; const ffchar_t *entry; ///////////////////////////////////////////////////////////////////////////// while (sizenxt-pilot->min) { cur=pilot->nxt-1; entry=cur->vmt->next(cur); if (entry) { do { if (bg_pilot_push(pilot,entry)<0) { _DMESSAGE("pushing"); goto e_push; } cur=pilot->nxt-1; entry=cur->vmt->first(cur); } while (entry); break; } else bg_pilot_pop(pilot); } ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_push: return err; } int bg_pilot_loop(bg_pilot_t *pilot, const ffchar_t *path) { int err=-1; int size=pilot->nxt-pilot->min; ///////////////////////////////////////////////////////////////////////////// if (bg_pilot_first(pilot,path)<0) { _DMESSAGE("first"); goto e_first; } ///////////////////////////////////////////////////////////////////////////// while (sizenxt-pilot->min) { if (bg_pilot_next(pilot,size)<0) { _DMESSAGE("next"); goto e_next; } } ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_next: e_first: return err; } int bg_pilot_empty(const bg_pilot_t *pilot) { return pilot->min==pilot->nxt; } bs1770gain-0.9.8/libbg/bg_file.c0000755000175000017500000000523515035710477013066 00000000000000/* * bg_file.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// static bg_tree_vmt_t bg_file_vmt; /////////////////////////////////////////////////////////////////////////////// int bg_file_content_create(bg_tree_t *tree) { ///////////////////////////////////////////////////////////////////////////// #if 0 // [ // DON'T do this!!! bg_file_create() is called from bg_child_create() // which in front already has called bg_tree_common_create() and just // leaves us with setting the vmt! if (bg_tree_common_create(tree,param,param,path,&bg_file_vmt)<0) { _DMESSAGE("creating tree"); goto etree; } #else // ] [ if ((BG_FLAGS_EXT_CSV&tree->param->flags.extension) &&!FFSTRCMP(FFL("folder.csv"),tree->source.basename)) goto e_basename; tree->vmt=&bg_file_vmt; #endif // ] ++tree->parent->album.nleafs; return 0; //cleanup: e_basename: return -1; } /////////////////////////////////////////////////////////////////////////////// static void bg_file_destroy(bg_tree_t *tree) { bg_param_t *param=tree->param; if (tree->parent) bg_album_pop(tree->parent); if (!param->process) tree->argv->lift=tree->depth; bg_tree_common_destroy(tree); free(tree); } static int bg_file_accept(bg_tree_t *tree, bg_visitor_t *vis) { return vis->vmt->dispatch_file(vis,tree); } #if defined (BG_TRACK_ID) // [ static void bg_file_track_id(bg_tree_t *tree FFUNUSED, int *id FFUNUSED) { } #endif // ] static bg_tree_vmt_t bg_file_vmt={ #if defined (PBU_MESSAGE_AV_LOG) // [ .id="file", #else // ] [ .id=FFL("file"), #endif // ] .type=BG_TREE_TYPE_FILE, .destroy=bg_file_destroy, .accept=bg_file_accept, .annotation={ .create=bg_file_annotation_create, .destroy=bg_file_annotation_destroy, }, #if defined (BG_TRACK_ID) // [ .track_id=bg_file_track_id, #endif // ] }; bs1770gain-0.9.8/libbg/bg_tree_patha.c0000755000175000017500000000320315035710477014254 00000000000000/* * bg_tree_patha.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (_WIN32) // [ int bg_tree_patha_create(bg_tree_patha_t *p, const wchar_t *path, unsigned int codepage) { if (path) { /////////////////////////////////////////////////////////////////////////// p->path=bg_wcs2str(path,codepage); if (!p->path) { _DMESSAGE("creating utf-8 representation of path"); goto epath; } /////////////////////////////////////////////////////////////////////////// p->basename=bg_basenamea(p->path); } else { p->path=NULL; p->basename=NULL; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: if (p->path) free(p->path); epath: return -1; } void bg_tree_patha_destroy(bg_tree_patha_t *p) { if (p->path) free(p->path); } #endif // ] bs1770gain-0.9.8/libbg/bg_tree_path.c0000755000175000017500000000273515035710477014124 00000000000000/* * bg_tree_path.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include int bg_tree_source_create(bg_tree_path_t *tp, const ffchar_t *path) { if (path) { tp->path=FFSTRDUP(path); if (!tp->path) { _DMESSAGE("duplicating path"); goto e_path; } /////////////////////////////////////////////////////////////////////////// tp->basename=bg_basename(tp->path); } else { tp->path=NULL; tp->basename=NULL; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: if (tp->path) free(tp->path); e_path: return -1; } void bg_tree_path_destroy(bg_tree_path_t *tp) { if (tp->path) free(tp->path); } bs1770gain-0.9.8/libbg/bg_print_conf.c0000755000175000017500000003040115035710477014301 00000000000000/* * bg_print_conf.c * * Copyright (C) 2014 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if ! defined (_WIN32) // [ #include #endif // ] /////////////////////////////////////////////////////////////////////////////// double bg_print_conf_norm(bg_tree_t *tree) { return tree->param->preamp+tree->param->norm; } //////// double bg_print_conf_momentary_mean(bg_tree_t *tree) { #if 1 // [ return lib1770_stats_get_mean(tree->stats.momentary, tree->param->momentary.mean.gate); #else // ] [ double mean; _WRITELNV("%p",tree); mean=lib1770_stats_get_mean(tree->stats.momentary, tree->param->momentary.mean.gate); _WRITELNV("%p: %.02lf",tree,mean); return mean; #endif // ] } double bg_print_conf_momentary_mean_relative(bg_tree_t *tree) { double norm=bg_print_conf_norm(tree); double mean=bg_print_conf_momentary_mean(tree); #if defined (BG_TRADITIONAL) // [ return tree->param->traditional?norm-mean:mean-norm; #elif defined (BG_OPPOSITE) // ] [ return tree->param->opposite?mean-norm:norm-mean; #else // ] [ return norm-mean; #endif // ] } //////// double bg_print_conf_momentary_maximum(bg_tree_t *tree) { return lib1770_stats_get_max(tree->stats.momentary); } double bg_print_conf_momentary_maximum_relative(bg_tree_t *tree) { double norm=bg_print_conf_norm(tree); double mean=bg_print_conf_momentary_maximum(tree); #if defined (BG_TRADITIONAL) // [ return tree->param->traditional?norm-mean:mean-norm; #elif defined (BG_OPPOSITE) // ] [ return tree->param->opposite?mean-norm:norm-mean; #else // ] [ return norm-mean; #endif // ] } //////// double bg_print_conf_momentary_range(bg_tree_t *tree) { return lib1770_stats_get_range(tree->stats.momentary, tree->param->momentary.range.gate, tree->param->momentary.range.lower_bound, tree->param->momentary.range.upper_bound); } //////// double bg_print_conf_shortterm_mean(bg_tree_t *tree) { return lib1770_stats_get_mean(tree->stats.shortterm, tree->param->shortterm.mean.gate); } double bg_print_conf_shortterm_mean_relative(bg_tree_t *tree) { double norm=bg_print_conf_norm(tree); double mean=bg_print_conf_shortterm_mean(tree); #if defined (BG_TRADITIONAL) // [ return tree->param->traditional?norm-mean:mean-norm; #elif defined (BG_OPPOSITE) // ] [ return tree->param->opposite?mean-norm:norm-mean; #else // ] [ return norm-mean; #endif // ] } //////// double bg_print_conf_shortterm_maximum(bg_tree_t *tree) { return lib1770_stats_get_max(tree->stats.shortterm); } double bg_print_conf_shortterm_maximum_relative(bg_tree_t *tree) { double norm=bg_print_conf_norm(tree); double mean=bg_print_conf_shortterm_maximum(tree); #if defined (BG_TRADITIONAL) // [ return tree->param->traditional?norm-mean:mean-norm; #elif defined (BG_OPPOSITE) // ] [ return tree->param->opposite?mean-norm:norm-mean; #else // ] [ return norm-mean; #endif // ] } //////// double bg_print_conf_shortterm_range(bg_tree_t *tree) { #if 1 // [ return lib1770_stats_get_range(tree->stats.shortterm, tree->param->shortterm.range.gate, tree->param->shortterm.range.lower_bound, tree->param->shortterm.range.upper_bound); #else // ] [ double range; DWRITELN("==="); range=lib1770_stats_get_range(tree->stats.shortterm, tree->param->shortterm.range.gate, tree->param->shortterm.range.lower_bound, tree->param->shortterm.range.upper_bound); DVWRITELN("=== range:%.02f",range); return range; #endif // ] } //////// double bg_print_conf_samplepeak_absolute(bg_tree_t *tree) { return tree->stats.samplepeak; } double bg_print_conf_samplepeak_relative(bg_tree_t *tree) { return LIB1770_Q2DB(tree->stats.samplepeak); } //////// double bg_print_conf_truepeak_absolute(bg_tree_t *tree) { return tree->stats.truepeak; } double bg_print_conf_truepeak_relative(bg_tree_t *tree) { return LIB1770_Q2DB(tree->stats.truepeak); } /////////////////////////////////////////////////////////////////////////////// const char *bg_print_conf_unit_lum(bg_tree_t *tree) { return tree->param->unit->n.lu; } #if defined (_WIN32) // [ const wchar_t *bg_print_conf_unit_luw(bg_tree_t *tree) { return tree->param->unit->w.lu; } #endif // ] //////// const char *bg_print_conf_unit_lram(bg_tree_t *tree) { return tree->param->unit->n.lra; } #if defined (_WIN32) // [ const wchar_t *bg_print_conf_unit_lraw(bg_tree_t *tree) { return tree->param->unit->w.lra; } #endif // ] //////// const char *bg_print_conf_unit_spm(bg_tree_t *tree) { return tree->param->unit->n.sp; } #if defined (_WIN32) // [ const wchar_t *bg_print_conf_unit_spw(bg_tree_t *tree) { return tree->param->unit->w.sp; } #endif // ] //////// const char *bg_print_conf_unit_tpm(bg_tree_t *tree) { return tree->param->unit->n.tp; } #if defined (_WIN32) // [ const wchar_t *bg_print_conf_unit_tpw(bg_tree_t *tree) { return tree->param->unit->w.tp; } #endif // ] //////// #if defined (_WIN32) // [ #define BG_CONF(AGG,LABEL1,LABEL2,LABEL3,ARGC,FN1,FORMAT1,FN2,FORMAT2) { \ .agg=AGG, \ .w.label={ .classic=L##LABEL1, .xml=L##LABEL2, .csv=L##LABEL3 }, \ .n.label={ .classic=LABEL1, .xml=LABEL2, .csv=LABEL3 }, \ .argc=ARGC, \ \ .argv={ \ { .fn=FN1, .w={ .format=L##FORMAT1 }, .n={ .format=FORMAT1 } }, \ { .fn=FN2, .w={ .format=L##FORMAT2 }, .n={ .format=FORMAT2 } }, \ } \ } #else // ] [ #define BG_CONF(AGG,LABEL1,LABEL2,LABEL3,ARGC,FN1,FORMAT1,FN2,FORMAT2) { \ .agg=AGG, \ .n.label={ .classic=LABEL1, .xml=LABEL2, .csv=LABEL3 }, \ .argc=ARGC, \ \ .argv={ \ { .fn=FN1, .n={ .format=FORMAT1 } }, \ { .fn=FN2, .n={ .format=FORMAT2 } }, \ } \ } #endif // ] #define BG_CONF1(AGG,LABEL1,LABEL2,LABEL3,FN1,FORMAT1) \ BG_CONF(AGG,LABEL1,LABEL2,LABEL3,1,FN1,FORMAT1,NULL,"") #define BG_CONF2(AGG,LABEL1,LABEL2,LABEL3,FN1,FORMAT1,FN2,FORMAT2) \ BG_CONF(AGG,LABEL1,LABEL2,LABEL3,2,FN1,FORMAT1,FN2,FORMAT2) bg_print_conf_t bg_print_conf[BG_FLAGS_AGG_MAX_OFFSET]={ BG_CONF2(BG_FLAGS_AGG_MOMENTARY_MEAN, "integrated (momentary mean)", "integrated", "integrated", bg_print_conf_momentary_mean, "%.2f", bg_print_conf_momentary_mean_relative, "%.2f"), BG_CONF2(BG_FLAGS_AGG_MOMENTARY_MAXIMUM, "momentary maximum", "momentary-maximum", "momentary maximum", bg_print_conf_momentary_maximum, "%.2f", bg_print_conf_momentary_maximum_relative, "%.2f"), BG_CONF1(BG_FLAGS_AGG_MOMENTARY_RANGE, #if defined (BG_UNIT_LRA) // [ "momentary loudness range", "momentary-range", "momentary range", #else // ] [ "momentary lra", "momentary-lra", "momentary lra", #endif // ] bg_print_conf_momentary_range, "%.2f"), BG_CONF2(BG_FLAGS_AGG_SHORTTERM_MEAN, "shortterm mean", "shortterm-mean", "shortterm mean", bg_print_conf_shortterm_mean, "%.2f", bg_print_conf_shortterm_mean_relative, "%.2f"), BG_CONF2(BG_FLAGS_AGG_SHORTTERM_MAXIMUM, "shortterm maximum", "shortterm-maximum", "shortterm maximum", bg_print_conf_shortterm_maximum, "%.2f", bg_print_conf_shortterm_maximum_relative, "%.2f"), BG_CONF1(BG_FLAGS_AGG_SHORTTERM_RANGE, #if defined (BG_UNIT_LRA) // [ "shortterm loudness range", "shortterm-range", "shortterm range", #else // ] [ "shortterm lra", "shortterm-lra", "shortterm lra", #endif // ] bg_print_conf_shortterm_range, #if 1 // [ "%.2f" #else "%f" #endif // ] ), BG_CONF2(BG_FLAGS_AGG_SAMPLEPEAK, "sample peak", "sample-peak", "sample peak", bg_print_conf_samplepeak_relative, "%.2f", bg_print_conf_samplepeak_absolute, "%f"), BG_CONF2(BG_FLAGS_AGG_TRUEPEAK, "true peak", "true-peak", "true peak", bg_print_conf_truepeak_relative, "%.2f", bg_print_conf_truepeak_absolute, "%f"), }; #if defined (_WIN32) // [ void bg_print_conf_unitw(FILE *f, int lc FFUNUSED, bg_print_conf_t *c, bg_param_t *param, int argv) { const wchar_t *unit; if (stdout==f||stderr==f) { DMESSAGE("writing to consule"); return; } switch (c-bg_print_conf) { case BG_FLAGS_AGG_MOMENTARY_MEAN_OFFSET: unit=param->unit->w.lu; break; case BG_FLAGS_AGG_MOMENTARY_MAXIMUM_OFFSET: unit=param->unit->w.lu; break; case BG_FLAGS_AGG_MOMENTARY_RANGE_OFFSET: unit=param->unit->w.lra; break; case BG_FLAGS_AGG_SHORTTERM_MEAN_OFFSET: unit=param->unit->w.lu; break; case BG_FLAGS_AGG_SHORTTERM_MAXIMUM_OFFSET: unit=param->unit->w.lu; break; case BG_FLAGS_AGG_SHORTTERM_RANGE_OFFSET: unit=param->unit->w.lra; break; case BG_FLAGS_AGG_SAMPLEPEAK_OFFSET: unit=param->unit->w.sp; break; case BG_FLAGS_AGG_TRUEPEAK_OFFSET: unit=param->unit->w.tp; break; default: DMESSAGE("out of range"); return; } switch (c-bg_print_conf) { case BG_FLAGS_AGG_MOMENTARY_MEAN_OFFSET: case BG_FLAGS_AGG_MOMENTARY_MAXIMUM_OFFSET: case BG_FLAGS_AGG_SHORTTERM_MEAN_OFFSET: case BG_FLAGS_AGG_SHORTTERM_MAXIMUM_OFFSET: if (lc) { while (*unit) fputwc(towlower(*unit++),f); if (!argv) fputws(L"fs",f); } else { fputws(unit,f); if (!argv) fputws(L"FS",f); } break; case BG_FLAGS_AGG_MOMENTARY_RANGE_OFFSET: case BG_FLAGS_AGG_SHORTTERM_RANGE_OFFSET: if (lc) { while (*unit) fputwc(towlower(*unit++),f); } else fputws(unit,f); break; case BG_FLAGS_AGG_SAMPLEPEAK_OFFSET: case BG_FLAGS_AGG_TRUEPEAK_OFFSET: if (0unit->n.lu; break; case BG_FLAGS_AGG_MOMENTARY_MAXIMUM_OFFSET: unit=param->unit->n.lu; break; case BG_FLAGS_AGG_MOMENTARY_RANGE_OFFSET: unit=param->unit->n.lra; break; case BG_FLAGS_AGG_SHORTTERM_MEAN_OFFSET: unit=param->unit->n.lu; break; case BG_FLAGS_AGG_SHORTTERM_MAXIMUM_OFFSET: unit=param->unit->n.lu; break; case BG_FLAGS_AGG_SHORTTERM_RANGE_OFFSET: unit=param->unit->n.lra; break; case BG_FLAGS_AGG_SAMPLEPEAK_OFFSET: unit=param->unit->n.sp; break; case BG_FLAGS_AGG_TRUEPEAK_OFFSET: unit=param->unit->n.tp; break; default: DMESSAGE("out of range"); return; } switch (c-bg_print_conf) { case BG_FLAGS_AGG_MOMENTARY_MEAN_OFFSET: case BG_FLAGS_AGG_MOMENTARY_MAXIMUM_OFFSET: case BG_FLAGS_AGG_SHORTTERM_MEAN_OFFSET: case BG_FLAGS_AGG_SHORTTERM_MAXIMUM_OFFSET: if (lc) { while (*unit) fputc(tolower(*unit++),f); if (!argv) fputs("fs",f); } else { fputs(unit,f); if (!argv) fputs("FS",f); } break; case BG_FLAGS_AGG_MOMENTARY_RANGE_OFFSET: case BG_FLAGS_AGG_SHORTTERM_RANGE_OFFSET: if (lc) { while (*unit) fputc(tolower(*unit++),f); } else fputs(unit,f); break; case BG_FLAGS_AGG_SAMPLEPEAK_OFFSET: case BG_FLAGS_AGG_TRUEPEAK_OFFSET: if (0&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = bs1770gain$(EXEEXT) noinst_PROGRAMS = $(am__EXEEXT_1) #noinst_PROGRAMS+=pilot #pilot_SOURCES= #pilot_SOURCES+=bg.h #pilot_SOURCES+=bg_pilot.h #pilot_SOURCES+=$(top_srcdir)/libff/ff.h #pilot_SOURCES+=pilot.c #pilot_LDADD= #pilot_LDADD+=libbg.a #pilot_LDADD+=$(top_builddir)/libff/libff.a #pilot_LDADD+=$(top_builddir)/lib1770-2/lib1770_2.a #pilot_LDADD+=$(top_builddir)/libpbutil/libpbutil.a @FF_DYNLOAD_TRUE@am__append_1 = bg_version subdir = libbg ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @FF_DYNLOAD_TRUE@am__EXEEXT_1 = bg_version$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libbg_a_AR = $(AR) $(ARFLAGS) libbg_a_LIBADD = am__objects_1 = am_libbg_a_OBJECTS = $(am__objects_1) bg_process.$(OBJEXT) \ bg_sync.$(OBJEXT) bg_utf8_iter.$(OBJEXT) \ bg_threads_helper.$(OBJEXT) bg_param_threads.$(OBJEXT) \ bg_param.$(OBJEXT) bg_print_conf.$(OBJEXT) \ bg_print_csv.$(OBJEXT) bg_print_xml.$(OBJEXT) \ bg_print_classic.$(OBJEXT) bg_annotator.$(OBJEXT) \ bg_muxer.$(OBJEXT) bg_analyzer.$(OBJEXT) bg_tree.$(OBJEXT) \ bg_tree_path.$(OBJEXT) bg_file.$(OBJEXT) bg_track.$(OBJEXT) \ bg_track_target.$(OBJEXT) bg_tree_patha.$(OBJEXT) \ bg_album.$(OBJEXT) bg_root.$(OBJEXT) bg_pilot_branch.$(OBJEXT) \ bg_pilot_leaf.$(OBJEXT) bg_pilot.$(OBJEXT) \ bg_basenamea.$(OBJEXT) bg_basename.$(OBJEXT) \ bg_wcs2str.$(OBJEXT) bg_pathnorm.$(OBJEXT) \ bg_parse_time.$(OBJEXT) bg_char_nexta.$(OBJEXT) libbg_a_OBJECTS = $(am_libbg_a_OBJECTS) am__bg_version_SOURCES_DIST = bg_version.c @FF_DYNLOAD_TRUE@am_bg_version_OBJECTS = bg_version.$(OBJEXT) bg_version_OBJECTS = $(am_bg_version_OBJECTS) bg_version_LDADD = $(LDADD) am_bs1770gain_OBJECTS = bgx.$(OBJEXT) nodist_bs1770gain_OBJECTS = bs1770gain_OBJECTS = $(am_bs1770gain_OBJECTS) \ $(nodist_bs1770gain_OBJECTS) bs1770gain_DEPENDENCIES = libbg.a $(top_builddir)/libff/libff.a \ $(top_builddir)/lib1770-2/lib1770_2.a \ $(top_builddir)/libpbutil/libpbutil.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/bg_album.Po \ ./$(DEPDIR)/bg_analyzer.Po ./$(DEPDIR)/bg_annotator.Po \ ./$(DEPDIR)/bg_basename.Po ./$(DEPDIR)/bg_basenamea.Po \ ./$(DEPDIR)/bg_char_nexta.Po ./$(DEPDIR)/bg_file.Po \ ./$(DEPDIR)/bg_muxer.Po ./$(DEPDIR)/bg_param.Po \ ./$(DEPDIR)/bg_param_threads.Po ./$(DEPDIR)/bg_parse_time.Po \ ./$(DEPDIR)/bg_pathnorm.Po ./$(DEPDIR)/bg_pilot.Po \ ./$(DEPDIR)/bg_pilot_branch.Po ./$(DEPDIR)/bg_pilot_leaf.Po \ ./$(DEPDIR)/bg_print_classic.Po ./$(DEPDIR)/bg_print_conf.Po \ ./$(DEPDIR)/bg_print_csv.Po ./$(DEPDIR)/bg_print_xml.Po \ ./$(DEPDIR)/bg_process.Po ./$(DEPDIR)/bg_root.Po \ ./$(DEPDIR)/bg_sync.Po ./$(DEPDIR)/bg_threads_helper.Po \ ./$(DEPDIR)/bg_track.Po ./$(DEPDIR)/bg_track_target.Po \ ./$(DEPDIR)/bg_tree.Po ./$(DEPDIR)/bg_tree_path.Po \ ./$(DEPDIR)/bg_tree_patha.Po ./$(DEPDIR)/bg_utf8_iter.Po \ ./$(DEPDIR)/bg_version.Po ./$(DEPDIR)/bg_wcs2str.Po \ ./$(DEPDIR)/bgx.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbg_a_SOURCES) $(bg_version_SOURCES) \ $(bs1770gain_SOURCES) $(nodist_bs1770gain_SOURCES) DIST_SOURCES = $(libbg_a_SOURCES) $(am__bg_version_SOURCES_DIST) \ $(bs1770gain_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AVCODEC_SO = @AVCODEC_SO@ AVFILTER_SO = @AVFILTER_SO@ AVFORMAT_SO = @AVFORMAT_SO@ AVUTIL_SO = @AVUTIL_SO@ AWK = @AWK@ BS1770GAIN_LDFLAGS = @BS1770GAIN_LDFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FFMPEG_PREFIX = @FFMPEG_PREFIX@ FF_AVCODEC_V = @FF_AVCODEC_V@ FF_AVFILTER_V = @FF_AVFILTER_V@ FF_AVFORMAT_V = @FF_AVFORMAT_V@ FF_AVUTIL_V = @FF_AVUTIL_V@ FF_POSTPROC_V = @FF_POSTPROC_V@ FF_SWRESAMPLE_V = @FF_SWRESAMPLE_V@ FF_SWSCALE_V = @FF_SWSCALE_V@ GETOPTW_PREFIX = @GETOPTW_PREFIX@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSTPROC_SO = @POSTPROC_SO@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SODIR = @SODIR@ STRIP = @STRIP@ SWRESAMPLE_SO = @SWRESAMPLE_SO@ SWSCALE_SO = @SWSCALE_SO@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #AM_CPPFLAGS+=-g AM_CPPFLAGS = -I$(top_srcdir)/libpbutil -I$(top_srcdir)/libff \ -I$(top_srcdir)/lib1770-2 bs1770gain_SOURCES = bgx.c #bs1770gain_LDFLAGS= #bs1770gain_LDFLAGS+=-g bs1770gain_LDADD = libbg.a $(top_builddir)/libff/libff.a \ $(top_builddir)/lib1770-2/lib1770_2.a \ $(top_builddir)/libpbutil/libpbutil.a @FF_DYNLOAD_TRUE@nodist_bs1770gain_SOURCES = bg_version.h @FF_DYNLOAD_TRUE@bg_version_SOURCES = bg_version.c noinst_LIBRARIES = libbg.a libbg_a_SOURCES = $(CONFIG_HEADER) bg.h bg_pilot.h \ $(top_srcdir)/libff/ff.h $(top_srcdir)/lib1770-2/lib1770.h \ $(top_srcdir)/libpbutil/pbutil.h \ $(top_srcdir)/libpbutil/pbutil_priv.h bg_process.c bg_sync.c \ bg_utf8_iter.c bg_threads_helper.c bg_param_threads.c \ bg_param.c bg_print_conf.c bg_print_csv.c bg_print_xml.c \ bg_print_classic.c bg_annotator.c bg_muxer.c bg_analyzer.c \ bg_tree.c bg_tree_path.c bg_file.c bg_track.c \ bg_track_target.c bg_tree_patha.c bg_album.c bg_root.c \ bg_pilot_branch.c bg_pilot_leaf.c bg_pilot.c bg_basenamea.c \ bg_basename.c bg_wcs2str.c bg_pathnorm.c bg_parse_time.c \ bg_char_nexta.c # https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html @FF_DYNLOAD_TRUE@BUILT_SOURCES = bg_version.h @FF_DYNLOAD_TRUE@CLEANFILES = bg_version.h all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libbg/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libbg/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libbg.a: $(libbg_a_OBJECTS) $(libbg_a_DEPENDENCIES) $(EXTRA_libbg_a_DEPENDENCIES) $(AM_V_at)-rm -f libbg.a $(AM_V_AR)$(libbg_a_AR) libbg.a $(libbg_a_OBJECTS) $(libbg_a_LIBADD) $(AM_V_at)$(RANLIB) libbg.a bg_version$(EXEEXT): $(bg_version_OBJECTS) $(bg_version_DEPENDENCIES) $(EXTRA_bg_version_DEPENDENCIES) @rm -f bg_version$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bg_version_OBJECTS) $(bg_version_LDADD) $(LIBS) bs1770gain$(EXEEXT): $(bs1770gain_OBJECTS) $(bs1770gain_DEPENDENCIES) $(EXTRA_bs1770gain_DEPENDENCIES) @rm -f bs1770gain$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bs1770gain_OBJECTS) $(bs1770gain_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_album.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_analyzer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_annotator.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_basename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_basenamea.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_char_nexta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_muxer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_param.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_param_threads.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_parse_time.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_pathnorm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_pilot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_pilot_branch.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_pilot_leaf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_print_classic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_print_conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_print_csv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_print_xml.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_process.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_root.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_sync.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_threads_helper.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_track.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_track_target.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_tree.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_tree_path.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_tree_patha.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_utf8_iter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_version.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bg_wcs2str.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bgx.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(LIBRARIES) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/bg_album.Po -rm -f ./$(DEPDIR)/bg_analyzer.Po -rm -f ./$(DEPDIR)/bg_annotator.Po -rm -f ./$(DEPDIR)/bg_basename.Po -rm -f ./$(DEPDIR)/bg_basenamea.Po -rm -f ./$(DEPDIR)/bg_char_nexta.Po -rm -f ./$(DEPDIR)/bg_file.Po -rm -f ./$(DEPDIR)/bg_muxer.Po -rm -f ./$(DEPDIR)/bg_param.Po -rm -f ./$(DEPDIR)/bg_param_threads.Po -rm -f ./$(DEPDIR)/bg_parse_time.Po -rm -f ./$(DEPDIR)/bg_pathnorm.Po -rm -f ./$(DEPDIR)/bg_pilot.Po -rm -f ./$(DEPDIR)/bg_pilot_branch.Po -rm -f ./$(DEPDIR)/bg_pilot_leaf.Po -rm -f ./$(DEPDIR)/bg_print_classic.Po -rm -f ./$(DEPDIR)/bg_print_conf.Po -rm -f ./$(DEPDIR)/bg_print_csv.Po -rm -f ./$(DEPDIR)/bg_print_xml.Po -rm -f ./$(DEPDIR)/bg_process.Po -rm -f ./$(DEPDIR)/bg_root.Po -rm -f ./$(DEPDIR)/bg_sync.Po -rm -f ./$(DEPDIR)/bg_threads_helper.Po -rm -f ./$(DEPDIR)/bg_track.Po -rm -f ./$(DEPDIR)/bg_track_target.Po -rm -f ./$(DEPDIR)/bg_tree.Po -rm -f ./$(DEPDIR)/bg_tree_path.Po -rm -f ./$(DEPDIR)/bg_tree_patha.Po -rm -f ./$(DEPDIR)/bg_utf8_iter.Po -rm -f ./$(DEPDIR)/bg_version.Po -rm -f ./$(DEPDIR)/bg_wcs2str.Po -rm -f ./$(DEPDIR)/bgx.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/bg_album.Po -rm -f ./$(DEPDIR)/bg_analyzer.Po -rm -f ./$(DEPDIR)/bg_annotator.Po -rm -f ./$(DEPDIR)/bg_basename.Po -rm -f ./$(DEPDIR)/bg_basenamea.Po -rm -f ./$(DEPDIR)/bg_char_nexta.Po -rm -f ./$(DEPDIR)/bg_file.Po -rm -f ./$(DEPDIR)/bg_muxer.Po -rm -f ./$(DEPDIR)/bg_param.Po -rm -f ./$(DEPDIR)/bg_param_threads.Po -rm -f ./$(DEPDIR)/bg_parse_time.Po -rm -f ./$(DEPDIR)/bg_pathnorm.Po -rm -f ./$(DEPDIR)/bg_pilot.Po -rm -f ./$(DEPDIR)/bg_pilot_branch.Po -rm -f ./$(DEPDIR)/bg_pilot_leaf.Po -rm -f ./$(DEPDIR)/bg_print_classic.Po -rm -f ./$(DEPDIR)/bg_print_conf.Po -rm -f ./$(DEPDIR)/bg_print_csv.Po -rm -f ./$(DEPDIR)/bg_print_xml.Po -rm -f ./$(DEPDIR)/bg_process.Po -rm -f ./$(DEPDIR)/bg_root.Po -rm -f ./$(DEPDIR)/bg_sync.Po -rm -f ./$(DEPDIR)/bg_threads_helper.Po -rm -f ./$(DEPDIR)/bg_track.Po -rm -f ./$(DEPDIR)/bg_track_target.Po -rm -f ./$(DEPDIR)/bg_tree.Po -rm -f ./$(DEPDIR)/bg_tree_path.Po -rm -f ./$(DEPDIR)/bg_tree_patha.Po -rm -f ./$(DEPDIR)/bg_utf8_iter.Po -rm -f ./$(DEPDIR)/bg_version.Po -rm -f ./$(DEPDIR)/bg_wcs2str.Po -rm -f ./$(DEPDIR)/bgx.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile @FF_DYNLOAD_TRUE@bg_version.h: bg_version @FF_DYNLOAD_TRUE@ ./$< > ./$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bs1770gain-0.9.8/libbg/bg_print_classic.c0000755000175000017500000001643115035710477015004 00000000000000/* * bg_print_classic.c * * Copyright (C) 2014 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include static void bg_print_classic_indent(FILE *f, int width) { enum { SIZE=128 }; union { #if defined (_WIN32) // [ // wide string representation. wchar_t w[SIZE]; #endif // ] // narrow string representation. char n[SIZE]; } format; width+=2; // indentation. #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { _snwprintf(format.w,SIZE,L"%%%ds",width); fwprintf(f,format.w,L""); } else { #endif // ] snprintf(format.n,SIZE,"%%%ds",width); fprintf(f,format.n,""); #if defined (_WIN32) // [ } #endif // ] } static void bg_print_conf_tail(bg_print_conf_t *c, bg_tree_t *tree FFUNUSED, int width FFUNUSED, FILE *f FFUNUSED) { switch (c->argc) { case 1: if (c->argv[0].fn) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_classic_indent(f,width-wcslen(c->w.label.classic)); fwprintf(f,L"%S: ",c->w.label.classic); fwprintf(f,c->argv[0].w.format,c->argv[0].fn(tree)); fputwc(L' ',f); bg_print_conf_unitw(f,0,c,tree->param,0); fputwc(L'\n',f); } else { #endif // ] bg_print_classic_indent(f,width-strlen(c->n.label.classic)); fprintf(f,"%s: ",c->n.label.classic); fprintf(f,c->argv[0].n.format,c->argv[0].fn(tree)); fputc(' ',f); bg_print_conf_unit(f,0,c,tree->param,0); fputc('\n',f); #if defined (_WIN32) // [ } #endif // ] } else _DWARNING("argv[0]"); break; case 2: if (c->argv[0].fn&&c->argv[1].fn) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_classic_indent(f,width-wcslen(c->w.label.classic)); fwprintf(f,L"%S: ",c->w.label); fwprintf(f,c->argv[0].w.format,c->argv[0].fn(tree)); fputwc(L' ',f); bg_print_conf_unitw(f,0,c,tree->param,0); fwprintf(f,L" / "); fwprintf(f,c->argv[1].w.format,c->argv[1].fn(tree)); fputwc(L' ',f); bg_print_conf_unitw(f,0,c,tree->param,1); fputwc(L'\n',f); } else { #endif // ] bg_print_classic_indent(f,width-strlen(c->n.label.classic)); fprintf(f,"%s: ",c->n.label.classic); fprintf(f,c->argv[0].n.format,c->argv[0].fn(tree)); fputc(' ',f); bg_print_conf_unit(f,0,c,tree->param,0); fprintf(f," / "); fprintf(f,c->argv[1].n.format,c->argv[1].fn(tree)); fputc(' ',f); bg_print_conf_unit(f,0,c,tree->param,1); fputc('\n',f); #if defined (_WIN32) // [ } #endif // ] fflush(f); } else _DWARNING("argv[0]/argv[1]"); break; default: _DWARNING("argc"); break; } } /////////////////////////////////////////////////////////////////////////////// static void bg_print_classic_encoding(bg_param_t *param, int bits) { param->result.bits=bits; } static int bg_print_conf_len(bg_print_conf_t *c, FILE *f FFUNUSED) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) return wcslen(c->w.label.classic); else #endif // ] return strlen(c->n.label.classic); } static int bg_print_classic_width(bg_tree_t *tree, FILE *f) { // path 1: determine the maximum length of the involved labels. int width=-1; bg_flags_agg_t agg; bg_print_conf_t *c; int len; for (agg=1,c=bg_print_conf;aggparam->flags.aggregate)) { // this aggregation isn't involved. continue; } else if (agg!=c->agg) { // wrong order. _DWARNING("aggregate mismatch"); continue; } else if ((len=bg_print_conf_len(c,f))<0) { _DWARNING("getting length"); continue; } else if (widthparam->quiet) goto success; #endif // ] switch (tree->vmt->type) { case BG_TREE_TYPE_FILE: // nothing to do. break; case BG_TREE_TYPE_TRACK: track=&tree->track; #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { fwprintf(f,L"[%lu/%lu] %S\n",track->root.id,tree->param->count.max, tree->source.basename); } else { #endif // ] fprintf(f,"[%lu/%lu] %s\n",track->root.id,tree->param->count.max, bg_tree_in_basename(tree)); #if defined (_WIN32) // [ } #endif // ] break; case BG_TREE_TYPE_ALBUM: if (!tree->param->suppress.hierarchy) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) fwprintf(f,L"[ALBUM] %S\n",tree->source.basename); else #endif // ] fprintf(f,"[ALBUM] %s\n",bg_tree_in_basename(tree)); } break; case BG_TREE_TYPE_ROOT: if (!tree->param->suppress.hierarchy) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) fwprintf(f,L"[COLLECTION]\n"); else #endif // ] fprintf(f,"[COLLECTION]\n"); } break; default: _DMESSAGEV("tree type %d unexpected",tree->vmt->type); goto e_type; } ///////////////////////////////////////////////////////////////////////////// fflush(f); #if defined (BG_PARAM_QUIET) // [ success: #endif // ] return 0; e_type: return -1; } static int bg_print_classic_tail(bg_tree_t *tree, int depth FFUNUSED, FILE *f) { int suppress_hierarchy=tree->param->suppress.hierarchy; // path 1: determine the maximum length of the involved labels. int width=bg_print_classic_width(tree,f); // path 2: print out the results aligned according to the maximum length // of the involved labels. bg_flags_agg_t agg; bg_print_conf_t *c; #if defined (BG_PARAM_QUIET) // [ if (tree->param->quiet) goto success; #endif // ] if (width<=0) { _DWARNING("width"); goto e_width; } if (!suppress_hierarchy||BG_TREE_TYPE_TRACK==tree->vmt->type) { for (agg=1,c=bg_print_conf;aggparam->flags.aggregate)) { // the aggregation isn't involved. continue; } else if (agg!=c->agg) { // wrong order. _DWARNING("aggregate mismatch"); continue; } else bg_print_conf_tail(c,tree,width,f); } } ///////////////////////////////////////////////////////////////////////////// fflush(f); #if defined (BG_PARAM_QUIET) // [ success: #endif // ] return 0; e_width: return -1; } bg_print_vmt_t bg_print_classic_vmt={ .id="classic", .infix=0, .encoding=bg_print_classic_encoding, .head=bg_print_classic_head, .tail=bg_print_classic_tail, }; bs1770gain-0.9.8/libbg/bg_pilot_leaf.c0000755000175000017500000000466115035710477014267 00000000000000/* * bg_pivot_leaf.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// static bg_pilot_hist_vmt_t bg_pilot_hist_leaf_vmt; /////////////////////////////////////////////////////////////////////////////// int bg_pilot_hist_leaf_create(bg_pilot_hist_t *hist) { bg_pilot_client_t *client=&hist->pilot->client; ///////////////////////////////////////////////////////////////////////////// hist->vmt=&bg_pilot_hist_leaf_vmt; ///////////////////////////////////////////////////////////////////////////// if (client->cb&&client->cb->leaf.enter) { if (client->cb->leaf.enter(hist,client->data)<0) { _DMESSAGE("entering leaf"); goto e_enter; } } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: e_enter: return -1; } static void bg_pilot_hist_leaf_destroy(bg_pilot_hist_t *hist FFUNUSED) { bg_pilot_client_t *client=&hist->pilot->client; if (client->cb&&client->cb->leaf.leave) client->cb->leaf.leave(hist,client->data); } /////////////////////////////////////////////////////////////////////////////// static const ffchar_t *bg_pilot_hist_leaf_first(bg_pilot_hist_t *hist FFUNUSED) { return NULL; } static const ffchar_t *bg_pilot_hist_leaf_next(bg_pilot_hist_t *hist FFUNUSED) { return NULL; } /////////////////////////////////////////////////////////////////////////////// static bg_pilot_hist_vmt_t bg_pilot_hist_leaf_vmt={ #if defined (PBU_DEBUG) // [ .id="leaf", #endif // ] .destroy=bg_pilot_hist_leaf_destroy, .first=bg_pilot_hist_leaf_first, .next=bg_pilot_hist_leaf_next, }; bs1770gain-0.9.8/libbg/bg_track_target.c0000755000175000017500000000155415035710477014621 00000000000000/* * bg_track_target.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include bs1770gain-0.9.8/libbg/bg_root.c0000755000175000017500000000462115035710477013130 00000000000000/* * bg_root.h * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include /////////////////////////////////////////////////////////////////////////////// static bg_tree_vmt_t bg_root_vmt; int bg_root_create(bg_tree_t *tree, bg_param_t *param) { ///////////////////////////////////////////////////////////////////////////// if (bg_tree_common_create(tree,param,NULL,NULL)<0) { _DMESSAGE("creating tree"); goto e_common; } ///////////////////////////////////////////////////////////////////////////// if (bg_album_content_create(tree,&bg_root_vmt)<0) { _DMESSAGE("creating content"); goto e_content; } ///////////////////////////////////////////////////////////////////////////// return 0; //cleanup: bg_album_content_destroy(tree); e_content: bg_tree_common_destroy(tree); e_common: return -1; } /////////////////////////////////////////////////////////////////////////////// static void bg_root_destroy(bg_tree_t *tree) { bg_album_content_destroy(tree); bg_tree_common_destroy(tree); } static int bg_root_accept(bg_tree_t *tree, bg_visitor_t *vis) { return vis->vmt->dispatch_root(vis,tree); } #if defined (BG_TRACK_ID) // [ static void bg_root_track_id(bg_tree_t *tree FFUNUSED, int *id FFUNUSED) { } #endif // ] static bg_tree_vmt_t bg_root_vmt={ #if defined (PBU_MESSAGE_AV_LOG) // [ .id="root", #else // ] [ .id=FFL("root"), #endif // ] .type=BG_TREE_TYPE_ROOT, .destroy=bg_root_destroy, .accept=bg_root_accept, .annotation={ .create=bg_root_annotation_create, .destroy=bg_root_annotation_destroy, }, #if defined (BG_TRACK_ID) // [ .track_id=bg_root_track_id, #endif // ] }; bs1770gain-0.9.8/libbg/bg_print_xml.c0000755000175000017500000002654415035710477014171 00000000000000/* * bs1770gain_print_xml.c * * Copyright (C) 2014 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if ! defined (_WIN32) // [ #include #endif // ] #if defined (HAVE_BG_XML) // [ #if defined (BG_ESCAPE_XML) // [ #if defined (_WIN32) // [ static void bg_print_xml_stringw(const wchar_t *str, FILE *f) { fputwc(L'"',f); while (*str) { switch (*str) { case L'"': fputws(L""",f); break; case L'&': fputws(L"&",f); break; case L'\'': fputws(L"'",f); break; case L'<': fputws(L"<",f); break; case L'>': fputws(L">",f); break; default: fputwc(*str,f); break; } ++str; } fputwc(L'"',f); } #endif // ] #define BG_ESCAPE_PREDEFINED static void bg_print_xml_string(const char *str, FILE *f) { #if ! defined (BG_ESCAPE_PREDEFINED) // [ const char *next; #endif // ] fputc('"',f); while (*str) { #if defined (BG_ESCAPE_PREDEFINED) // [ switch (*str) { case '"': fputs(""",f); break; case '&': fputs("&",f); break; case '\'': fputs("'",f); break; case '<': fputs("<",f); break; case '>': fputs(">",f); break; default: fputc(*str,f); break; } str=bg_char_nexta(str); #else // ] [ next=bg_char_nexta(str); while (strresult.f; param->result.bits=bits; #if defined (BG_PARAM_QUIET) // [ if (param->quiet) goto success; #endif // ] #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { fwprintf(f,L"\n",bits); } else { #endif // ] fprintf(f,"\n",bits); #if defined (_WIN32) // [ } #endif // ] #if defined (BG_PARAM_QUIET) // [ success: return; #endif // ] } #if defined (_WIN32) // [ static void bg_print_xml_indentw(int depth, FILE *f) { --depth; if (stdout==f||stderr==f) { _DMESSAGE("illegal attempt to write to the console"); exit(1); } while (0param; bg_track_t *track=&tree->track; #if defined (BG_PARAM_QUIET) // [ if (tree->param->quiet) goto success; #endif // ] switch (tree->vmt->type) { case BG_TREE_TYPE_TRACK: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); #if defined (BG_PARAM_XML_CDATA) // [ if (param->xml.cdata) { fwprintf(f,L"\n", param->count.max); bg_print_xml_indentw(depth+1,f); fwprintf(f,L"\n",tree->source.basename); } else { #endif // ] #if defined (BG_ESCAPE_XML) // [ fwprintf(f,L"count.max,track->root.id); bg_print_xml_stringw(tree->source.basename,f); fwprintf(f,L">\n"); #else // ] [ fwprintf(f,L"\n", param->count.max,track->root.id,tree->source.basename); #endif // ] #if defined (BG_PARAM_XML_CDATA) // [ } #endif // ] } else { #endif // ] #if defined (BG_PARAM_XML_CDATA) // [ bg_print_xml_indent(depth,f); if (param->xml.cdata) { fprintf(f,"\n", param->count.max,track->root.id); bg_print_xml_indent(depth+1,f); fprintf(f,"\n",bg_tree_in_basename(tree)); } else { #endif // ] #if defined (BG_ESCAPE_XML) // [ fprintf(f,"\n"); #else // ] [ fprintf(f,"\n", param->count.max,track->root.id,bg_tree_in_basename(tree)); #endif // ] #if defined (BG_PARAM_XML_CDATA) // [ } #endif // ] #if defined (_WIN32) // [ } #endif // ] break; case BG_TREE_TYPE_ALBUM: #if 0 // [ if (!param->suppress.hierarchy) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"\n",tree->source.basename); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"\n",bg_tree_in_basename(tree)); #if defined (_WIN32) // [ } #endif // ] } #else // ] [ if (!param->suppress.hierarchy) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); #if defined (BG_PARAM_XML_CDATA) // [ if (param->xml.cdata) { fwprintf(f,L"\n"); bg_print_xml_indentw(depth+1,f); fwprintf(f,L"\n",tree->source.basename); } else { #endif // ] fwprintf(f,L"\n",tree->source.basename); #if defined (BG_PARAM_XML_CDATA) // [ } #endif // ] } else { #endif // ] #if defined (BG_PARAM_XML_CDATA) // [ bg_print_xml_indent(depth,f); if (param->xml.cdata) { fprintf(f,"\n"); bg_print_xml_indent(depth+1,f); fprintf(f,"\n", bg_tree_in_basename(tree)); } else { #endif // ] #if defined (BG_ESCAPE_XML) // [ fprintf(f,"\n"); #else // ] [ fprintf(f,"\n",bg_tree_in_basename(tree)); #endif // ] #if defined (BG_PARAM_XML_CDATA) // [ } #endif // ] #if defined (_WIN32) // [ } #endif // ] } #endif // ] break; case BG_TREE_TYPE_ROOT: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"\n",param->norm); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"\n",param->norm); #if defined (_WIN32) // [ } #endif // ] break; default: _DMESSAGE("unknown type"); goto e_type; } ///////////////////////////////////////////////////////////////////////////// fflush(f); #if defined (BG_PARAM_QUIET) // [ success: #endif // ] return 0; //cleanup: e_type: return -1; } static void bg_print_conf_tail(bg_print_conf_t *c, bg_tree_t *tree, int depth, FILE *f) { switch (c->argc) { case 1: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"<%S ",c->w.label.xml); bg_print_conf_unitw(f,1,c,tree->param,0); fwprintf(f,L"=\""); fwprintf(f,c->argv[0].w.format,c->argv[0].fn(tree)); #if defined (BG_SERGEY_XML_FIX) // [ fwprintf(f,L"\"/>\n"); #endif // ] } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"<%s ",c->n.label.xml); bg_print_conf_unit(f,1,c,tree->param,0); fprintf(f,"=\""); fprintf(f,c->argv[0].n.format,c->argv[0].fn(tree)); #if defined (BG_SERGEY_XML_FIX) // [ fprintf(f,"\"/>\n"); #endif // ] #if defined (_WIN32) // [ } #endif // ] break; case 2: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"<%S ",c->w.label.xml); bg_print_conf_unitw(f,1,c,tree->param,0); fwprintf(f,L"=\""); fwprintf(f,c->argv[0].w.format,c->argv[0].fn(tree)); fwprintf(f,L"\" "); bg_print_conf_unitw(f,1,c,tree->param,1); fwprintf(f,L"=\""); fwprintf(f,c->argv[1].w.format,c->argv[1].fn(tree)); fwprintf(f,L"\"/>\n"); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"<%s ",c->n.label.xml); bg_print_conf_unit(f,1,c,tree->param,0); fprintf(f,"=\""); fprintf(f,c->argv[0].n.format,c->argv[0].fn(tree)); fprintf(f,"\" "); bg_print_conf_unit(f,1,c,tree->param,1); fprintf(f,"=\""); fprintf(f,c->argv[1].n.format,c->argv[1].fn(tree)); fprintf(f,"\"/>\n"); #if defined (_WIN32) // [ } #endif // ] break; default: _DWARNINGV("argc:%d",c->argc); break; } } static int bg_print_xml_tail(bg_tree_t *tree, int depth, FILE *f) { bg_param_t *param=tree->param; bg_flags_agg_t agg; bg_print_conf_t *c; #if defined (BG_PARAM_QUIET) // [ if (param->quiet) goto success; #endif // ] if (BG_TREE_TYPE_TRACK==tree->vmt->type||!param->suppress.hierarchy) { for (agg=1,c=bg_print_conf;aggparam->flags.aggregate)) { // this aggregation isn't involved. continue; } else if (agg!=c->agg) { // wrong order. _DWARNING("aggregate mismatch"); continue; } else bg_print_conf_tail(c,tree,depth+1,f); } } switch (tree->vmt->type) { case BG_TREE_TYPE_TRACK: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"\n"); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"\n"); #if defined (_WIN32) // [ } #endif // ] break; case BG_TREE_TYPE_ALBUM: if (!param->suppress.hierarchy) { #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"\n"); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"\n"); } #if defined (_WIN32) // [ } #endif // ] break; case BG_TREE_TYPE_ROOT: #if defined (_WIN32) // [ if (stdout!=f&&stderr!=f) { bg_print_xml_indentw(depth,f); fwprintf(f,L"\n"); } else { #endif // ] bg_print_xml_indent(depth,f); fprintf(f,"\n"); #if defined (_WIN32) // [ } #endif // ] break; default: _DMESSAGE("unknown type"); goto e_type; } ///////////////////////////////////////////////////////////////////////////// fflush(f); #if defined (BG_PARAM_QUIET) // [ success: #endif // ] return 0; //cleanup: e_type: return -1; } bg_print_vmt_t bg_print_xml_vmt={ .id="xml", .infix=1, .encoding=bg_print_xml_encoding, .head=bg_print_xml_head, .tail=bg_print_xml_tail, }; #endif // ] bs1770gain-0.9.8/libbg/bg_char_nexta.c0000755000175000017500000000311015035710477014251 00000000000000/* * charnexta.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if defined (BG_CHAR_NEXTA) // [ enum { // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". MASK_ONE_BYTE=~(1u<<7u), MASK_TWO_BYTES=~(1u<<5u), MASK_THREE_BYTES=~(1u<<4u), MASK_FOUR_BYTES=~(1u<<3u), }; const char *bg_char_nexta(const char *str) { if (*(const uint8_t *)str==(MASK_ONE_BYTE&*(const uint8_t *)str)) return str+1; else if (*(const uint8_t *)str==(MASK_TWO_BYTES&*(const uint8_t *)str)) return str+2; else if (*(const uint8_t *)str==(MASK_THREE_BYTES&*(const uint8_t *)str)) return str+3; else if (*(const uint8_t *)str==(MASK_FOUR_BYTES&*(const uint8_t *)str)) return str+4; else { _DMESSAGEV("unexpected byte: %02x",*str); exit(1); return NULL; } } #endif // ] bs1770gain-0.9.8/libbg/bg_version.c0000755000175000017500000000734715035710477013642 00000000000000/* * bg_version.c * * Copyright (C) 2014-2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ /* * Explore some constants at compile time and make them available at runtime. */ #if defined (__GNUC__) // [ #define UNUSED __attribute__((__unused__)) #else // ] [ #define UNUSED #endif // ] #define BG_COMMAND #if defined (_WIN32) // [ #include #include int wmain(int argc UNUSED, wchar_t *const *argv UNUSED) #else // ] [ #include #if defined (__linux__) && defined (__GNUC__) // [ #include #endif // ] #include #include #include #if defined (BG_COMMAND) && defined (__GNUC__) // [ char *bg_command(const char *command,char *buf, size_t size) { char *bp=buf; FILE *p=popen(command,"r"); for (;;) { int count=fread(buf,1,size,p); if (0 * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if defined (_WIN32) // [ #include #else // ] [ #include #include #include #include #endif // ] #include /////////////////////////////////////////////////////////////////////////////// static ff_output_callback_t bg_output_callback; static bg_visitor_vmt_t bg_muxer_vmt; /////////////////////////////////////////////////////////////////////////////// int bg_muxer_create(bg_visitor_t *vis) { ///////////////////////////////////////////////////////////////////////////// vis->vmt=&bg_muxer_vmt; vis->depth=0; ///////////////////////////////////////////////////////////////////////////// return 0; } static void bg_muxer_destroy(bg_visitor_t *vis FFUNUSED) { } /////////////////////////////////////////////////////////////////////////////// static int bg_muxer_copy_file(ffchar_t *source, ffchar_t *target) { int err=-1; #if defined (_WIN32) // [ DeleteFileW(target); CopyFileW( source, // LPCTSTR lpExistingFileName, target, // LPCTSTR lpNewFileName, 0 // BOOL bFailIfExists ); err=0; #else // ] [ // https://stackoverflow.com/questions/2180079/how-can-i-copy-a-file-on-unix-using-c struct { int source,target; } fd; char buf[4096],*bp; ssize_t size,written; fd.source=open(source,O_RDONLY); if (fd.source<0) { #if 0 // [ #if defined (_WIN32) // [ _DMESSAGEV("opening source \"%S\"",source); #else // ] [ _DMESSAGEV("opening source \"%s\"",source); #endif // ] #else // ] [ _DMESSAGEV("opening source \"%" PBU_PRIs "\"",source); #endif // ] goto e_source; } remove(target); fd.target=open(target,O_WRONLY|O_CREAT|O_EXCL,0666); if (fd.target<0) { #if 0 // [ #if defined (_WIN32) // [ _DMESSAGEV("opening target \"%S\"",target); #else // ] [ _DMESSAGEV("opening target \"%s\"",target); #endif // ] #else // ] [ _DMESSAGEV("opening target \"%" PBU_PRIs "\"",target); #endif // ] goto e_target; } for (;;) { size=read(fd.source,buf,sizeof buf); if (size<=0) break; bp=buf; while (0param; if (!(BG_FLAGS_EXT_COPY&tree->param->flags.extension)) goto success; else if (tree->param->overwrite) goto success; // file annotation is created in each case. if (param->output.dirname||param->overwrite) { if (tree->vmt->annotation.create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } } if (bg_muxer_copy_file(tree->source.path,tree->temp.path)<0) { _DMESSAGE("copying"); goto e_copy; } ff_mv(tree->temp.path,tree->target.path); ///////////////////////////////////////////////////////////////////////////// success: err=0; //cleanup: e_copy: if (param->output.dirname||param->overwrite) tree->vmt->annotation.destroy(tree); e_annotate: return err; } #endif // ] static int bg_muxer_dispatch_file(bg_visitor_t *vis FFUNUSED, bg_tree_t *tree) { #if defined (BG_PARAM_THREADS) // [ int err=-1; if (tree->param->nthreads) { #if defined (BG_PARAM_SCRIPT) // [ bg_param_threads_visitor_run(&tree->param->threads,tree->param->script, vis,tree,bg_muxer_file); #else // ] [ bg_param_threads_visitor_run(&tree->param->threads,vis,tree, bg_muxer_file); #endif // ] err=0; } else err=bg_muxer_file(tree,vis); return err; #else // ] [ int err=-1; bg_param_t *param=tree->param; if (!(BG_FLAGS_EXT_COPY&tree->param->flags.extension)) goto success; else if (tree->param->overwrite) goto success; // file annotation is created in each case. if (param->output.dirname||param->overwrite) { if (tree->vmt->annotation.create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } } if (bg_muxer_copy_file(tree->source.path,tree->temp.path)<0) { _DMESSAGE("copying"); goto e_copy; } ff_mv(tree->temp.path,tree->target.path); ///////////////////////////////////////////////////////////////////////////// success: err=0; //cleanup: e_copy: if (param->output.dirname||param->overwrite) tree->vmt->annotation.destroy(tree); e_annotate: return err; #endif // ] } #if defined (BG_PARAM_THREADS) // [ //#define BG_MUXER_PARENT static int bg_muxer_track(bg_tree_t *tree, bg_visitor_t *vis) { int err=-1; bg_track_t *track=&tree->track; #if defined (BG_MUXER_PARENT) // [ bg_tree_t *parent=tree->parent; #endif // ] bg_param_t *param=tree->param; int apply=BG_FLAGS_MODE_APPLY¶m->flags.mode; #if defined (FF_FLAC_HACK) // [ int hack; AVCodecParameters *codecpar; //enum AVSampleFormat sample_fmt; #endif // ] enum AVSampleFormat sample_fmt; ff_inout_t output; double gain_track,gain_album,gain,volume; char filter[128]={}; ff_muxer_t muxer; ///////////////////////////////////////////////////////////////////////////// ++vis->depth; // [ ///////////////////////////////////////////////////////////////////////////// //_DWRITELNV("\"%s\"",tree->source.path); #if defined (FF_FLAC_HACK) // [ if (ff_input_open_muxer(&track->input,&hack)<0) { _DMESSAGE("re-opening input"); goto e_input; } //fprintf(stderr,"(%s,%d,%s) %d\n",pbu_basename(__FILE__),__LINE__,__func__,hack);fflush(stderr);exit(1); #else // ] [ if (ff_input_open_muxer(&track->input)<0) { _DMESSAGE("re-opening input"); goto e_input; } #endif // ] //_DWRITELNV("\"%s\"",tree->source.path); ///////////////////////////////////////////////////////////////////////////// // track annotation is created in each case. if (param->output.dirname||param->overwrite) { if (tree->vmt->annotation.create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } } //_DWRITELNV("\"%s\"",tree->source.path); ///////////////////////////////////////////////////////////////////////////// #if defined (BG_PARAM_QUIET) // [ if (!param->quiet) { #endif // ] #if defined (BG_PARAM_SKIP_SCAN) // [ if (param->skip_scan) _FPRINTFV(stdout,"%s\n",bg_tree_out_basename(tree)); else { #endif // ] _FPRINTFV(stdout,"[%lu/%lu] %s\n",track->root.id,param->count.max, bg_tree_out_basename(tree)); #if defined (BG_PARAM_SKIP_SCAN) // [ } #endif // ] fflush(stdout); #if defined (BG_PARAM_QUIET) // [ } #endif // ] //_DWRITELNV("\"%s\"",tree->source.path); //#if defined (_WIN32) // [ //fprintf(stderr,"\"%S\"\n",tree->source.path); fflush(stderr); //#endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ codecpar=track->input.fmt.ctx->streams[track->input.ai]->codecpar; sample_fmt=hack?codecpar->format:AV_SAMPLE_FMT_NONE; // as it seems it is impossible to pass through a partial flac stream // (cf. "https://trac.ffmpeg.org/ticket/7864".) our hack consists in // reading/decoding and re-encoding/writing./ hence we've need to tell // the output the format from decoding. //codecpar=track->input.fmt.ctx->streams[track->input.ai]->codecpar; //sample_fmt=hack?codecpar->format:AV_SAMPLE_FMT_NONE; #if defined (FF_INPUT_LIST) // [ err=ff_output_create(&output,&bg_output_callback,tree,sample_fmt, param->process&¶m->list.out); #else // ] [ err=ff_output_create(&output,&bg_output_callback,tree,sample_fmt); #endif // ] if (err<0) { _DMESSAGE("creating output"); goto e_output; } #else // ] [ sample_fmt=AV_SAMPLE_FMT_NONE; if (ff_output_create(&output,&bg_output_callback,tree,sample_fmt)<0) { _DMESSAGE("creating output streams"); goto e_output; } #endif // ] //_DWRITELNV("\"%s\"",tree->source.path); ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ apply=apply&&!hack; #endif // ] if (apply) { if (param->weight.enabled) { #if defined (BG_MUXER_PARENT) // [ gain_album=param->norm-lib1770_stats_get_mean(parent->stats.momentary, param->momentary.mean.gate); #else // ] [ gain_album=param->norm-lib1770_stats_get_mean(tree->stats.momentary, param->momentary.mean.gate); #endif // ] gain_track=param->norm-lib1770_stats_get_mean(tree->stats.momentary, param->momentary.mean.gate); gain=gain_album+param->weight.value*(gain_track-gain_album); _DWRITELNV("gain1=%1.2f",gain); } else { #if defined (BG_MUXER_PARENT) // [ gain=param->norm-lib1770_stats_get_mean(parent->stats.momentary, param->momentary.mean.gate); #else // ] [ gain=param->norm-lib1770_stats_get_mean(tree->stats.momentary, param->momentary.mean.gate); #endif // ] _DWRITELNV("gain2=%1.2f",gain); } volume=LIB1770_DB2Q(gain); snprintf(filter,sizeof filter,"volume=%1.2f",volume); fprintf(stderr,"filter:\"%s\"\n",filter);fflush(stderr); } #if 0 // [ _DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); _DWRITELNV("filter=\"%s\"",filter); #else // ] [ //fprintf(stderr,"filter:\"%s\"\n",filter);fflush(stderr); #endif // ] /////////////////////////////////////////////////////////////////////////// if (ff_muxer_create(&muxer,&track->input,&output,apply?filter:NULL)<0) { _DMESSAGE("creating muxer"); goto e_muxer; } //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); ///////////////////////////////////////////////////////////////////////////// if (ff_muxer_loop(&muxer)<0) { _DMESSAGE("re-encoder looping"); goto e_loop; } //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_loop: //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); ff_muxer_destroy(&muxer); e_muxer: //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); ff_output_destroy(&output); e_output: //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); if (err) ff_rm(tree->temp.path); else { // before moving/renaming the newley created file we first must have // closed the muxer/output/input!!! //_DWRITELNV("\"%" PBU_PRIs "\"",tree->source.path); ff_input_close(&track->input); #if defined (BG_PARAM_SLEEP) // [ if (0sleep) { #if defined (_WIN32) // [ Sleep(param->sleep); #else // ] [ sleep(param->sleep); #endif // ] } #endif // ] //_DWRITELNV("\"%s\"",tree->source.path); err=ff_mv(tree->temp.path,tree->target.path); //_DWRITELNV("\"%s\"",tree->source.path); if (err<0) _DMESSAGE("moving"); } //_DWRITELNV("\"%s\"",tree->source.path); if (param->output.dirname||param->overwrite) tree->vmt->annotation.destroy(tree); e_annotate: //_DWRITELNV("\"%s\"",tree->source.path); ff_input_close(&track->input); e_input: --vis->depth; // ] //_DWRITELNV("\"%s\" err:%d",tree->source.path,err); return err; } #endif // ] static int bg_muxer_dispatch_track(bg_visitor_t *vis FFUNUSED, bg_tree_t *tree) { int err=-1; #if defined (BG_PARAM_THREADS) // [ if (tree->param->nthreads) { #if defined (BG_PARAM_SCRIPT) // [ bg_param_threads_visitor_run(&tree->param->threads,tree->param->script, vis,tree,bg_muxer_track); #else // ] [ bg_param_threads_visitor_run(&tree->param->threads,vis,tree, bg_muxer_track); #endif // ] err=0; } else { #if defined (BG_PARAM_SCRIPT) // [ if (tree->param->script) err=bg_process_tree_run_script(tree); else #endif // ] err=bg_muxer_track(tree,vis); return err; } #else // ] [ bg_track_t *track=&tree->track; bg_tree_t *parent=tree->parent; bg_param_t *param=tree->param; //FILE *f=param->result.f; int apply=BG_FLAGS_MODE_APPLY¶m->flags.mode; #if defined (FF_FLAC_HACK) // [ int hack; AVCodecParameters *codecpar; enum AVSampleFormat sample_fmt; #endif // ] ff_inout_t output; double gain_track,gain_album,gain,volume; char filter[128]; ff_muxer_t muxer; ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ if (ff_input_open_muxer(&track->input,&hack)<0) { _DMESSAGE("re-opening input"); goto e_input; } #else // ] [ if (ff_input_open_muxer(&track->input)<0) { _DMESSAGE("re-opening input"); goto e_input; } #endif // ] ///////////////////////////////////////////////////////////////////////////// // track annotation is created in each case. if (param->output.dirname||param->overwrite) { if (tree->vmt->annotation.create(tree)<0) { _DMESSAGE("annotating"); goto e_annotate; } } ///////////////////////////////////////////////////////////////////////////// #if defined (BG_PARAM_QUIET) // [ if (!param->quiet) { #endif // ] #if defined (BG_PARAM_SKIP_SCAN) // [ if (param->skip_scan) fprintf(stdout,"%s\n",bg_tree_out_basename(tree)); else { #endif // ] fprintf(stdout,"[%lu/%lu] %s\n",track->root.id,param->count.max, bg_tree_out_basename(tree)); #if defined (BG_PARAM_SKIP_SCAN) // [ } #endif // ] fflush(stdout); #if defined (BG_PARAM_QUIET) // [ } #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ // as it seems it is impossible to pass through a partial flac stream // (cf. "https://trac.ffmpeg.org/ticket/7864".) our hack consists in // reading/decoding and re-encoding/writing./ hence we've need to tell // the output the format from decoding. codecpar=track->input.fmt.ctx->streams[track->input.ai]->codecpar; sample_fmt=hack?codecpar->format:AV_SAMPLE_FMT_NONE; if (ff_output_create(&output,&bg_output_callback,tree,sample_fmt)<0) { _DMESSAGE("creating output"); goto e_output; } #else // ] [ if (ff_output_streams_create(&output)<0) { _DMESSAGE("creating output streams"); goto e_output_streams; } #endif // ] ///////////////////////////////////////////////////////////////////////////// #if defined (FF_FLAC_HACK) // [ apply=apply&&!hack; #endif // ] if (apply) { if (param->weight.enabled) { gain_album=param->norm-lib1770_stats_get_mean(parent->stats.momentary, param->momentary.mean.gate); gain_track=param->norm-lib1770_stats_get_mean(tree->stats.momentary, param->momentary.mean.gate); gain=gain_album+param->weight.value*(gain_track-gain_album); } else { gain=param->norm-lib1770_stats_get_mean(parent->stats.momentary, param->momentary.mean.gate); } volume=LIB1770_DB2Q(gain); snprintf(filter,sizeof filter,"volume=%1.2f",volume); } /////////////////////////////////////////////////////////////////////////// if (ff_muxer_create(&muxer,&track->input,&output,apply?filter:NULL)<0) { _DMESSAGE("creating muxer"); goto e_muxer; } ///////////////////////////////////////////////////////////////////////////// if (ff_muxer_loop(&muxer)<0) { _DMESSAGE("re-encoder looping"); goto e_loop; } ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_loop: ff_muxer_destroy(&muxer); e_muxer: ff_output_destroy(&output); e_output: if (err) ff_rm(tree->temp.path); else { // before moving/renaming the newley created file we first must have // closed the muxer/output/input!!! ff_input_close(&track->input); #if defined (BG_PARAM_SLEEP) // [ if (0sleep) { #if defined (_WIN32) // [ Sleep(param->sleep); #else // ] [ sleep(param->sleep); #endif // ] } #endif // ] err=ff_mv(tree->temp.path,tree->target.path); if (err<0) _DMESSAGE("moving"); } if (param->output.dirname||param->overwrite) tree->vmt->annotation.destroy(tree); e_annotate: ff_input_close(&track->input); e_input: #endif // ] return err; } static int bg_muxer_dispatch_album(bg_visitor_t *vis, bg_tree_t *tree) { int err=-1; bg_tree_t *cur; #if defined (BG_PARAM_THREADS) // [ ///////////////////////////////////////////////////////////////////////////// tree->helper.nchildren=tree->album.nchildren.cur; _DWRITELNV(">>> %u (%u %p)",tree->helper.nchildren,tree->album.nchildren.cur,tree->album.first); #endif // ] ///////////////////////////////////////////////////////////////////////////// for (cur=tree->album.first;cur;cur=cur->next) { #if 0 // [ #if defined (_WIN32) // [ _DWRITELNV(" * \"%S\"",cur->source.path); #else // ] [ _DWRITELNV(" * \"%s\"",cur->source.path); #endif // ] #else // ] [ _DWRITELNV(" * \"%" PBU_PRIs "\"",cur->source.path); #endif // ] if (cur->vmt->accept(cur,vis)<0) { _DMESSAGE("child accepting muxer"); goto e_child; } } #if defined (BG_PARAM_THREADS) // [ ///////////////////////////////////////////////////////////////////////////// if (tree->param->nthreads) { bg_sync_lock(&tree->helper.sync); // { while (tree->helper.nchildren) bg_sync_wait(&tree->helper.sync); bg_sync_unlock(&tree->helper.sync); // } #if defined (BG_VISITOR_NOTIFY_PARENT) // [ if (tree->parent) { bg_sync_lock(&tree->helper.sync); // { bg_sync_signal(&tree->helper.sync); bg_sync_unlock(&tree->helper.sync); // } } #endif // ] } #endif // ] ///////////////////////////////////////////////////////////////////////////// err=0; //cleanup: e_child: return err; } static int bg_muxer_dispatch_root(bg_visitor_t *vis, bg_tree_t *tree) { int err=-1; bg_tree_t *cur; ///////////////////////////////////////////////////////////////////////////// for (cur=tree->album.first;cur;cur=cur->next) { if (cur->vmt->accept(cur,vis)<0) { _DMESSAGE("accepting visitor"); goto e_child; } } ///////////////////////////////////////////////////////////////////////////// err=0; // cleanup: e_child: return err; } static bg_visitor_vmt_t bg_muxer_vmt={ #if defined (PBU_DEBUG) // [ .id="muxer", #endif // ] .destroy=bg_muxer_destroy, .dispatch_file=bg_muxer_dispatch_file, .dispatch_track=bg_muxer_dispatch_track, .dispatch_album=bg_muxer_dispatch_album, .dispatch_root=bg_muxer_dispatch_root, }; /////////////////////////////////////////////////////////////////////////////// enum bg_muxer_tag_bit { BG_MUXER_TAG_BIT_ALGORITHM=1ul<<0ul, BG_MUXER_TAG_BIT_REFERENCE_LOUDNESS=1ul<<1ul, BG_MUXER_TAG_BIT_TRACK_GAIN=1ul<<2ul, BG_MUXER_TAG_BIT_TRACK_PEAK=1ul<<3ul, BG_MUXER_TAG_BIT_ALBUM_GAIN=1ul<<4ul, BG_MUXER_TAG_BIT_ALBUM_PEAK=1ul<<5ul, BG_MUXER_TAG_BIT_MAX=1ul<<6ul, }; #if defined (FF_MUXER_CALLBACK_TAG_BIT_MAX) // [ static unsigned int bg_muxer_tag_bit_max(void *data FFUNUSED) { return BG_MUXER_TAG_BIT_MAX; } #endif // ] static const char *bg_muxer_path(const void *data) { #if defined (_WIN32) // [ return ((const bg_tree_t *)data)->track.temp.path; #else // ] [ return ((const bg_tree_t *)data)->temp.path; #endif // ] } static const ff_analyzer_t *bg_muxer_analyzer(const void *data) { return &((const bg_tree_t *)data)->track.analyzer; } static enum AVSampleFormat bg_muxer_sample_fmt(const void *data FFUNUSED) { return AV_SAMPLE_FMT_S32; } #if defined (_WIN32) // [ #define STRCASECMP(s1,s2) stricmp(s1,s2) #define STRNCASECMP(s1,s2,n) strnicmp(s1,s2,n) #else // ] [ #define STRCASECMP(s1,s2) strcasecmp(s1,s2) #define STRNCASECMP(s1,s2,n) strncasecmp(s1,s2,n) #endif // ] static void bg_tag(void *data, bg_bits_t *bits, const char *key, const char *ivalue, AVDictionary **om) { enum { #if 0 // [ BG_MUXER_FLAGS=AV_DICT_IGNORE_SUFFIX, #else // ] [ BG_MUXER_FLAGS=0, #endif // ] }; bg_tree_t *tree=data; bg_tree_t *parent=tree->parent; bg_param_t *param=tree->param; size_t len=strlen(param->tag.pfx); char ovalue[128]; double gain; ENTER(__func__); if (!key) { _DMESSAGE("missing key"); LEAVE(); return; } PRINTF(__FILE__,__LINE__,"key:%s\n",key); if (STRNCASECMP(param->tag.pfx,key,len)) { if (!ivalue) { _DMESSAGE("missing value"); LEAVE(); return; } PRINTF(__FILE__,__LINE__,"ivalue:%s\n",ivalue); // plain copy. av_dict_set(om,key,ivalue,BG_MUXER_FLAGS); } else if (!STRCASECMP(key+len,"ALGORITHM")) { if (!(*bits&BG_MUXER_TAG_BIT_ALGORITHM)) { // modified copy. strncpy(ovalue,"BS.1770",(sizeof ovalue)-1); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_ALGORITHM; } } else if (!STRCASECMP(key+len,"REFERENCE_LOUDNESS")) { if (!(*bits&BG_MUXER_TAG_BIT_REFERENCE_LOUDNESS)) { // modified copy. snprintf(ovalue,sizeof ovalue,"%1.1f %sFS",param->norm, param->unit->n.lu); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_REFERENCE_LOUDNESS; } } else if (!STRCASECMP(key+len,"TRACK_GAIN")) { if (BG_FLAGS_MODE_TAGS_TRACK¶m->flags.mode) { if (BG_FLAGS_MODE_APPLY¶m->flags.mode||!tree->stats.momentary) { // suppress. } else if (!(*bits&BG_MUXER_TAG_BIT_TRACK_GAIN)) { // modified copy. gain=param->norm-lib1770_stats_get_mean(tree->stats.momentary, param->momentary.mean.gate); snprintf(ovalue,sizeof ovalue,"%1.1f %s",gain,param->unit->n.lu); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_TRACK_GAIN; } } } else if (!STRCASECMP(key+len,"TRACK_PEAK")) { if (BG_FLAGS_MODE_TAGS_TRACK¶m->flags.mode) { if ((BG_FLAGS_MODE_APPLY¶m->flags.mode) ||!(BG_FLAGS_AGG_PEAK¶m->flags.aggregate)) { // suppress. } else if (!(*bits&BG_MUXER_TAG_BIT_TRACK_PEAK)) { // modified copy. if (BG_FLAGS_AGG_TRUEPEAK¶m->flags.aggregate) snprintf(ovalue,sizeof ovalue,"%f",tree->stats.truepeak); else snprintf(ovalue,sizeof ovalue,"%f",tree->stats.samplepeak); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_TRACK_PEAK; } } } else if (!STRCASECMP(key+len,"ALBUM_GAIN")) { if (BG_FLAGS_MODE_TAGS_ALBUM¶m->flags.mode) { if (BG_FLAGS_MODE_APPLY¶m->flags.mode||!parent ||!parent->stats.momentary) { // suppress. } else if (!(*bits&BG_MUXER_TAG_BIT_ALBUM_GAIN)) { // modified copy. gain=param->norm-lib1770_stats_get_mean(parent->stats.momentary, param->momentary.mean.gate); snprintf(ovalue,sizeof ovalue,"%1.1f %s",gain,param->unit->n.lu); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_ALBUM_GAIN; } } } else if (!STRCASECMP(key+len,"ALBUM_PEAK")) { PUTS(__FILE__,__LINE__,"ALBUM_PEAK\n"); if (BG_FLAGS_MODE_TAGS_ALBUM¶m->flags.mode) { if ((BG_FLAGS_MODE_APPLY¶m->flags.mode)||!parent ||!(BG_FLAGS_AGG_PEAK¶m->flags.aggregate)) { // suppress. } else if (!(*bits&BG_MUXER_TAG_BIT_ALBUM_PEAK)) { // modified copy. if (BG_FLAGS_AGG_TRUEPEAK¶m->flags.aggregate) snprintf(ovalue,sizeof ovalue,"%f",parent->stats.truepeak); else /*if (BG_FLAGS_AGG_SAMPLEPEAK¶m->flags.aggregate)*/ snprintf(ovalue,sizeof ovalue,"%f",parent->stats.samplepeak); av_dict_set(om,key,ovalue,BG_MUXER_FLAGS); *bits|=BG_MUXER_TAG_BIT_ALBUM_PEAK; } } } else { // suppress. } LEAVE(); } #if defined (FF_STREAM_METADATA) // [ static void bg_muxer_metadata(void *data, AVDictionary **om, const AVDictionary *im, ff_metadata_type_t type FFUNUSED) #else // ] [ static void bg_muxer_metadata(void *data, AVDictionary **om, const AVDictionary *im) #endif // ] { bg_param_t *param=((bg_tree_t *)data)->param; size_t len=strlen(param->tag.pfx); const AVDictionaryEntry *opt=NULL; bg_bits_t bits=0ul; char key[128]; #if 0 // [ // it makes no sense to first copy all tags over. for (;;) { opt=av_dict_get(im,"",opt,AV_DICT_IGNORE_SUFFIX); if (!opt) break; bg_tag(data,&bits,opt->key,opt->value,om); } #endif // ] #if defined (FF_STREAM_METADATA) // [ if (FF_METADATA_TYPE_VIDEO!=type) { #endif // ] // set tags with results from analysis. strcpy(key,param->tag.pfx); //if (!(BG_MUXER_TAG_BIT_ALGORITHM&bits)) { strcpy(key+len,"ALGORITHM"); bg_tag(data,&bits,key,NULL,om); //} //if (!(BG_MUXER_TAG_BIT_REFERENCE_LOUDNESS&bits)) { strcpy(key+len,"REFERENCE_LOUDNESS"); bg_tag(data,&bits,key,NULL,om); //} //if (!(BG_MUXER_TAG_BIT_TRACK_GAIN&bits)) { strcpy(key+len,"TRACK_GAIN"); bg_tag(data,&bits,key,NULL,om); //} //if (!(BG_MUXER_TAG_BIT_TRACK_PEAK&bits)) { strcpy(key+len,"TRACK_PEAK"); bg_tag(data,&bits,key,NULL,om); //} //if (!(BG_MUXER_TAG_BIT_ALBUM_GAIN&bits)) { strcpy(key+len,"ALBUM_GAIN"); bg_tag(data,&bits,key,NULL,om); //} //if (!(BG_MUXER_TAG_BIT_ALBUM_PEAK&bits)) { strcpy(key+len,"ALBUM_PEAK"); bg_tag(data,&bits,key,NULL,om); //} #if defined (FF_STREAM_METADATA) // [ } #endif // ] #if 1 // [ // it makes make more sense to copy remaining tags over. for (;;) { opt=av_dict_get(im,"",opt,AV_DICT_IGNORE_SUFFIX); if (!opt) break; bg_tag(data,&bits,opt->key,opt->value,om); } #endif // ] } static enum AVCodecID bg_muxer_codec_id(const void *data, const AVOutputFormat *oformat) { const bg_tree_t *tree=(const bg_tree_t *)data; const bg_param_t *param=tree->param; FF_CONST AVCodec *codec; #if defined (BG_COMPILE_TIME_EXPR) // [ if (*param->codec.name) { #else // ] [ if (param->codec.name&&*param->codec.name) { #endif // ] codec=avcodec_find_encoder_by_name(param->codec.name); if (!codec) { _DWARNINGV("audio codec \"%s\" does not exist;" " falling back to \"FLAC\"",param->codec.name); return AV_CODEC_ID_FLAC; } else if (codec->idcodec.name); return AV_CODEC_ID_FLAC; } else if (AV_CODEC_ID_FIRST_SUBTITLE<=codec->id) { _DWARNINGV("codec \"%s\" is not an audio codec;" " falling back to \"FLAC\"",param->codec.name); return AV_CODEC_ID_FLAC; } else return codec->id; } else { if (!param->out.sfx&&avformat_query_codec(oformat,AV_CODEC_ID_FLAC, FF_COMPLIANCE_EXPERIMENTAL)) { return AV_CODEC_ID_FLAC; } return oformat->audio_codec; } } static ff_output_callback_t bg_output_callback={ .path=bg_muxer_path, .analyzer=bg_muxer_analyzer, .sample_fmt=bg_muxer_sample_fmt, .metadata=bg_muxer_metadata, .codec_id=bg_muxer_codec_id, }; bs1770gain-0.9.8/libbg/bg_parse_time.c0000755000175000017500000000353415035710477014277 00000000000000/* * bg_parse_time.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if ! defined (_WIN32) // [ #include #endif // ] #include // parse timestamp in AV_TIME_BASE units. int64_t bg_parse_time(const ffchar_t *s) { enum { BASE=AV_TIME_BASE }; int64_t ts=0ll; int64_t num=0ll; int64_t den=1ll; int ncolon=0; for (;*s;++s) { if (FFL(':'==*s)) { if (2==ncolon) { _DMESSAGEV("more than %d colons in timestamp not supported",ncolon); goto exit; } ++ncolon; ts*=60ll; } else if (FFISDIGIT(*s)) { ts*=10ll; ts+=*s-FFL('0'); } #if 0 // [ else { _DMESSAGEV("unexpected character '\\x%x' in timestamp",*s); goto exit; } #else // ] [ else break; #endif // ] } if (FFL('.'==*s)) { for (++s;*s;++s) { if (FFISDIGIT(*s)) { num*=10ll; num+=*s-FFL('0'); den*=10ll; } else { _DMESSAGEV("unexpected character '\\x%x' in timestamp",*s); goto exit; } } } exit: ts*=BASE; ts+=BASE*num/den; return ts; } bs1770gain-0.9.8/libbg/bg_utf8_iter.c0000755000175000017500000001374015035710477014060 00000000000000/* * bg_utf8_iter.c * * Copyright (C) 2019 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #include #if 1 && defined (BG_UTF8_ITER) // [ #include // Iterate backwards through a utf8 multibyte string: // https://stackoverflow.com/questions/22257486/iterate-backwards-through-a-utf8-multibyte-string /////////////////////////////////////////////////////////////////////////////// static bg_utf8_iter_vmt_t bg_iter_utf8_le_vmt; //#define BG_UTF8_ITER_BE #if defined (BG_UTF8_ITER_BE) // [ static bg_utf8_iter_vmt_t bg_utf8_iter_be_vmt; #endif // ] /////////////////////////////////////////////////////////////////////////////// #if defined (BG_UTF8_ITER_BE) // [ static int le(void) { // decide whether we're on little endian or on big endian: // https://www.geeksforgeeks.org/little-and-big-endian-mystery/ // big endian is not defined yet!!! uint32_t i=1ul; const uint8_t *p=(const uint8_t *)&i; return *p; } #endif // ] void bg_utf8_iter_first(bg_utf8_iter_t *i, const char *rp, char *wp, size_t *size) { #if defined (BG_UTF8_ITER_BE) // [ i->vmt=le()?&bg_iter_utf8_le_vmt:&bg_utf8_iter_be_vmt; #else // ] [ i->vmt=&bg_iter_utf8_le_vmt; #endif // ] i->rp=(const uint8_t *)rp; i->wp=(uint8_t *)wp; i->size=size; return; } /////////////////////////////////////////////////////////////////////////////// static int bg_utf8_iter_le_valid(bg_utf8_iter_t *i) { // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". const uint8_t *rp=i->rp; uint8_t *wp=i->mbs; #if defined (BG_UTF8_ITER_WCS) // [ i->wcs=0u; #else // ] [ //memset(wp,0,sizeof i->mbs); #endif // ] if (!*i->rp) goto exit; else if (*i->rp==(BG_UTF8_ITER_MASK_ONE_BYTE&*i->rp)) { #if 0 // [ memcpy(wp,i->rp,1); #else // ] [ *wp++=*rp++; #endif // ] } else if (*i->rp==(BG_UTF8_ITER_MASK_TWO_BYTES&*i->rp)) { #if 0 // [ memcpy(wp,i->rp,2); #else // ] [ *wp++=*rp++; *wp++=*rp++; #endif // ] } else if (*i->rp==(BG_UTF8_ITER_MASK_THREE_BYTES&*i->rp)) { #if 0 // [ memcpy(wp,i->rp,3); #else // ] [ *wp++=*rp++; *wp++=*rp++; *wp++=*rp++; #endif // ] } else if (*i->rp==(BG_UTF8_ITER_MASK_FOUR_BYTES&*i->rp)) { #if 0 // [ memcpy(wp,i->rp,4); #else // ] [ *wp++=*rp++; *wp++=*rp++; *wp++=*rp++; *wp++=*rp++; #endif // ] } else goto exit; ///////////////////////////////////////////////////////////////////////////// return 1; exit: return 0; } #if 0 // [ static const uint8_t *bg_utf8_iter_le_next(bg_utf8_iter_t *i) { // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". if (*i->rp==(BG_UTF8_ITER_MASK_ONE_BYTE&*i->rp)) i->rp+=1; else if (*i->rp==(BG_UTF8_ITER_MASK_TWO_BYTES&*i->rp)) i->rp+=2; else if (*i->rp==(BG_UTF8_ITER_MASK_THREE_BYTES&*i->rp)) i->rp+=3; else if (*i->rp==(BG_UTF8_ITER_MASK_FOUR_BYTES&*i->rp)) i->rp+=4; return i->rp; } #else // ] [ static const uint8_t *bg_utf8_iter_le_next(bg_utf8_iter_t *i) { uint8_t *wp=i->mbs; // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". if (*i->rp==(BG_UTF8_ITER_MASK_ONE_BYTE&*i->rp)) *wp++=*i->rp++; else if (*i->rp==(BG_UTF8_ITER_MASK_TWO_BYTES&*i->rp)) { *wp++=*i->rp++; *wp++=*i->rp++; } else if (*i->rp==(BG_UTF8_ITER_MASK_THREE_BYTES&*i->rp)) { *wp++=*i->rp++; *wp++=*i->rp++; *wp++=*i->rp++; } else if (*i->rp==(BG_UTF8_ITER_MASK_FOUR_BYTES&*i->rp)) { *wp++=*i->rp++; *wp++=*i->rp++; *wp++=*i->rp++; *wp++=*i->rp++; } return i->rp; } #endif // ] static void bg_utf8_iter_le_apply(bg_utf8_iter_t *i) { // cf. e.g. "https://en.wikipedia.org/wiki/UTF-8#Description". const uint8_t *rp=i->mbs; if (*rp==(BG_UTF8_ITER_MASK_ONE_BYTE&*rp)) { if (i->wp) *i->wp++=*rp++; if (i->size) *i->size+=1; } else if (*rp==(BG_UTF8_ITER_MASK_TWO_BYTES&*rp)) { if (i->wp) { memcpy(i->wp,rp,2); i->wp+=2; } if (i->size) *i->size+=2; } else if (*rp==(BG_UTF8_ITER_MASK_THREE_BYTES&*rp)) { if (i->wp) { memcpy(i->wp,rp,3); i->wp+=3; } if (i->size) *i->size+=3; } else if (*rp==(BG_UTF8_ITER_MASK_FOUR_BYTES&*rp)) { if (i->wp) { memcpy(i->wp,rp,4); i->wp+=4; } if (i->size) *i->size+=4; } } static void bg_utf8_iter_le_flush(bg_utf8_iter_t *i) { if (i->wp) *i->wp++=0; if (i->size) ++*i->size; } static bg_utf8_iter_vmt_t bg_iter_utf8_le_vmt={ .valid=bg_utf8_iter_le_valid, .next=bg_utf8_iter_le_next, .apply=bg_utf8_iter_le_apply, .flush=bg_utf8_iter_le_flush, }; #if defined (BG_UTF8_ITER_BE) // [ /////////////////////////////////////////////////////////////////////////////// static int bg_utf8_iter_be_valid(bg_utf8_iter_t *i FFUNUSED) { _DMESSAGE("not implemented yet"); return 0; } static const uint8_t *bg_utf8_iter_be_next(bg_utf8_iter_t *i) { _DMESSAGE("not implemented yet"); return i->rp; } static void bg_utf8_iter_be_apply(bg_utf8_iter_t *i FFUNUSED) { _DMESSAGE("not implemented yet"); } static void bg_utf8_iter_be_flush(bg_utf8_iter_t *i FFUNUSED) { _DMESSAGE("not implemented yet"); } static bg_utf8_iter_vmt_t bg_utf8_iter_be_vmt={ .valid=bg_utf8_iter_be_valid, .next=bg_utf8_iter_be_next, .apply=bg_utf8_iter_be_apply, .flush=bg_utf8_iter_be_flush, }; #endif // ] #endif // ] bs1770gain-0.9.8/libbg/bgx.c0000755000175000017500000036731215036370023012254 00000000000000/* * bgx.c * * Copyright (C) 2014-2024 Peter Belkner * Nanos gigantum humeris insidentes #TeamWhite * * 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.0 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 library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301 USA */ #if defined (_WIN32) // [ #include #include #include #else // ] [ #include #include #if defined (__linux__) && defined (__GNUC__) // [ #include #endif // ] #endif // ] #include #include #if defined (HAVE_FF_DYNLOAD) // [ #include "bg_version.h" #endif // ] /////////////////////////////////////////////////////////////////////////////// /* * once meant as an example program on how to deal with "libbg.a" (and in * turn with "libff.a") finally serving as bs1770gain's implementation. */ #define BG_FIX_BUG_1086584 #if 1 // [ #if 1 // [ #define BG_TEAM_WHITE \ " #WLM" #else // ] [ #define BG_TEAM_WHITE \ "" #endif // ] #define BG_NANOS_GIGANTUM_HUMERIS_INSIDENTES \ "Nanos gigantum humeris insidentes." BG_TEAM_WHITE "\n" #endif // ] /////////////////////////////////////////////////////////////////////////////// #if defined (HAVE_BG_XML) // [ void bg_set_output_xml(bg_param_t *param) { param->print.vmt=&bg_print_xml_vmt; } int bg_is_output_xml(const bg_param_t *param) { return param->print.vmt==&bg_print_xml_vmt; } #else // ] [ void bg_set_output_xml(bg_param_t *param FFUNUSED) { } int bg_is_output_xml(const bg_param_t *param FFUNUSED) { return 0; } #endif // ] /////////////////////////////////////////////////////////////////////////////// static const ffchar_t *bg_version(const ffchar_t *path, FILE *f) { path=FFBASENAME(path); _FPRINTFV(f,"%" PBU_PRIs,path); #if defined (PACKAGE_VERSION) // [ _FPRINTFV(f," %s",PACKAGE_VERSION); #endif // ] _FPRINTF(f,", Copyright (C) Peter Belkner 2014-2024.\n"), #if defined (BG_NANOS_GIGANTUM_HUMERIS_INSIDENTES) // [ _FPRINTFV(f,"%s",BG_NANOS_GIGANTUM_HUMERIS_INSIDENTES); #endif // ] #if defined (PACKAGE_URL) // [ _FPRINTFV(f,"%s\n",PACKAGE_URL); #endif // ] #if defined (_WIN32) // [ #if defined (_WIN64) // [ _FPRINTFV(f,"%s","Compiled for Windows 64 bit"); #else // ] [ _FPRINTFV(f,"%s","Compiled for Windows 32 bit"); #endif // ] #elif defined (HAVE_FF_DYNLOAD) && defined (BG_POSIX_SYSNAME) // ] [ _FPRINTFV(f,"Compiled for %s",BG_POSIX_SYSNAME); #else // ] [ _FPRINTFV(f,"%s","Compiled"); #endif // ] #if defined (__GNUC__) // [ _FPRINTFV(f," by means of gcc %d.%d.%d",__GNUC__,__GNUC_MINOR__, __GNUC_PATCHLEVEL__); #endif // ] #if defined (BG_WINDOWS_MAJOR) // [ #if defined (BG_WINDOWS_CSD_VESIONA) // [ if (BG_WINDOWS_CSD_VESIONA[0]) { _FPRINTFV(f," on Windows %d.%d.%d\n(%s) expecting\n", BG_WINDOWS_MAJOR, BG_WINDOWS_MINOR, BG_WINDOWS_BUILD_NUMBER, BG_WINDOWS_CSD_VESIONA); } else { #endif // ] _FPRINTFV(f," on Windows %d.%d.%d\nexpecting\n", BG_WINDOWS_MAJOR, BG_WINDOWS_MINOR, BG_WINDOWS_BUILD_NUMBER); #if defined (BG_WINDOWS_CSD_VESIONA) // [ } #endif // ] #elif defined (HAVE_FF_DYNLOAD) // ] [ _FPRINTF(f," on\n"); if (BG_POSIX_NODENAME[0]) _FPRINTFV(f," nodename: %s,\n",BG_POSIX_NODENAME); if (BG_POSIX_RELEASE[0]) _FPRINTFV(f," release: %s,\n",BG_POSIX_RELEASE); if (BG_POSIX_VERSION[0]) _FPRINTFV(f," version: %s,\n",BG_POSIX_VERSION); if (BG_POSIX_MACHINE[0]) _FPRINTFV(f," machine: %s,\n",BG_POSIX_MACHINE); #if defined (BG_POSIX_DOMAINNAME) // [ if (BG_POSIX_DOMAINNAME[0]) _FPRINTFV(f," domainname: %s,\n",BG_POSIX_DOMAINNAME); #endif // ] _FPRINTF(f,"expecting\n"); #else // ] [ _FPRINTF(f," expecting\n"); #endif // ] #if defined (HAVE_FF_DYNLOAD) && defined (BG_GNU_LIBC_VERSION) // [ _FPRINTFV(f," libc: %s (%s),\n", BG_GNU_LIBC_VERSION,BG_GNU_LIBC_RELEASE); #endif // ] _FPRINTFV(f," libavutil: %d.%d.%d,\n", LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO); _FPRINTFV(f," libswresample: %d.%d.%d,\n", LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO); _FPRINTFV(f," libavcodec: %d.%d.%d,\n", LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO); _FPRINTFV(f," libavformat: %d.%d.%d,\n", LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO); _FPRINTFV(f," libswscale: %d.%d.%d,\n", LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO); #if defined (HAVE_LIBPOSTPROC) // [ _FPRINTFV(f," libpostproc: %d.%d.%d, and\n", LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO); #endif // ] _FPRINTFV(f," libavfilter: %d.%d.%d.\n", LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO); _FPRINTF(f,"This is free software; see the source for copying conditions." " There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR" " PURPOSE.\n"); return path; } #if defined (BG_SAMPLES_COUNT) // [ //#define UPSAMPLER_THRESHOULD #endif // ] static void bg_usage(const ffchar_t *path, FILE *f) { path=bg_version(path,f); _FPRINTFV(f,"\nUsage: %" PBU_PRIs,path); _FPRINTF(f," [options] [ ...]\n\n"); _FPRINTF(f,"Options:\n"); _FPRINTF(f," -v,--version: print this message and exit\n"); #if defined (BG_FIX_BUG_1086584) // [ _FPRINTF(f," -h,--help[=]?: print this message and exit\n" " (optional argument out of \"codec\" or \"suffix\")\n" " Please note that exactly the string representations of the codecs" " and\n" " muxers are listed which are registered with FFmpeg, respectively." " Cf.\n" " \"https://ffmpeg.org/doxygen/7.0/group__lavc__core.html#ga7cd040fcc147340186deb0c54dc996b0\" and\n" " \"https://ffmpeg.org/doxygen/5.1/group__lavf__core.html#ga1a0f4b562917ad7d627f252ad64cc952\".\n" " This by no means guarantees nor is it intended that those string\n" " representations are unique.\n"); #else // ] [ _FPRINTF(f," -h,--help[=]?: print this message and exit\n" " (optional argument out of \"codec\" or \"suffix\")\n"); #endif // ] ///////////////////////////////////////////////////////////////////////////// _FPRINTF(f," -i,--integrated: calculate integrated loudness\n"); _FPRINTF(f," -s,--shortterm: calculate maximum shortterm loudness\n"); _FPRINTF(f," -m,--momentary: calculate maximum momentary loudness\n"); #if defined (BG_LOUDNESS_ALL) // [ _FPRINTF(f," --loudness-all: the same as -ism --shortterm-mean\n"); #endif // ] _FPRINTF(f," -r,--range: calculate loudness range\n"); _FPRINTF(f," -p,--sample-peak: calculate maximum sample peak\n"); #if defined (BG_SAMPLES_COUNT) // [ #if defined (UPSAMPLER_THRESHOULD) // [ _FPRINTF(f," -t,--true-peak: calculate maximum true peak\n"); #else // ] [ _FPRINTF(f," -t,--true-peak[=]?: calculate\n" " maximum true peak after having skipped the specified number\n" " of samples from the up-sampler (default=0)\n"); #endif // ] #endif // ] _FPRINTF(f," -b ,--begin=: begin decoding at\n" " timestamp (in microseconds, format: hh:mm:ss.ms)\n"); _FPRINTF(f," -d ,--duration=: let decoding\n" " last duration (in microseconds, format: hh:mm:ss.ms)\n"); _FPRINTF(f," -u ,--use=: base replaygain calculation on\n" " (with respect to the -a/--apply and -o/--output\n" " options. available methods:\n" " integrated (default),\n" " momentary, or\n" " shortterm\n" " experimental methods:\n" " momentary-mean (synonym for \"integrated\"),\n" " momentary-maximum (synonym for \"momentary\"),\n" " shortterm-mean, or\n" " shortterm-maximum (synonym for \"shortterm\")\n"); _FPRINTF(f," -a []/--apply[=]: apply the EBU/ATSC/RG\n" " album gain (in conjunction with the -o/--output option.)\n" " when out of [0.0 .. 1.0] is provided: album gain\n" " plus *(track gain - album gain).\n"); _FPRINTF(f," -o ,--output=: write replaygain tags\n" " or apply the EBU/ATSC/RG gain, respectively,\n" " and output to .\n" " specify either option -o/--output or option --overwrite\n" " but not both.\n"); #if defined (BG_PARAM_PREAMP) // [ _FPRINTF(f," --preamp=\n"); #endif // ] #if ! defined (BG_UNICODE) // [ _FPRINTF(f," -f ,--file=: write analysis to an utf-8 log" " file\n"); _FPRINTF(f," --utf-16[=]: write an utf-16 log file instead of an" " utf-8\n" " log file ( can be omitted when provided by means of the\n" " -f/--file option.)\n"); #else // ] [ _FPRINTF(f," -f ,--file=: write analysis to a log file\n"); #endif // ] #if defined (BG_PARAM_REFERENCE) // [ _FPRINTF(f," --reference=: path to a tree\n" " structural equivalent to the input tree and its's leafes may\n" " serve as a reference to it's correponding input leafes.\n"); #endif // ] #if defined (BG_PARAM_SKIP_SCAN) // [ _FPRINTF(f," --skip-scan: skip counting files.\n"); #endif // ] #if defined (BG_SAMPLES_COUNT) && defined (UPSAMPLER_THRESHOULD) // [ _FPRINTF(f," --upsampler-threshould=: number of\n" " samples to skip when upsampling for true peak calculation\n"); #endif // ] #if defined (BG_PARAM_SCRIPT) // [ _FPRINTF(f," --script=